32 lines
701 B
Plaintext
Raw Normal View History

2010-09-01 19:23:34 +02:00
#!/system/bin/sh
# - load compcache module
MEMTOTAL=$( awk '{ if ($1 eq "MemTotal:") print $2 ;exit }' </proc/meminfo )
if [ `getprop persist.service.compcache` == 1 ];
then
PROP=`getprop ro.compcache.default`
setprop persist.service.compcache $PROP
fi
2010-09-01 19:23:34 +02:00
if [ -e /data/property/persist.service.compcache ];
then
PROP=`getprop persist.service.compcache`
else
PROP=`getprop ro.compcache.default`
setprop persist.service.compcache $PROP
fi
if [ $PROP != 0 ]
2010-09-01 19:23:34 +02:00
then
CCSIZE=$(($(($MEMTOTAL * $PROP)) / 100))
echo 3 > /proc/sys/vm/drop_caches
echo 30 > /proc/sys/vm/swappiness
insmod /system/lib/modules/ramzswap.ko disksize_kb=$CCSIZE
2010-09-01 19:23:34 +02:00
busybox swapon /dev/block/ramzswap0
fi
exit 0