summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xzram-swap5
1 files changed, 5 insertions, 0 deletions
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() {

Generated by cgit