Add option to not wipe home partition if used
This commit is contained in:
parent
10f6b499aa
commit
dc6af1b41d
@ -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
|
||||
@ -26,8 +25,16 @@ 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
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user