diff options
Diffstat (limited to 'zram-swap')
-rwxr-xr-x | zram-swap | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -38,9 +38,6 @@ 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}" @@ -54,8 +51,6 @@ 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() { @@ -64,6 +59,9 @@ main() { return 1 fi + # Make sure the zram module is loaded + modprobe zram + if [ "${1:-}" = 'start' ]; then start elif [ "${1:-}" = 'stop' ]; then |