Files
android_device_htc_click/custom/init.d/08compcache
2010-12-25 23:46:48 +01:00

39 lines
1.0 KiB
Bash

#!/system/bin/sh
L="log -p i -t cm"
# - load compcache module
$L " Kalim Compcache: iniciado compcache";
MEMTOTAL=$( awk '{ if ($1 eq "MemTotal:") print $2 ;exit }' </proc/meminfo )
$L "Kalim Compcache Memoria Total: " $MEMTOTAL
if [ -e /data/property/persist.service.compcache ];
then
$L "Kalim Compcache: propiedad EXISTE"
PROP=`getprop persist.service.compcache`
else
$L "Kalim Compcache: NO EXISTE"
PROP=18
setprop persist.service.compcache $PROP
fi
modprobe /system/lib/modules/tattoo-hack.ko
modprobe /system/lib/modules/lzo_compress.ko
modprobe /system/lib/modules/lzo_decompress.ko
modprobe /system/lib/modules/xvmalloc.ko
$L "Kalim Compcache: Modulos cargados: " $PROP
if [ $PROP != 1 ]
then
CCSIZE=$(($(($MEMTOTAL * $PROP)) / 100))
$L "Kalim Compcache: TAAMAÑO PREDEF CACHE: " $CCSIZE
$L "Kalim Compcache: Modulos cargar RAMZSWAP"
insmod /system/lib/modules/ramzswap.ko disksize_kb=$CCSIZE
$L "Kalim Compcache: Modulos cargar SWAP"
busybox swapon /dev/block/ramzswap0
$L "Kalim Compcache: Modulo ramzswap cargado en SWAP"
fi
exit 0