Attempted to fix swap configuration

This commit is contained in:
2022-09-22 23:35:35 -04:00
parent eaa8232322
commit ba970abba5
2 changed files with 8 additions and 4 deletions
+6
View File
@@ -13,6 +13,7 @@ username="$(< /tempfiles/username)"
userpassword="$(< /tempfiles/userpassword)"
rootpassword="$(< /tempfiles/rootpassword)"
timezone="$(< /tempfiles/timezone)"
swap="$(< /tempfiles/swap)"
# configuring locale and clock Settings
echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen
@@ -188,6 +189,11 @@ touch /home/"$username"/.ssh/authorized_keys
chown -R "$username" /home/"$username"/.ssh
# misc configuration
if [ "$swap" -gt 0 ]; then
echo 'vm.swappiness=10' > /etc/sysctl.d/99-swappiness.conf
else
echo 'vm.swappiness=0' > /etc/sysctl.d/99-swappiness.conf
fi
echo -e ""$username" soft memlock 64\n"$username" hard memlock 2097152\n"$username" hard nofile 524288\n# End of file" > /etc/security/limits.conf # increase memlock and add support for esync
mkdir -p /home/"$username"/.gnupg
echo 'pinentry-program /usr/bin/pinentry-tty' > /home/"$username"/.gnupg/gpg-agent.conf # forces gpg prompts to use terminal input
+2 -4
View File
@@ -147,14 +147,11 @@ else
fi
# create and mount swap file
if [ "$swap" != 0 ]; then
if [ "$swap" -gt 0 ]; then
dd if=/dev/zero of=/mnt/swapfile bs=1G count="$swap" status=progress
chmod 600 /mnt/swapfile
mkswap /mnt/swapfile
swapon /mnt/swapfile
echo 'vm.swappiness=10' > /mnt/etc/sysctl.d/99-swappiness.conf
else
echo 'vm.swappiness=0' > /mnt/etc/sysctl.d/99-swappiness.conf
fi
fstabgen -U /mnt >> /mnt/etc/fstab
@@ -183,6 +180,7 @@ echo "$username" > /mnt/tempfiles/username
echo "$userpassword" > /mnt/tempfiles/userpassword
echo "$rootpassword" > /mnt/tempfiles/rootpassword
echo "$timezone" > /mnt/tempfiles/timezone
echo "$swap" > /mnt/tempfiles/swap
# download and initiate part 2
curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/chrootInstall.sh -o /mnt/chrootInstall.sh