From f783f5f8fc053efefc7deb0ccb054c7fc62a892d Mon Sep 17 00:00:00 2001 From: Logan G Date: Thu, 5 Oct 2023 02:47:17 -0600 Subject: [PATCH] Migrated from systemd-swap to zram-generator --- .../etc/sysctl.d/99-vm-zram-parameters.conf | 4 +++ airootfs/etc/systemd/swap.conf | 35 ------------------- airootfs/etc/systemd/zram-generator.conf | 5 +++ .../entries/01-archiso-x86_64-linux.conf | 2 +- .../02-archiso-x86_64-speech-linux.conf | 2 +- grub/grub.cfg | 6 ++-- packages.x86_64 | 2 +- syslinux/archiso_pxe-linux.cfg | 6 ++-- syslinux/archiso_sys-linux.cfg | 6 ++-- 9 files changed, 21 insertions(+), 47 deletions(-) create mode 100644 airootfs/etc/sysctl.d/99-vm-zram-parameters.conf delete mode 100644 airootfs/etc/systemd/swap.conf create mode 100644 airootfs/etc/systemd/zram-generator.conf diff --git a/airootfs/etc/sysctl.d/99-vm-zram-parameters.conf b/airootfs/etc/sysctl.d/99-vm-zram-parameters.conf new file mode 100644 index 0000000..1f14fd5 --- /dev/null +++ b/airootfs/etc/sysctl.d/99-vm-zram-parameters.conf @@ -0,0 +1,4 @@ +vm.swappiness = 100 +vm.watermark_boost_factor = 0 +vm.watermark_scale_factor = 125 +vm.page-cluster = 0 diff --git a/airootfs/etc/systemd/swap.conf b/airootfs/etc/systemd/swap.conf deleted file mode 100644 index 75c4074..0000000 --- a/airootfs/etc/systemd/swap.conf +++ /dev/null @@ -1,35 +0,0 @@ -# This file is part of systemd-swap. -# -# Entries in this file show the systemd-swap defaults as -# specified in /usr/share/systemd-swap/swap-default.conf -# You can change settings by editing this file. -# Defaults can be restored by simply deleting this file. -# -# See swap.conf(5) and /usr/share/systemd-swap/swap-default.conf for details. - -zswap_enabled=0 -#zswap_compressor=zstd -#zswap_max_pool_percent=25 -#zswap_zpool=z3fold -zram_enabled=1 -#zram_size=$(( RAM_SIZE / 4 )) -#zram_count=${NCPU} -#zram_streams=${NCPU} -#zram_alg=zstd -#zram_prio=32767 -#swapfc_enabled=0 -#swapfc_force_use_loop=0 -#swapfc_frequency=1 -#swapfc_chunk_size=256M -#swapfc_max_count=32 -#swapfc_min_count=0 -#swapfc_free_ram_perc=35 -#swapfc_free_swap_perc=15 -#swapfc_remove_free_swap_perc=55 -#swapfc_priority=50 -#swapfc_path=/var/lib/systemd-swap/swapfc/ -#swapfc_nocow=1 -#swapfc_directio=1 -#swapfc_force_preallocated=0 -#swapd_auto_swapon=1 -#swapd_prio=1024 diff --git a/airootfs/etc/systemd/zram-generator.conf b/airootfs/etc/systemd/zram-generator.conf new file mode 100644 index 0000000..33b8a54 --- /dev/null +++ b/airootfs/etc/systemd/zram-generator.conf @@ -0,0 +1,5 @@ +[zram0] +zram-size = ram / 2 +compression-algorithm = zstd +swap-priority = 100 +fs-type = swap diff --git a/efiboot/loader/entries/01-archiso-x86_64-linux.conf b/efiboot/loader/entries/01-archiso-x86_64-linux.conf index 1c2a7a8..0b2b8e1 100644 --- a/efiboot/loader/entries/01-archiso-x86_64-linux.conf +++ b/efiboot/loader/entries/01-archiso-x86_64-linux.conf @@ -4,4 +4,4 @@ linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux initrd /%INSTALL_DIR%/boot/intel-ucode.img initrd /%INSTALL_DIR%/boot/amd-ucode.img initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img -options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% +options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% zswap.enabled=0 diff --git a/efiboot/loader/entries/02-archiso-x86_64-speech-linux.conf b/efiboot/loader/entries/02-archiso-x86_64-speech-linux.conf index 64253d3..c275443 100644 --- a/efiboot/loader/entries/02-archiso-x86_64-speech-linux.conf +++ b/efiboot/loader/entries/02-archiso-x86_64-speech-linux.conf @@ -4,4 +4,4 @@ linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux initrd /%INSTALL_DIR%/boot/intel-ucode.img initrd /%INSTALL_DIR%/boot/amd-ucode.img initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img -options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% accessibility=on +options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% accessibility=on zswap.enabled=0 diff --git a/grub/grub.cfg b/grub/grub.cfg index 5bd6652..249892a 100644 --- a/grub/grub.cfg +++ b/grub/grub.cfg @@ -44,19 +44,19 @@ play 600 988 1 1319 4 menuentry "Solarity Liveboot (x86_64, UEFI)" --class arch --class gnu-linux --class gnu --class os --id 'archlinux' { set gfxpayload=keep - linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-zen archisobasedir=%INSTALL_DIR% archisodevice=UUID=${ARCHISO_UUID} + linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-zen archisobasedir=%INSTALL_DIR% archisodevice=UUID=${ARCHISO_UUID} zswap.enabled=0 initrd /%INSTALL_DIR%/boot/intel-ucode.img /%INSTALL_DIR%/boot/amd-ucode.img /%INSTALL_DIR%/boot/x86_64/initramfs-linux-zen.img } menuentry "Solarity Liveboot (x86_64, UEFI, copytoram)" --class arch --class gnu-linux --class gnu --class os --id 'archlinux-copytoram' { set gfxpayload=keep - linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-zen archisobasedir=%INSTALL_DIR% archisodevice=UUID=${ARCHISO_UUID} copytoram + linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-zen archisobasedir=%INSTALL_DIR% archisodevice=UUID=${ARCHISO_UUID} copytoram zswap.enabled=0 initrd /%INSTALL_DIR%/boot/intel-ucode.img /%INSTALL_DIR%/boot/amd-ucode.img /%INSTALL_DIR%/boot/x86_64/initramfs-linux-zen.img } menuentry "Solarity Liveboot with speakup screen reader (x86_64, UEFI)" --hotkey s --class arch --class gnu-linux --class gnu --class os --id 'archlinux-accessibility' { set gfxpayload=keep - linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-zen archisobasedir=%INSTALL_DIR% archisodevice=UUID=${ARCHISO_UUID} accessibility=on + linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-zen archisobasedir=%INSTALL_DIR% archisodevice=UUID=${ARCHISO_UUID} accessibility=on zswap.enabled=0 initrd /%INSTALL_DIR%/boot/intel-ucode.img /%INSTALL_DIR%/boot/amd-ucode.img /%INSTALL_DIR%/boot/x86_64/initramfs-linux-zen.img } diff --git a/packages.x86_64 b/packages.x86_64 index 72120e8..84d92ec 100644 --- a/packages.x86_64 +++ b/packages.x86_64 @@ -226,5 +226,5 @@ bless rclone hexedit flashrom -systemd-swap +zram-generator kexec-tools diff --git a/syslinux/archiso_pxe-linux.cfg b/syslinux/archiso_pxe-linux.cfg index b79b58f..f3edd96 100644 --- a/syslinux/archiso_pxe-linux.cfg +++ b/syslinux/archiso_pxe-linux.cfg @@ -6,7 +6,7 @@ ENDTEXT MENU LABEL Solarity Liveboot install medium (x86_64, NBD) LINUX ::/%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-zen INITRD ::/%INSTALL_DIR%/boot/intel-ucode.img,::/%INSTALL_DIR%/boot/amd-ucode.img,::/%INSTALL_DIR%/boot/x86_64/initramfs-linux-zen.img -APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% archiso_nbd_srv=${pxeserver} cms_verify=y +APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% archiso_nbd_srv=${pxeserver} cms_verify=y zswap.enabled=0 SYSAPPEND 3 LABEL arch64_nfs @@ -17,7 +17,7 @@ ENDTEXT MENU LABEL Solarity Liveboot install medium (x86_64, NFS) LINUX ::/%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-zen INITRD ::/%INSTALL_DIR%/boot/intel-ucode.img,::/%INSTALL_DIR%/boot/amd-ucode.img,::/%INSTALL_DIR%/boot/x86_64/initramfs-linux-zen.img -APPEND archisobasedir=%INSTALL_DIR% archiso_nfs_srv=${pxeserver}:/run/archiso/bootmnt cms_verify=y +APPEND archisobasedir=%INSTALL_DIR% archiso_nfs_srv=${pxeserver}:/run/archiso/bootmnt cms_verify=y zswap.enabled=0 SYSAPPEND 3 LABEL arch64_http @@ -28,5 +28,5 @@ ENDTEXT MENU LABEL Solarity Liveboot install medium (x86_64, HTTP) LINUX ::/%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-zen INITRD ::/%INSTALL_DIR%/boot/intel-ucode.img,::/%INSTALL_DIR%/boot/amd-ucode.img,::/%INSTALL_DIR%/boot/x86_64/initramfs-linux-zen.img -APPEND archisobasedir=%INSTALL_DIR% archiso_http_srv=http://${pxeserver}/ cms_verify=y +APPEND archisobasedir=%INSTALL_DIR% archiso_http_srv=http://${pxeserver}/ cms_verify=y zswap.enabled=0 SYSAPPEND 3 diff --git a/syslinux/archiso_sys-linux.cfg b/syslinux/archiso_sys-linux.cfg index 8cc3415..2802c94 100644 --- a/syslinux/archiso_sys-linux.cfg +++ b/syslinux/archiso_sys-linux.cfg @@ -6,7 +6,7 @@ ENDTEXT MENU LABEL Solarity Liveboot (x86_64, BIOS) LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-zen INITRD /%INSTALL_DIR%/boot/intel-ucode.img,/%INSTALL_DIR%/boot/amd-ucode.img,/%INSTALL_DIR%/boot/x86_64/initramfs-linux-zen.img -APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% +APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% zswap.enabled=0 LABEL arch64 TEXT HELP @@ -16,7 +16,7 @@ ENDTEXT MENU LABEL Solarity Liveboot (x86_64, BIOS, copytoram) LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-zen INITRD /%INSTALL_DIR%/boot/intel-ucode.img,/%INSTALL_DIR%/boot/amd-ucode.img,/%INSTALL_DIR%/boot/x86_64/initramfs-linux-zen.img -APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% copytoram +APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% copytoram zswap.enabled=0 # Accessibility boot option LABEL arch64speech @@ -27,4 +27,4 @@ ENDTEXT MENU LABEL Solarity Liveboot (x86_64, BIOS) with ^speech LINUX /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-zen INITRD /%INSTALL_DIR%/boot/intel-ucode.img,/%INSTALL_DIR%/boot/amd-ucode.img,/%INSTALL_DIR%/boot/x86_64/initramfs-linux-zen.img -APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% accessibility=on +APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% accessibility=on zswap.enabled=0