forked from Bananymous/banan-os
BuildSystem: Check value of BANAN_UEFI_BOOT with `if ((...)); then`
This commit is contained in:
parent
07b70ea7b4
commit
5e9b21bdce
|
@ -41,7 +41,7 @@ MOUNT_DIR="${MOUNT_DIR:-$BANAN_BUILD_DIR/bananmnt}"
|
||||||
truncate -s 0 "$BANAN_DISK_IMAGE_PATH"
|
truncate -s 0 "$BANAN_DISK_IMAGE_PATH"
|
||||||
truncate -s $DISK_SIZE "$BANAN_DISK_IMAGE_PATH"
|
truncate -s $DISK_SIZE "$BANAN_DISK_IMAGE_PATH"
|
||||||
|
|
||||||
if [ "$BANAN_UEFI_BOOT" == "1" ]; then
|
if (($BANAN_UEFI_BOOT)); then
|
||||||
sed -e 's/\s*\([-\+[:alnum:]]*\).*/\1/' << EOF | fdisk "$BANAN_DISK_IMAGE_PATH" > /dev/null
|
sed -e 's/\s*\([-\+[:alnum:]]*\).*/\1/' << EOF | fdisk "$BANAN_DISK_IMAGE_PATH" > /dev/null
|
||||||
g # gpt
|
g # gpt
|
||||||
n # new partition
|
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; }
|
sudo mkdir -p $MOUNT_DIR || { echo "Failed to create banan mount dir."; exit 1; }
|
||||||
|
|
||||||
if [[ "$BANAN_BOOTLOADER" == "GRUB" ]]; then
|
if [[ "$BANAN_BOOTLOADER" == "GRUB" ]]; then
|
||||||
if [[ "$BANAN_UEFI_BOOT" == "1" ]]; then
|
if (($BANAN_UEFI_BOOT)); then
|
||||||
sudo mkfs.fat $PARTITION1 > /dev/null
|
sudo mkfs.fat $PARTITION1 > /dev/null
|
||||||
sudo mount $PARTITION1 "$MOUNT_DIR"
|
sudo mount $PARTITION1 "$MOUNT_DIR"
|
||||||
sudo mkdir -p "$MOUNT_DIR/EFI/BOOT"
|
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
|
if [[ "$BANAN_BOOTLOADER" == "GRUB" ]]; then
|
||||||
echo > /dev/null
|
echo > /dev/null
|
||||||
elif [[ "$BANAN_BOOTLOADER" == "BANAN" ]]; then
|
elif [[ "$BANAN_BOOTLOADER" == "BANAN" ]]; then
|
||||||
if [[ "$BANAN_UEFI_BOOT" == "1" ]]; then
|
if (($BANAN_UEFI_BOOT)); then
|
||||||
echo "banan bootloader does not support UEFI" >&2
|
echo "banan bootloader does not support UEFI" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -128,4 +128,3 @@ else
|
||||||
echo "unrecognized bootloader $BANAN_BOOTLOADER" >&2
|
echo "unrecognized bootloader $BANAN_BOOTLOADER" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ if [[ -z $OVMF_PATH ]]; then
|
||||||
OVMF_PATH="/usr/share/ovmf/x64/OVMF.fd"
|
OVMF_PATH="/usr/share/ovmf/x64/OVMF.fd"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$BANAN_UEFI_BOOT" == "1" ]]; then
|
if (($BANAN_UEFI_BOOT)); then
|
||||||
BIOS_ARGS="-bios $OVMF_PATH -net none"
|
BIOS_ARGS="-bios $OVMF_PATH -net none"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue