diff --git a/scripts/0-install.sh b/scripts/0-install.sh index f181b30..6c68e32 100644 --- a/scripts/0-install.sh +++ b/scripts/0-install.sh @@ -1,17 +1,16 @@ #!/bin/bash -# Set mount options for disks -export MNTOPTIONS ="noatime,compress=zstd,ssd,commit=120" echo "We just need to ask some questions before installing" # Get drive values for installation lsblk +# Set EFI and root partitions read -p 'Please enter the drive value for the root partition, this partition will be wiped and formatted: ' rootpar read -p 'Please enter the drive value for the EFI partition: ' efipar # Format the root partition to ext4 mkfs.ext4 /dev/$rootpar # Mount root partition -mount -o $MNTOPTIONS /dev/$rootpar /mnt +mount /dev/$rootpar /mnt # Ask if the EFI partition should be wiped before mounting -read -p "Do you wish to wipe the EFI partition? If you already have an existing OS installed, say No. " yesno +read -p "Do you wish to wipe the EFI partition? If you already have an existing OS installed, type 'No': " yesno case $yesno in [yesYesYy]* ) mkfs.fat -F32 /dev/$efipar @@ -25,9 +24,17 @@ esac read -p "Do you wish to set a home partition? " yesno case $yesno in [yesYesYy]* ) - read -p 'Please enter the drive value for the home partition, this partition will be wiped: ' homepar - mkfs.ext4 /dev/$homepar - ;; + read -p 'Please enter the drive value for the home partition, this partition will be wiped: ' homepar + read -p 'Do you wish to wipe the home partition? ' wipeyesno + case $wipeyesno in + [yesYesYy]* ) + mkfs.ext4 /dev/$homepar + ;; + [noNoNn]* ) + echo "The home partition will not be wiped" + ;; + * ) echo "Please answer yes (Yes, y, Y) or no (No, n, N)";; + esac [noNoNn]* ) echo "A home partition will not be used in this installation" ;; @@ -49,7 +56,7 @@ pacstrap -i /mnt base base-devel linux linux-firmware rsync networkmanager grub mkdir /mnt/boot/efi mount /dev/$efipar /mnt/boot/efi if test -z "$homepar"; then - mount -o $MNTOPTIONS /dev/$homepar /mnt/home + mount /dev/$homepar /mnt/home fi # Generate a fstab file genfstab -U /mnt >> /mnt/etc/fstab