summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@oper.io>2021-05-21 13:50:45 -0600
committerAaron Ball <nullspoon@oper.io>2021-05-21 13:50:45 -0600
commit6c0d45e819e509255de7af4cb36c676cd4cbadcb (patch)
tree79f5037c03682dae7e3e50945c0f7c1f2f94ce13
parent98f4acf1004b83af65db84b13e2b34fe54ccdfad (diff)
parent1a030f0ff7f4787b4334c0f4fde7b8e56056178d (diff)
downloadzmount-6c0d45e819e509255de7af4cb36c676cd4cbadcb.tar.gz
zmount-6c0d45e819e509255de7af4cb36c676cd4cbadcb.tar.xz
Merge branch 'load-zram-earlier'
-rwxr-xr-xzram-swap8
1 files changed, 3 insertions, 5 deletions
diff --git a/zram-swap b/zram-swap
index 90bda43..0041234 100755
--- a/zram-swap
+++ b/zram-swap
@@ -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

Generated by cgit