From d1d22c50d023c2abd11a4bbee5f4008b4f98e9a5 Mon Sep 17 00:00:00 2001 From: TommyTran732 <57488583+tommytran732@users.noreply.github.com> Date: Sun, 25 Jul 2021 07:47:12 +0000 Subject: [PATCH] Update install.sh --- install.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/install.sh b/install.sh index 4985630..ef91f43 100644 --- a/install.sh +++ b/install.sh @@ -340,5 +340,19 @@ sed -i 's/022/077/g' /mnt/etc/profile echo "" >> /mnt/etc/bash.bashrc echo "umask 077" >> /mnt/etc/bash.bashrc +# Setting up ZRAM +MEM = $(awk '/^Mem/ {print $2}' <(free -m)) +if [ "${MEM}" -ge "8192" ]; then + ZRAMSIZE = 8192 +else + ZRAMSIZE = ${MEM} +fi + +echo 'zram' > /mnt/etc/modules-load.d/zram.conf +echo 'options zram num_devices=1' > /mnt/etc/modprobe.d/zram.conf +echo 'KERNEL=="zram0", ATTR{disksize}="${ZRAMSIZE}M" RUN="/usr/bin/mkswap /dev/zram0", TAG+="systemd"' > /mnt/etc/udev/rules.d/99-zram.rules +echo '# ZRAM' >> /mnt/etc/fstab +echo '/dev/zram0 none swap defaults 0 0' >> /mnt/etc/fstab + echo "Done, you may now wish to reboot (further changes can be done by chrooting into /mnt)." exit