2010-07-06 04:19:10 +00:00
|
|
|
#!/system/bin/sh
|
|
|
|
#
|
|
|
|
# Compcache manager
|
|
|
|
# shade@chemlab.org (cyanogen)
|
|
|
|
#
|
|
|
|
|
|
|
|
DEV=/dev/block/ramzswap0
|
|
|
|
MODULE=ramzswap
|
|
|
|
MODULES_DIR=/system/modules/lib/modules/`uname -r`
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
echo 3 > /proc/sys/vm/drop_caches
|
|
|
|
modprobe $MODULE
|
2010-08-31 23:04:01 +00:00
|
|
|
rzscontrol $DEV --disksize_kb=$2 --init
|
2010-07-06 04:19:10 +00:00
|
|
|
swapon $DEV
|
|
|
|
;;
|
|
|
|
|
|
|
|
stop)
|
|
|
|
swapoff $DEV >/dev/null 2>&1
|
|
|
|
rmmod $MODULE >/dev/null 2>&1
|
|
|
|
;;
|
|
|
|
stats)
|
|
|
|
rzscontrol $DEV --stats
|
|
|
|
;;
|
|
|
|
*)
|
2010-08-31 23:04:01 +00:00
|
|
|
echo "Usage: $0 {start <size>|stop|stats}"
|
2010-07-06 04:19:10 +00:00
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|