From 438e0712459ea20fad6f8ce9c862a95be0bf225f Mon Sep 17 00:00:00 2001 From: TommyTran732 <57488583+tommytran732@users.noreply.github.com> Date: Mon, 30 Aug 2021 04:58:59 -0400 Subject: [PATCH] Update easy-arch.sh --- easy-arch.sh | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/easy-arch.sh b/easy-arch.sh index ad12750..ec1969f 100644 --- a/easy-arch.sh +++ b/easy-arch.sh @@ -142,7 +142,7 @@ kernel_selector # Pacstrap (setting up a base sytem onto the new root). echo "Installing the base system (it may take a while)." -pacstrap /mnt base $kernel $microcode linux-firmware btrfs-progs grub grub-btrfs efibootmgr snapper reflector base-devel snap-pac +pacstrap /mnt base $kernel $microcode linux-firmware btrfs-progs grub grub-btrfs efibootmgr snapper reflector base-devel snap-pac zram-generator network_selector @@ -233,19 +233,12 @@ systemctl enable grub-btrfs.path --root=/mnt &>/dev/null echo "Enabling systemd-oomd." systemctl enable systemd-oomd --root=/mnt &>/dev/null -# Setting up ZRAM -MEMSIZE=$(awk '/^Mem/ {print $2}' <(free -m)) -if [ "${MEMSIZE}" -ge "8192" ]; then - ZRAMSIZE=8192 -else - ZRAMSIZE=${MEMSIZE} -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 +# ZRAM configuration +bash -c 'cat > /mnt/etc/systemd/zram-generator.conf' <<-'EOF' +[zram0] +zram-fraction = 1 +max-zram-size = 8192 +EOF # Finishing up echo "Done, you may now wish to reboot (further changes can be done by chrooting into /mnt)."