click: Use custom script to handle compcache

There's no zram support in kernel 2.6.29, and after the system-wide
script got changed to handle zram, it broke handling of compcache,
resulting in allocating way too much memory for swap.

Change-Id: Iaf36c96cb1a7207ff5887ed784b99ae5b31bb9f0
This commit is contained in:
Arne Coucheron 2011-02-24 06:03:54 +01:00
parent afc24979fa
commit 8767919981
2 changed files with 32 additions and 0 deletions

View File

@ -69,6 +69,7 @@ PRODUCT_COPY_FILES += \
# precompiled files for /system/bin
PRODUCT_COPY_FILES += \
device/htc/click/custom/compcache:system/bin/compcache \
device/htc/click/custom/handle_compcache:system/bin/handle_compcache \
device/htc/click/custom/rzscontrol:system/bin/rzscontrol
# Backup-Tool for install

31
custom/handle_compcache Normal file
View File

@ -0,0 +1,31 @@
#!/system/bin/sh
#
# Compcache handler
# Decides whether or not Compcache is enabled
#
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
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 ]
then
CCSIZE=$(($(($MEMTOTAL * $PROP)) / 100))
`dirname $0`/compcache start $CCSIZE
else
`dirname $0`/compcache stop
fi
exit 0