replicant-vendor_replicant/prebuilt/common/bin/compcache
Wes Garner 2f1711de17 CMParts: Allow CompCache size to be set by user - via % of total RAM
Use % instead of a set size - per suggestion from Cyanogen
Fix to integer instead of decimal being passed around - props to Nameless
Handle older versions changing enabled CC to Default CC size (25%)
Enable PerformanceSettings dialog to view new CC setup
Final cleanup and fix default values / bash arithmetic

Change-Id: Ie7525cfa1f8829bb037961a66620ab8664f39cec

German translation - Matthias Büchner
French translation - Sébastien Vaucher
2010-10-17 02:19:02 -04:00

33 lines
537 B
Bash
Executable File

#!/system/bin/sh
#
# Compcache manager
# shade@chemlab.org (cyanogen)
#
DEV=/dev/block/ramzswap0
MODULE=ramzswap
MODULES_DIR=/system/modules/lib/modules/`uname -r`
case "$1" in
start)
echo 3 > /proc/sys/vm/drop_caches
modprobe $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