From 56afc4e54446ae17a01552188c8590093c18b973 Mon Sep 17 00:00:00 2001 From: farhan Date: Fri, 12 Nov 2021 19:48:55 +0000 Subject: [PATCH] added sourcing setup.conf in files --- 0-preinstall.sh | 22 +++++++++++++++------- 1-setup.sh | 5 +++-- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/0-preinstall.sh b/0-preinstall.sh index da49b11..f03f7b3 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -8,6 +8,7 @@ # ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ #------------------------------------------------------------------------- SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +source setup.conf echo "-------------------------------------------------" echo "Setting up mirrors for optimal download " echo "-------------------------------------------------" @@ -32,7 +33,6 @@ echo -e "----------------------------------------------------------------------- reflector -a 48 -c $iso -f 5 -l 20 --sort rate --save /etc/pacman.d/mirrorlist mkdir /mnt - echo -e "\nInstalling prereqs...\n$HR" pacman -S --noconfirm gptfdisk btrfs-progs @@ -65,16 +65,24 @@ fi # make filesystems echo -e "\nCreating Filesystems...\n$HR" -if [[ ${DISK} =~ "nvme" ]]; then +if [[ ${DISK} =~ "nvme" && ${FS} == "btrfs" ]]; then mkfs.vfat -F32 -n "EFIBOOT" "${DISK}p2" -mkfs.$FS -L "ROOT" "${DISK}p3" -f -mount -t $FS "${DISK}p3" /mnt +mkfs.btrfs -L "ROOT" "${DISK}p3" -f +mount -t btrfs "${DISK}p3" /mnt +elif [[ ${DISK} =~ "sd" && ${FS} == "btrfs"]]; then +mkfs.vfat -F32 -n "EFIBOOT" "${DISK}2" +mkfs.btrfs -L "ROOT" "${DISK}3" -f +mount -t btrfs "${DISK}3" /mnt +elif [[ ${DISK} =~ "nvme" && ${FS} == "ext4" ]]; then +mkfs.vfat -F32 -n "EFIBOOT" "${DISK}p2" +mkfs.ext4 -L "ROOT" "${DISK}p3" +mount -t ext4 "${DISK}p3" /mnt else mkfs.vfat -F32 -n "EFIBOOT" "${DISK}2" -mkfs.$FS -L "ROOT" "${DISK}3" -f -mount -t $FS "${DISK}3" /mnt +mkfs.ext4 -L "ROOT" "${DISK}3" +mount -t ext4 "${DISK}3" /mnt fi -if [[ $FS =~ btrfs]]; then +if [[ ${FS} =~ "btrfs" ]]; then ls /mnt | xargs btrfs subvolume delete btrfs subvolume create /mnt/@ umount /mnt diff --git a/1-setup.sh b/1-setup.sh index 323e502..9722cb1 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -7,6 +7,7 @@ # ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ # ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ #------------------------------------------------------------------------- +source setup.conf echo "--------------------------------------" echo "-- Network Setup --" echo "--------------------------------------" @@ -34,12 +35,12 @@ echo " Setup Language to US and set locale " echo "-------------------------------------------------" sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen locale-gen -timedatectl --no-ask-password set-timezone $timezone +timedatectl --no-ask-password set-timezone ${timezone} timedatectl --no-ask-password set-ntp 1 localectl --no-ask-password set-locale LANG="en_US.UTF-8" LC_TIME="en_US.UTF-8" # Set keymaps -localectl --no-ask-password set-keymap $keymap +localectl --no-ask-password set-keymap ${keymap} # Add sudo no password rights sed -i 's/^# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers