When you start compache with the start command form userinit20 - you don't get the benefit of selecting size or disable through UD Settings. The UD scripts appear to have been "borrowed" from a more general ROM structure. They don't - and cannot work as they reside on UD2.x.
Here's a fix that requires a number of edits - but preserves changes in size (or disable) through Settings. It fixes the two main scripts that don't work in UD2.x. I also posted this at UD..
Edit /system/bin/handle_compcache to read as follows:
The 232000 figure is the rounded amount of D1 RAM in kb
Then edit /system/bin/compcache to read:
Finally... edit /etc/init.d/20userinit
To the end of the file - add:
/system/bin/handle_compcache
You don't need "compcache start" - instead, compcache is called through "handle_compcache"
As originally coded - compcache is supposed to be started as a service through /etc/init.local.rc
And /init.rc (you can't edit this one so it "sticks") includes the "import" command to run init.local.rc - but this doesn't appear to work. So last resort is to include the command in /etc/init.d/20userinit
Here's a fix that requires a number of edits - but preserves changes in size (or disable) through Settings. It fixes the two main scripts that don't work in UD2.x. I also posted this at UD..
Edit /system/bin/handle_compcache to read as follows:
Code:
#!/system/bin/sh
#
# Compcache handler
# Decides whether or not Compcache is enabled
#
# This gets the percent of ram set in Settings
PROP="$(getprop persist.service.compcache)"
if [ $PROP = 0 ]
then
/system/bin/compcache stop
else
CCSIZE=$(($((232000 * $PROP)) / 100))
/system/bin/compcache start $CCSIZE
fi
exit 0
Then edit /system/bin/compcache to read:
Code:
#!/system/bin/sh
#
# Compcache manager
# [EMAIL="[email protected]"][email protected][/EMAIL] (cyanogen)
#
DEV=/dev/block/ramzswap0
MODULE=ramzswap.ko
MODULES_DIR=/system/lib/modules
case "$1" in
start)
echo 3 > /proc/sys/vm/drop_caches
# As of v25 - need to explicitly call busybox on next line
busybox insmod $MODULES_DIR/$MODULE
rzscontrol $DEV --disksize_kb=$2 --init
swapon $DEV
;;
stop)
swapoff $DEV >/dev/null 2>&1
rmmod $MODULE >/dev/null 2>&1
;;
stats)
rzscontrol $DEV --stats
;;
*)
echo "Usage: $0 {start <size>|stop|stats}"
exit 1
esac
exit 0
Finally... edit /etc/init.d/20userinit
To the end of the file - add:
/system/bin/handle_compcache
You don't need "compcache start" - instead, compcache is called through "handle_compcache"
As originally coded - compcache is supposed to be started as a service through /etc/init.local.rc
And /init.rc (you can't edit this one so it "sticks") includes the "import" command to run init.local.rc - but this doesn't appear to work. So last resort is to include the command in /etc/init.d/20userinit
Last edited: