bug fixes for #214

This commit is contained in:
mfgbhatti 2022-01-28 16:59:40 +00:00
parent fe4d79f329
commit 3ada041b6a
1 changed files with 2 additions and 3 deletions

View File

@ -229,7 +229,7 @@ title "Checking for low memory systems <8G "
TOTALMEM=$(grep -i "memtotal" "/proc/meminfo" | grep -o '[[:digit:]]*') TOTALMEM=$(grep -i "memtotal" "/proc/meminfo" | grep -o '[[:digit:]]*')
if [[ $TOTALMEM -lt 8000000 ]]; then if [[ $TOTALMEM -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 -p /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.
dd if=/dev/zero of=/mnt/opt/swap/swapfile bs=1M count=2048 status=progress dd if=/dev/zero of=/mnt/opt/swap/swapfile bs=1M count=2048 status=progress
chmod 600 /mnt/opt/swap/swapfile # set permissions. chmod 600 /mnt/opt/swap/swapfile # set permissions.
@ -240,5 +240,4 @@ if [[ $TOTALMEM -lt 8000000 ]]; then
echo "/opt/swap/swapfile none swap sw 0 0" >> /mnt/etc/fstab # Add swap to fstab, so it KEEPS working after installation. echo "/opt/swap/swapfile none swap sw 0 0" >> /mnt/etc/fstab # Add swap to fstab, so it KEEPS working after installation.
fi fi
title "SYSTEM READY FOR 1-setup.sh" title "SYSTEM READY FOR 1-setup.sh"