diff --git a/install.sh b/install.sh index 3ac6f7a..8a88d48 100644 --- a/install.sh +++ b/install.sh @@ -1,7 +1,20 @@ #!/bin/bash -#PS3="Please select a disk to partition:" +# Friendly introduction. +echo "Welcome to the Arch Linux installation script!" +echo "This script will ERASE ALL DATA on the partition you choose in the next step." +echo +read -p "Do you want to continue? Type [Y]es or [N]o. " -n 1 -r +echo # (optional) move to a new line +if [[ ! $REPLY =~ ^[Yy]$ ]] +then + exit 1 +fi + +# Partitioning. +echo echo "Please select a disk to partition:" +echo # Don't separate values by space. IFS=$'\n' @@ -22,79 +35,67 @@ IFS=' ' # Create new variable of selection. array=($disk) dev="${array[0]}" -echo -e +echo # Starting partitioning. echo "Partitioning /dev/$dev.." -echo -e +echo # Clearing partition table of selected disk. echo "Clearing existing partitioning table." sgdisk -Z /dev/$dev && -echo -e +echo # Creating boot partition. size="${array[1]%?}" echo "Creating boot partition of 256 MB." sgdisk -n 1:0:+256M /dev/$dev && +echo # Setting type for EFI. sgdisk -t 1:ef00 /dev/$dev && -echo -e # Creating system partition. echo "Creating system partition of $size GB." sgdisk -n 2:0:0 /dev/$dev -echo -e +echo # Print partitions. echo "This is your new partition table:" lsblk | grep "$dev" +sleep 1 +echo +# This needs to be deleted. echo $dev > /tmp/disk # Exit. break done +# This needs to be deleted. # Get variable from filesystem. part=$(/mnt/etc/locale.gen en_US.UTF-8 UTF-8 @@ -184,28 +220,28 @@ EOF arch-chroot /mnt locale-gen echo "LANG=de_DE.UTF-8" >/mnt/etc/locale.conf echo "KEYMAP=de-latin1" > /mnt/etc/vconsole.conf -echo -e +echo echo "Done." # Editing mkinitcpio.conf. echo "Editing /etc/mkinitcpio.conf." -echo -e +echo sed -i '7s/.*/MODULES=(ext4)/' /mnt/etc/mkinitcpio.conf && sed -i '52s/.*/HOOKS=(base udev autodetect modconf block keyboard keymap encrypt lvm2 filesystems fsck shutdown)/' /mnt/etc/mkinitcpio.conf && -echo -e +echo echo "Done." # Creating inital ramdisk. echo "Creating inital ramdisk for linux-zen." -echo -e +echo arch-chroot /mnt mkinitcpio -p linux-zen && echo "Done." # Enable network and display manager. echo "Enabling Networkmanager and display manager (sddm)." -echo -e +echo arch-chroot /mnt systemctl enable NetworkManager sddm && -echo -e +echo echo "Done." echo "Setting root password:"