Merge pull request #176 from khaneliman/variable-cleanup
Fix typos and make naming convention consistent
This commit is contained in:
commit
472ac4e772
|
|
@ -74,10 +74,10 @@ createsubvolumes () {
|
||||||
}
|
}
|
||||||
|
|
||||||
mountallsubvol () {
|
mountallsubvol () {
|
||||||
mount -o ${mountoptions},subvol=@home /dev/mapper/ROOT /mnt/home
|
mount -o ${MOUNT_OPTIONS},subvol=@home /dev/mapper/ROOT /mnt/home
|
||||||
mount -o ${mountoptions},subvol=@tmp /dev/mapper/ROOT /mnt/tmp
|
mount -o ${MOUNT_OPTIONS},subvol=@tmp /dev/mapper/ROOT /mnt/tmp
|
||||||
mount -o ${mountoptions},subvol=@.snapshots /dev/mapper/ROOT /mnt/.snapshots
|
mount -o ${MOUNT_OPTIONS},subvol=@.snapshots /dev/mapper/ROOT /mnt/.snapshots
|
||||||
mount -o ${mountoptions},subvol=@var /dev/mapper/ROOT /mnt/var
|
mount -o ${MOUNT_OPTIONS},subvol=@var /dev/mapper/ROOT /mnt/var
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ "${DISK}" =~ "nvme" ]]; then
|
if [[ "${DISK}" =~ "nvme" ]]; then
|
||||||
|
|
@ -99,9 +99,9 @@ elif [[ "${FS}" == "ext4" ]]; then
|
||||||
elif [[ "${FS}" == "luks" ]]; then
|
elif [[ "${FS}" == "luks" ]]; then
|
||||||
mkfs.vfat -F32 -n "EFIBOOT" ${partition2}
|
mkfs.vfat -F32 -n "EFIBOOT" ${partition2}
|
||||||
# enter luks password to cryptsetup and format root partition
|
# 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
|
# 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
|
# now format that container
|
||||||
mkfs.btrfs -L ROOT /dev/mapper/ROOT
|
mkfs.btrfs -L ROOT /dev/mapper/ROOT
|
||||||
# create subvolumes for btrfs
|
# create subvolumes for btrfs
|
||||||
|
|
@ -109,13 +109,13 @@ elif [[ "${FS}" == "luks" ]]; then
|
||||||
createsubvolumes
|
createsubvolumes
|
||||||
umount /mnt
|
umount /mnt
|
||||||
# mount @ subvolume
|
# 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
|
# make directories home, .snapshots, var, tmp
|
||||||
mkdir -p /mnt/{home,var,tmp,.snapshots}
|
mkdir -p /mnt/{home,var,tmp,.snapshots}
|
||||||
# mount subvolumes
|
# mount subvolumes
|
||||||
mountallsubvol
|
mountallsubvol
|
||||||
# store uuid of encrypted partition for grub
|
# 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
|
fi
|
||||||
|
|
||||||
# checking if user selected btrfs
|
# checking if user selected btrfs
|
||||||
|
|
@ -161,8 +161,8 @@ echo -ne "
|
||||||
Checking for low memory systems <8G
|
Checking for low memory systems <8G
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
"
|
"
|
||||||
TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
|
TOTAL_MEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
|
||||||
if [[ $TOTALMEM -lt 8000000 ]]; then
|
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.
|
# 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.
|
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.
|
chattr +C /mnt/opt/swap # apply NOCOW, btrfs needs that.
|
||||||
|
|
|
||||||
14
1-setup.sh
14
1-setup.sh
|
|
@ -37,8 +37,8 @@ echo -ne "
|
||||||
changing the compression settings.
|
changing the compression settings.
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
"
|
"
|
||||||
TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
|
TOTAL_MEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
|
||||||
if [[ $TOTALMEM -gt 8000000 ]]; then
|
if [[ $TOTAL_MEM -gt 8000000 ]]; then
|
||||||
sed -i "s/#MAKEFLAGS=\"-j2\"/MAKEFLAGS=\"-j$nc\"/g" /etc/makepkg.conf
|
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
|
sed -i "s/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $nc -z -)/g" /etc/makepkg.conf
|
||||||
fi
|
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
|
# Loop through user input until the user gives a valid hostname, but allow the user to force save
|
||||||
while true
|
while true
|
||||||
do
|
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!!)
|
# 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
|
then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
@ -148,7 +148,7 @@ echo "password=${password,,}" >> ${HOME}/ArchTitus/setup.conf
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "nameofmachine=${nameofmachine,,}" >> ${HOME}/ArchTitus/setup.conf
|
echo "NAME_OF_MACHINE=${name_of_machine,,}" >> ${HOME}/ArchTitus/setup.conf
|
||||||
fi
|
fi
|
||||||
echo -ne "
|
echo -ne "
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
@ -163,8 +163,8 @@ if [ $(whoami) = "root" ]; then
|
||||||
echo "$USERNAME:$PASSWORD" | chpasswd
|
echo "$USERNAME:$PASSWORD" | chpasswd
|
||||||
cp -R /root/ArchTitus /home/$USERNAME/
|
cp -R /root/ArchTitus /home/$USERNAME/
|
||||||
chown -R $USERNAME: /home/$USERNAME/ArchTitus
|
chown -R $USERNAME: /home/$USERNAME/ArchTitus
|
||||||
# enter $nameofmachine to /etc/hostname
|
# enter $NAME_OF_MACHINE to /etc/hostname
|
||||||
echo $nameofmachine > /etc/hostname
|
echo $NAME_OF_MACHINE > /etc/hostname
|
||||||
else
|
else
|
||||||
echo "You are already a user proceed with aur installs"
|
echo "You are already a user proceed with aur installs"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ if [[ -d "/sys/firmware/efi" ]]; then
|
||||||
fi
|
fi
|
||||||
# set kernel parameter for decrypting the drive
|
# set kernel parameter for decrypting the drive
|
||||||
if [[ "${FS}" == "luks" ]]; then
|
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
|
fi
|
||||||
|
|
||||||
echo -e "Installing CyberRe Grub theme..."
|
echo -e "Installing CyberRe Grub theme..."
|
||||||
|
|
|
||||||
12
startup.sh
12
startup.sh
|
|
@ -42,14 +42,14 @@ echo -ne "
|
||||||
3) luks with btrfs
|
3) luks with btrfs
|
||||||
0) exit
|
0) exit
|
||||||
"
|
"
|
||||||
read FS
|
read fs
|
||||||
case $FS in
|
case $fs in
|
||||||
1) set_option FS btrfs;;
|
1) set_option FS btrfs;;
|
||||||
2) set_option FS ext4;;
|
2) set_option FS ext4;;
|
||||||
3)
|
3)
|
||||||
echo -ne "Please enter your luks password: "
|
echo -ne "Please enter your luks password: "
|
||||||
read -s luks_password # read password without echo
|
read -s luks_password # read password without echo
|
||||||
set_option luks_password $luks_password
|
set_option LUKS_PASSWORD $luks_password
|
||||||
set_option FS luks;;
|
set_option FS luks;;
|
||||||
0) exit ;;
|
0) exit ;;
|
||||||
*) echo "Wrong option please select again"; filesystem;;
|
*) echo "Wrong option please select again"; filesystem;;
|
||||||
|
|
@ -116,9 +116,9 @@ read ssd_drive
|
||||||
|
|
||||||
case $ssd_drive in
|
case $ssd_drive in
|
||||||
y|Y|yes|Yes|YES)
|
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)
|
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;;
|
*) echo "Wrong option. Try again";drivessd;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
@ -149,7 +149,7 @@ echo -ne "Please enter your password: \n"
|
||||||
read -s password # read password without echo
|
read -s password # read password without echo
|
||||||
set_option PASSWORD $password
|
set_option PASSWORD $password
|
||||||
read -rep "Please enter your hostname: " nameofmachine
|
read -rep "Please enter your hostname: " nameofmachine
|
||||||
set_option nameofmachine $nameofmachine
|
set_option NAME_OF_MACHINE $nameofmachine
|
||||||
}
|
}
|
||||||
# More features in future
|
# More features in future
|
||||||
# language (){}
|
# language (){}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue