From 620666220fec8d9677ec1d5dc16ace04a9c7be42 Mon Sep 17 00:00:00 2001 From: Tristan Ancelet Date: Sat, 25 Nov 2023 17:16:07 -0600 Subject: [PATCH] Had to add logic to re-format disk string in case it is an nvme drive. Also removed BIOS header creation (as it's not needed since the first it's created automatically with the first MBR partition --- bare-arch-install.sh | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/bare-arch-install.sh b/bare-arch-install.sh index 0272412..006bbbf 100755 --- a/bare-arch-install.sh +++ b/bare-arch-install.sh @@ -123,10 +123,27 @@ declare -a DISKS get_disks DISKS get_choice "Which disk are you wanting to use? : " DISK "${DISKS[@]}" -EFI_PARTITION=${DISK}1 -SWAP_PARTITION=${DISK}2 -ROOT_PARTITION=${DISK}3 +# If the disk is a nvme drive +if [[ "$DISK" =~ ^/dev/nvmen[0-9]$ ]] + DISK_BASE=${DISK}p +else + DISK_BASE="${DISK}" +fi + +case $BOOT_METHOD in + EFI) + EFI_PARTITION=${DISK_BASE}1 + SWAP_PARTITION=${DISK_BASE}2 + ROOT_PARTITION=${DISK_BASE}3 + ;; + + BIOS) + SWAP_PARTITION=${DISK_BASE}1 + ROOT_PARTITION=${DISK_BASE}2 + ;; + +esac ## New Login creds for your new user and the root user ROOT_PASSWORD="" get_answer "What do you want the root password to be? : " ROOT_PASSWORD @@ -152,17 +169,6 @@ FORMAT_DISK_COMMANDS_BIOS=" # Create MBR partition table o -# Create bios header (area where boot information is stored at the beginning of the disk) -n -# Create Primary partition (which is technically the default anyway) -p -# Press Enter to select default partition number - -# Press Enter to select default starting sector - -# Allocate 10 MB at beginning of disk for BIOS table (you will do nothing with it) -+10MiB - # Create Swap Partition n # Create Primary partition (which is technically the default anyway)