blob: c88dfeb245166c55e6977b2debd9436af7298812 [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
Steve Kondik0cd35702010-10-18 12:22:23 -040014 echo 30 > /proc/sys/vm/swappiness
Steve Kondik2dc24f62010-07-06 00:19:10 -040015 modprobe $MODULE
Wes Garner2f1711d2010-08-31 18:04:01 -050016 rzscontrol $DEV --disksize_kb=$2 --init
Steve Kondik2dc24f62010-07-06 00:19:10 -040017 swapon $DEV
18 ;;
19
20 stop)
21 swapoff $DEV >/dev/null 2>&1
22 rmmod $MODULE >/dev/null 2>&1
23 ;;
24 stats)
25 rzscontrol $DEV --stats
26 ;;
27 *)
Wes Garner2f1711d2010-08-31 18:04:01 -050028 echo "Usage: $0 {start <size>|stop|stats}"
Steve Kondik2dc24f62010-07-06 00:19:10 -040029 exit 1
30esac
31
32exit 0
33