From 98f4acf1004b83af65db84b13e2b34fe54ccdfad Mon Sep 17 00:00:00 2001 From: Aaron Ball Date: Wed, 19 May 2021 12:12:31 -0600 Subject: Load kernel module on start --- zram-swap | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zram-swap b/zram-swap index 3392433..90bda43 100755 --- a/zram-swap +++ b/zram-swap @@ -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() { -- cgit v1.2.3