diff options
author | Abaakouk Mehdi <theli48@gmail.com> | 2011-02-16 09:50:57 +0100 |
---|---|---|
committer | Abaakouk Mehdi <theli48@gmail.com> | 2011-02-16 10:09:17 +0100 |
commit | 3cf39adf819868d9bd72b6c9b4221880182e84d2 (patch) | |
tree | d6fc3888bea4a0f8dc1df91afbaffb00bef445a6 /prebuilt | |
parent | 5a311b3fea958c57065fd0bff59895934581e833 (diff) | |
download | vendor_replicant-3cf39adf819868d9bd72b6c9b4221880182e84d2.zip vendor_replicant-3cf39adf819868d9bd72b6c9b4221880182e84d2.tar.gz vendor_replicant-3cf39adf819868d9bd72b6c9b4221880182e84d2.tar.bz2 |
Update script for new compcache module (ie: zram)
Change-Id: I725a139830511bf343df2efe238c3a20dd5c235a
Diffstat (limited to 'prebuilt')
-rwxr-xr-x | prebuilt/common/bin/compcache | 14 | ||||
-rwxr-xr-x | prebuilt/common/bin/handle_compcache | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/prebuilt/common/bin/compcache b/prebuilt/common/bin/compcache index c88dfeb..388e388 100755 --- a/prebuilt/common/bin/compcache +++ b/prebuilt/common/bin/compcache @@ -4,16 +4,17 @@ # shade@chemlab.org (cyanogen) # -DEV=/dev/block/ramzswap0 -MODULE=ramzswap -MODULES_DIR=/system/modules/lib/modules/`uname -r` +DEV=/dev/block/zram0 +SYSFS_PATH=/sys/block/zram0 +MODULE=zram case "$1" in start) echo 3 > /proc/sys/vm/drop_caches echo 30 > /proc/sys/vm/swappiness modprobe $MODULE - rzscontrol $DEV --disksize_kb=$2 --init + echo "$2" > $SYSFS_PATH/disksize + mkswap $DEV >/dev/null swapon $DEV ;; @@ -22,7 +23,10 @@ case "$1" in rmmod $MODULE >/dev/null 2>&1 ;; stats) - rzscontrol $DEV --stats + cd $SYSFS_PATH && for i in * ; do + echo -n "$i:" + cat $i + done ;; *) echo "Usage: $0 {start <size>|stop|stats}" diff --git a/prebuilt/common/bin/handle_compcache b/prebuilt/common/bin/handle_compcache index 44ab0b7..00b97d6 100755 --- a/prebuilt/common/bin/handle_compcache +++ b/prebuilt/common/bin/handle_compcache @@ -21,7 +21,7 @@ fi if [ $PROP != 0 ] then - CCSIZE=$(($(($MEMTOTAL * $PROP)) / 100)) + CCSIZE=$(($(($MEMTOTAL * $PROP)) / 100 * 1024)) `dirname $0`/compcache start $CCSIZE else `dirname $0`/compcache stop |