Browse Source

added

master
Ralph Rönnquist 2 months ago
parent
commit
964c0591a2
1 changed files with 28 additions and 0 deletions
  1. +28
    -0
      zram

+ 28
- 0
zram View File

@@ -0,0 +1,28 @@
### BEGIN INIT INFO
# Provides: zram
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: S
# Default-Stop: 0 1 6
# Short-Description: Use compressed RAM as in-memory swap
# Description: Use compressed RAM as in-memory swap
### END INIT INFO

SIZE=2000000000
case "$1" in
start)
modprobe zram num_devices=1
echo $SIZE > /sys/block/zram0/disksize
mkswap /dev/zram0
swapon /dev/zram0 --priority 10
;;
stop)
swapoff /dev/zram0
modprobe --remove zram
;;
*)
echo "Usage: $(basename $0) (start | stop)"
exit 1
;;
esac
true

Loading…
Cancel
Save