aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Titus <[email protected]>2021-10-26 19:29:09 -0500
committerGitHub <[email protected]>2021-10-26 19:29:09 -0500
commita372b52c56f3f88ab6a9143639f5b09d89cf3a0b (patch)
treee906bf2b526cff532345f515865d48e919a2051b
parentf2f1ce7730d9c3708cae30b598f87dc0eef90fe3 (diff)
parent9724ae3706aa2801c3e776e2aa1344d622da0e23 (diff)
downloadArchTitus-a372b52c56f3f88ab6a9143639f5b09d89cf3a0b.tar.xz
ArchTitus-a372b52c56f3f88ab6a9143639f5b09d89cf3a0b.zip
Merge pull request #49 from ChrisTitusTech/test
Test Merge back for Low end machines
-rwxr-xr-x0-preinstall.sh14
-rwxr-xr-x1-setup.sh4
2 files changed, 13 insertions, 5 deletions
diff --git a/0-preinstall.sh b/0-preinstall.sh
index 18ba58c..557574b 100755
--- a/0-preinstall.sh
+++ b/0-preinstall.sh
@@ -129,10 +129,16 @@ echo "-- Check for low memory systems <8G --"
echo "--------------------------------------"
TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
if [[ $TOTALMEM -lt 8000000 ]]; then
- dd if=/dev/zero of=/swapfile bs=1M count=2048 status=progress
- chmod 600 /swapfile
- mkswap /swapfile
- swapon /swapfile
+ #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.
+ dd if=/dev/zero of=/mnt/opt/swap/swapfile bs=1M count=2048 status=progress
+ chmod 600 /mnt/opt/swap/swapfile #set permissions.
+ chown root /mnt/opt/swap/swapfile
+ mkswap /mnt/opt/swap/swapfile
+ swapon /mnt/opt/swap/swapfile
+ #The line below is written to /mnt/ but doesn't contain /mnt/, since it's just / for the sysytem itself.
+ echo "/opt/swap/swapfile none swap sw 0 0" >> /mnt/etc/fstab #Add swap to fstab, so it KEEPS working after installation.
fi
echo "--------------------------------------"
echo "-- SYSTEM READY FOR 0-setup --"
diff --git a/1-setup.sh b/1-setup.sh
index dd8e8be..9787056 100755
--- a/1-setup.sh
+++ b/1-setup.sh
@@ -23,10 +23,12 @@ nc=$(grep -c ^processor /proc/cpuinfo)
echo "You have " $nc" cores."
echo "-------------------------------------------------"
echo "Changing the makeflags for "$nc" cores."
+TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*')
+if [[ $TOTALMEM -gt 8000000 ]]; then
sudo sed -i 's/#MAKEFLAGS="-j2"/MAKEFLAGS="-j$nc"/g' /etc/makepkg.conf
echo "Changing the compression settings for "$nc" cores."
sudo sed -i 's/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $nc -z -)/g' /etc/makepkg.conf
-
+fi
echo "-------------------------------------------------"
echo " Setup Language to US and set locale "
echo "-------------------------------------------------"