blob: 6c9a4f0301126f1a5206158c79a04b3372c62bb9 [file] [log] [blame]
Steve Kondik2dc24f62010-07-06 00:19:10 -04001#!/system/bin/sh
2#
3# Compcache manager
4# shade@chemlab.org (cyanogen)
5#
6
7DEV=/dev/block/ramzswap0
8MODULE=ramzswap
9MODULES_DIR=/system/modules/lib/modules/`uname -r`
10
11case "$1" in
12 start)
13 echo 3 > /proc/sys/vm/drop_caches
14 modprobe $MODULE
Wes Garner2f1711d2010-08-31 18:04:01 -050015 rzscontrol $DEV --disksize_kb=$2 --init
Steve Kondik2dc24f62010-07-06 00:19:10 -040016 swapon $DEV
17 ;;
18
19 stop)
20 swapoff $DEV >/dev/null 2>&1
21 rmmod $MODULE >/dev/null 2>&1
22 ;;
23 stats)
24 rzscontrol $DEV --stats
25 ;;
26 *)
Wes Garner2f1711d2010-08-31 18:04:01 -050027 echo "Usage: $0 {start <size>|stop|stats}"
Steve Kondik2dc24f62010-07-06 00:19:10 -040028 exit 1
29esac
30
31exit 0
32