diff --git a/prebuilt/common/bin/compcache b/prebuilt/common/bin/compcache index c88dfeb2..388e388b 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 |stop|stats}" diff --git a/prebuilt/common/bin/handle_compcache b/prebuilt/common/bin/handle_compcache index 44ab0b76..00b97d68 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