diff options
author | Aaron Ball <nullspoon@oper.io> | 2021-05-19 12:12:31 -0600 |
---|---|---|
committer | Aaron Ball <nullspoon@oper.io> | 2021-05-19 12:12:31 -0600 |
commit | 98f4acf1004b83af65db84b13e2b34fe54ccdfad (patch) | |
tree | 90adbabf2c61e2413a21f23066bb85dfb4d5ea57 | |
parent | 5c1aec361c0a46dacb2a9bfb28bbda23111a7925 (diff) | |
download | zmount-98f4acf1004b83af65db84b13e2b34fe54ccdfad.tar.gz zmount-98f4acf1004b83af65db84b13e2b34fe54ccdfad.tar.xz |
Load kernel module on start
-rwxr-xr-x | zram-swap | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -38,6 +38,9 @@ start() { # Thread count is half of cpu local threads="$(( $(nproc) / 2 ))" + # Make sure the zram module is loaded + modprobe zram + # Create the zram device zramctl "${unused}" -s "${size}" -t "${threads}" mkswap "${unused}" @@ -51,6 +54,8 @@ stop() { swapoff ${zram} zramctl -r "${zram}" rm -f "${RUNFILE}" + # Note: We do not want to try to remove the zram kernel module in case other + # devices are in use. } main() { |