From 90962efdf542568d4c10ea47f010c26b2a224c34 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Mon, 10 Jan 2022 20:33:03 -0600 Subject: [PATCH] Fix typos and make naming convention consistent --- 0-preinstall.sh | 20 ++++++++++---------- 1-setup.sh | 14 +++++++------- 3-post-setup.sh | 2 +- startup.sh | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/0-preinstall.sh b/0-preinstall.sh index d852b05..cc49830 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -74,10 +74,10 @@ createsubvolumes () { } mountallsubvol () { - mount -o ${mountoptions},subvol=@home /dev/mapper/ROOT /mnt/home - mount -o ${mountoptions},subvol=@tmp /dev/mapper/ROOT /mnt/tmp - mount -o ${mountoptions},subvol=@.snapshots /dev/mapper/ROOT /mnt/.snapshots - mount -o ${mountoptions},subvol=@var /dev/mapper/ROOT /mnt/var + mount -o ${MOUNT_OPTIONS},subvol=@home /dev/mapper/ROOT /mnt/home + mount -o ${MOUNT_OPTIONS},subvol=@tmp /dev/mapper/ROOT /mnt/tmp + mount -o ${MOUNT_OPTIONS},subvol=@.snapshots /dev/mapper/ROOT /mnt/.snapshots + mount -o ${MOUNT_OPTIONS},subvol=@var /dev/mapper/ROOT /mnt/var } if [[ "${DISK}" =~ "nvme" ]]; then @@ -99,9 +99,9 @@ elif [[ "${FS}" == "ext4" ]]; then elif [[ "${FS}" == "luks" ]]; then mkfs.vfat -F32 -n "EFIBOOT" ${partition2} # enter luks password to cryptsetup and format root partition - echo -n "${luks_password}" | cryptsetup -y -v luksFormat ${partition3} - + echo -n "${LUKS_PASSWORD}" | cryptsetup -y -v luksFormat ${partition3} - # open luks container and ROOT will be place holder - echo -n "${luks_password}" | cryptsetup open ${partition3} ROOT - + echo -n "${LUKS_PASSWORD}" | cryptsetup open ${partition3} ROOT - # now format that container mkfs.btrfs -L ROOT /dev/mapper/ROOT # create subvolumes for btrfs @@ -109,13 +109,13 @@ elif [[ "${FS}" == "luks" ]]; then createsubvolumes umount /mnt # mount @ subvolume - mount -o ${mountoptions},subvol=@ /dev/mapper/ROOT /mnt + mount -o ${MOUNT_OPTIONS},subvol=@ /dev/mapper/ROOT /mnt # make directories home, .snapshots, var, tmp mkdir -p /mnt/{home,var,tmp,.snapshots} # mount subvolumes mountallsubvol # store uuid of encrypted partition for grub - echo encryped_partition_uuid=$(blkid -s UUID -o value ${partition3}) >> setup.conf + echo ENCRYPTED_PARTITION_UUID=$(blkid -s UUID -o value ${partition3}) >> setup.conf fi # checking if user selected btrfs @@ -161,8 +161,8 @@ echo -ne " Checking for low memory systems <8G ------------------------------------------------------------------------- " -TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*') -if [[ $TOTALMEM -lt 8000000 ]]; then +TOTAL_MEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*') +if [[ $TOTAL_MEM -lt 8000000 ]]; then # Put swap into the actual system, not into RAM disk, otherwise there is no point in it, it'll cache RAM into RAM. So, /mnt/ everything. mkdir /mnt/opt/swap # make a dir that we can apply NOCOW to to make it btrfs-friendly. chattr +C /mnt/opt/swap # apply NOCOW, btrfs needs that. diff --git a/1-setup.sh b/1-setup.sh index 14d5577..a7bbd92 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -37,8 +37,8 @@ echo -ne " changing the compression settings. ------------------------------------------------------------------------- " -TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*') -if [[ $TOTALMEM -gt 8000000 ]]; then +TOTAL_MEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*') +if [[ $TOTAL_MEM -gt 8000000 ]]; then sed -i "s/#MAKEFLAGS=\"-j2\"/MAKEFLAGS=\"-j$nc\"/g" /etc/makepkg.conf sed -i "s/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $nc -z -)/g" /etc/makepkg.conf fi @@ -134,9 +134,9 @@ echo "password=${password,,}" >> ${HOME}/ArchTitus/setup.conf # Loop through user input until the user gives a valid hostname, but allow the user to force save while true do - read -p "Please name your machine:" nameofmachine + read -p "Please name your machine:" name_of_machine # hostname regex (!!couldn't find spec for computer name!!) - if [[ "${nameofmachine,,}" =~ ^[a-z][a-z0-9_.-]{0,62}[a-z0-9]$ ]] + if [[ "${name_of_machine,,}" =~ ^[a-z][a-z0-9_.-]{0,62}[a-z0-9]$ ]] then break fi @@ -148,7 +148,7 @@ echo "password=${password,,}" >> ${HOME}/ArchTitus/setup.conf fi done - echo "nameofmachine=${nameofmachine,,}" >> ${HOME}/ArchTitus/setup.conf + echo "NAME_OF_MACHINE=${name_of_machine,,}" >> ${HOME}/ArchTitus/setup.conf fi echo -ne " ------------------------------------------------------------------------- @@ -163,8 +163,8 @@ if [ $(whoami) = "root" ]; then echo "$USERNAME:$PASSWORD" | chpasswd cp -R /root/ArchTitus /home/$USERNAME/ chown -R $USERNAME: /home/$USERNAME/ArchTitus -# enter $nameofmachine to /etc/hostname - echo $nameofmachine > /etc/hostname +# enter $NAME_OF_MACHINE to /etc/hostname + echo $NAME_OF_MACHINE > /etc/hostname else echo "You are already a user proceed with aur installs" fi diff --git a/3-post-setup.sh b/3-post-setup.sh index 1671f1c..efd3788 100755 --- a/3-post-setup.sh +++ b/3-post-setup.sh @@ -21,7 +21,7 @@ if [[ -d "/sys/firmware/efi" ]]; then fi # set kernel parameter for decrypting the drive if [[ "${FS}" == "luks" ]]; then -sed -i "s%GRUB_CMDLINE_LINUX_DEFAULT=\"%GRUB_CMDLINE_LINUX_DEFAULT=\"cryptdevice=UUID=${encryped_partition_uuid}:ROOT root=/dev/mapper/ROOT %g" /etc/default/grub +sed -i "s%GRUB_CMDLINE_LINUX_DEFAULT=\"%GRUB_CMDLINE_LINUX_DEFAULT=\"cryptdevice=UUID=${ENCRYPTED_PARTITION_UUID}:ROOT root=/dev/mapper/ROOT %g" /etc/default/grub fi echo -e "Installing CyberRe Grub theme..." diff --git a/startup.sh b/startup.sh index e497434..686b478 100644 --- a/startup.sh +++ b/startup.sh @@ -42,14 +42,14 @@ echo -ne " 3) luks with btrfs 0) exit " -read FS -case $FS in +read fs +case $fs in 1) set_option FS btrfs;; 2) set_option FS ext4;; 3) echo -ne "Please enter your luks password: " read -s luks_password # read password without echo -set_option luks_password $luks_password +set_option LUKS_PASSWORD $luks_password set_option FS luks;; 0) exit ;; *) echo "Wrong option please select again"; filesystem;; @@ -116,9 +116,9 @@ read ssd_drive case $ssd_drive in y|Y|yes|Yes|YES) - echo "mountoptions=noatime,compress=zstd,ssd,commit=120" >> setup.conf;; + echo "MOUNT_OPTIONS=noatime,compress=zstd,ssd,commit=120" >> setup.conf;; n|N|no|NO|No) - echo "mountoptions=noatime,compress=zstd,commit=120" >> setup.conf;; + echo "MOUNT_OPTIONS=noatime,compress=zstd,commit=120" >> setup.conf;; *) echo "Wrong option. Try again";drivessd;; esac } @@ -149,7 +149,7 @@ echo -ne "Please enter your password: \n" read -s password # read password without echo set_option PASSWORD $password read -rep "Please enter your hostname: " nameofmachine -set_option nameofmachine $nameofmachine +set_option NAME_OF_MACHINE $nameofmachine } # More features in future # language (){}