Buildsystem: default bootloader is not my custom one

You can set BANAN_BOOTLOADER=GRUB to use grub instead. Image creation
does not convert disk image now automatically between bootloaders and
calling ./bos image-full is now required.
This commit is contained in:
2023-11-18 17:18:03 +02:00
parent cadb56d8ba
commit 9e44e8be75
4 changed files with 41 additions and 61 deletions

View File

@@ -1,37 +0,0 @@
#!/bin/sh
set -e
if [[ -z $BANAN_DISK_IMAGE_PATH ]]; then
echo "You must set the BANAN_DISK_IMAGE_PATH environment variable" >&2
exit 1
fi
if [[ -z $BANAN_BUILD_DIR ]]; then
echo "You must set the BANAN_BUILD_DIR environment variable" >&2
exit 1
fi
ROOT_PARTITION_INDEX=2
ROOT_PARTITION_INFO=$(fdisk -x $BANAN_DISK_IMAGE_PATH | grep "^$BANAN_DISK_IMAGE_PATH" | head -$ROOT_PARTITION_INDEX | tail -1)
ROOT_PARTITION_GUID=$(echo $ROOT_PARTITION_INFO | cut -d' ' -f6)
INSTALLER_BUILD_DIR=$(dirname $(realpath $0))/installer/build
BOOTLOADER_ELF=$BANAN_BUILD_DIR/bootloader/bootloader
if ! [ -f $BOOTLOADER_ELF ]; then
echo "You must build the bootloader first" >&2
exit 1
fi
if ! [ -d $INSTALLER_BUILD_DIR ]; then
mkdir -p $INSTALLER_BUILD_DIR
cd $INSTALLER_BUILD_DIR
cmake ..
fi
cd $INSTALLER_BUILD_DIR
make
echo installing bootloader
$INSTALLER_BUILD_DIR/x86_64-banan_os-bootloader-installer $BOOTLOADER_ELF $BANAN_DISK_IMAGE_PATH $ROOT_PARTITION_GUID