From 57e63b05de5523c29fa031e67cf3c7b9de9c4284 Mon Sep 17 00:00:00 2001 From: Augusto Gunsch Date: Thu, 12 Aug 2021 15:10:55 -0300 Subject: [PATCH] Make different partitions for BIOS and UEFI --- install.sh | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/install.sh b/install.sh index 5fc59a8..5224706 100755 --- a/install.sh +++ b/install.sh @@ -145,13 +145,30 @@ partition() { [ -f /bin/parted ] || download_parted echo -n "Partitioning drive..." - parted --script "$DRIVE_TARGET" \ - mklabel gpt \ - mkpart swap ext4 1MiB 4GiB \ - mkpart boot ext4 4GiB 5Gib \ - mkpart root ext4 5GiB 100% - [ $UEFI -eq 0 ] && parted --script "$DRIVE_TARGET" set 2 bios_grub on - echo "done" + if [ $UEFI -eq 0 ]; then + # Legacy + parted --script "$DRIVE_TARGET" \ + mklabel msdos \ + mkpart swap linux-swap 0% 4GiB \ + mkpart root ext4 4GiB 100% + echo "done" + else + # EFI + parted --script "$DRIVE_TARGET" \ + mklabel gpt \ + mkpart swap linux-swap 0% 4GiB \ + mkpart boot fat32 4GiB 5Gib \ + mkpart root ext4 5GiB 100% \ + set 2 esp on + echo "done" + + echo -n "Configuring BOOT partition..." + quiet mkfs.fat -F 32 "$DRIVE_TARGET"2 + fatlabel "$DRIVE_TARGET"2 BOOT + mkdir /mnt/boot + mount "$DRIVE_TARGET"2 /mnt/boot + echo "done" + fi echo -n "Configuring SWAP partition..." quiet mkswap -L SWAP "$DRIVE_TARGET"1 @@ -162,17 +179,6 @@ partition() { quiet mkfs.ext4 -L ROOT "$DRIVE_TARGET"3 quiet mount "$DRIVE_TARGET"3 /mnt echo "done" - - echo -n "Configuring BOOT partition..." - if [ $UEFI -eq 1 ]; then - quiet mkfs.fat -F 32 "$DRIVE_TARGET"2 - fatlabel "$DRIVE_TARGET"2 BOOT - else - quiet mkfs.ext4 -L BOOT "$DRIVE_TARGET"2 - fi - mkdir /mnt/boot - mount "$DRIVE_TARGET"2 /mnt/boot - echo "done" } install_base() {