Compare commits

..

No commits in common. "46a31b8efa93ba22178daa55f1c2103d7b768f85" and "d72db1f81ca901fc14261894b20b5be29c118b5b" have entirely different histories.

3 changed files with 5 additions and 46 deletions

View File

@ -41,7 +41,7 @@ MOUNT_DIR="${MOUNT_DIR:-$BANAN_BUILD_DIR/bananmnt}"
truncate -s 0 "$BANAN_DISK_IMAGE_PATH"
truncate -s $DISK_SIZE "$BANAN_DISK_IMAGE_PATH"
if (($BANAN_UEFI_BOOT)); then
if [ "$BANAN_UEFI_BOOT" == "1" ]; then
sed -e 's/\s*\([-\+[:alnum:]]*\).*/\1/' << EOF | fdisk "$BANAN_DISK_IMAGE_PATH" > /dev/null
g # gpt
n # new partition
@ -92,7 +92,7 @@ sudo mkfs.ext2 -b 1024 -q $PARTITION2
sudo mkdir -p $MOUNT_DIR || { echo "Failed to create banan mount dir."; exit 1; }
if [[ "$BANAN_BOOTLOADER" == "GRUB" ]]; then
if (($BANAN_UEFI_BOOT)); then
if [[ "$BANAN_UEFI_BOOT" == "1" ]]; then
sudo mkfs.fat $PARTITION1 > /dev/null
sudo mount $PARTITION1 "$MOUNT_DIR"
sudo mkdir -p "$MOUNT_DIR/EFI/BOOT"
@ -119,7 +119,7 @@ sudo rm -rf $MOUNT_DIR || { echo "Failed to remove banan mount dir."; exit 1; }
if [[ "$BANAN_BOOTLOADER" == "GRUB" ]]; then
echo > /dev/null
elif [[ "$BANAN_BOOTLOADER" == "BANAN" ]]; then
if (($BANAN_UEFI_BOOT)); then
if [[ "$BANAN_UEFI_BOOT" == "1" ]]; then
echo "banan bootloader does not support UEFI" >&2
exit 1
fi
@ -128,3 +128,4 @@ else
echo "unrecognized bootloader $BANAN_BOOTLOADER" >&2
exit 1
fi

View File

@ -1,42 +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
if [[ -z $BANAN_ROOT_DIR ]]; then
echo "You must set the BANAN_ROOT_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=$BANAN_ROOT_DIR/bootloader/installer/build
BOOTLOADER_ELF=$BANAN_BUILD_DIR/bootloader/bios/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

View File

@ -9,7 +9,7 @@ if [[ -z $OVMF_PATH ]]; then
OVMF_PATH="/usr/share/ovmf/x64/OVMF.fd"
fi
if (($BANAN_UEFI_BOOT)); then
if [[ "$BANAN_UEFI_BOOT" == "1" ]]; then
BIOS_ARGS="-bios $OVMF_PATH -net none"
fi