From 1864568c25a25c9d280a644847280caa858e795a Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sun, 24 Oct 2021 15:57:57 -0700 Subject: [PATCH] Added /swapfile --- 0-preinstall.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/0-preinstall.sh b/0-preinstall.sh index 041d175..e40fd79 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -107,6 +107,26 @@ options root=LABEL=ROOT rw rootflags=subvol=@ EOF cp -R ~/ArchTitus /mnt/root/ cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist + +# +# create a swapfile +# $ required for completion of scripts on lower end systems (under 8GB ram will need swap) +# + +SWAPSIZEgb=2 + +SWAPSIZEmb=1024*$SWAPSIZEgb + +touch /swapfile +dd if=/dev/zero of=/swapfile bs=1M count=$SWAPSIZEmb status=progress +# status=progress is for debugging +chmod 600 /swapfile +mkswap /swapfile +swapon /swapfile +"\n# /swapfile \n/swapfile none swap defaults 0 0" >> /etc/fstab + +echo "Swap /swapfile created and configured wtih $SWAPSIZEgb GB\n" + echo "--------------------------------------" echo "-- SYSTEM READY FOR 0-setup --" echo "--------------------------------------"