From 2f6a6e43c47a345ca72028177cea92e7307cebff Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 12 Jan 2020 17:40:15 +0100 Subject: First version of BIOS boot. --- util/partition_disk.sh | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'util/partition_disk.sh') diff --git a/util/partition_disk.sh b/util/partition_disk.sh index fcad5b9..6164d1b 100644 --- a/util/partition_disk.sh +++ b/util/partition_disk.sh @@ -19,11 +19,13 @@ disk_path=$1 # e.g. /dev/sda +boot_mode=$2 # "UEFI" or "BIOS" -wipefs -a $disk_path # make sure that fdisk does not ask for removing - # signatures which breaks the script -fdisk $disk_path << EOF +if [ "$boot_mode" == "UEFI" ]; then + wipefs -a $disk_path # make sure that fdisk does not ask for removing + # signatures which breaks the script + fdisk $disk_path << EOF g n 1 @@ -41,4 +43,22 @@ p w EOF -echo "Partitioned disk - OK" + echo "Partitioned disk for UEFI/GPT- OK" +elif [ "$boot_mode" == "BIOS" ]; then + wipefs -a $disk_path # make sure that fdisk does not ask for removing + # signatures which breaks the script + fdisk $disk_path << EOF +o +n +p +1 + + +p +w +EOF + + echo "Partitioned disk for BIOS/MBR - OK" +else + +fi -- cgit v1.2.3-70-g09d2