summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@oper.io>2021-05-19 12:12:31 -0600
committerAaron Ball <nullspoon@oper.io>2021-05-19 12:12:31 -0600
commit98f4acf1004b83af65db84b13e2b34fe54ccdfad (patch)
tree90adbabf2c61e2413a21f23066bb85dfb4d5ea57
parent5c1aec361c0a46dacb2a9bfb28bbda23111a7925 (diff)
downloadzram-swap-98f4acf1004b83af65db84b13e2b34fe54ccdfad.tar.gz
zram-swap-98f4acf1004b83af65db84b13e2b34fe54ccdfad.tar.xz
Load kernel module on start
-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