added sourcing setup.conf in files

This commit is contained in:
farhan 2021-11-12 19:48:55 +00:00
parent d08ac2b61a
commit 56afc4e544
2 changed files with 18 additions and 9 deletions

View File

@ -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

View File

@ -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