cm: Remove legacy compcache stuff
* Remove all this stuff. If a device wants ZRAM, it should be
enabled by the maintainer and properly configured and tuned.
* This stuff currently causes a conflict with the ZRAM support
added in Kitkat. Kill it.
Change-Id: Ib2488ea4463e32ec44b65fe786f732145b5b6e23
diff --git a/config/common.mk b/config/common.mk
index 53b321a..64e0d3c 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -97,11 +97,6 @@
PRODUCT_COPY_FILES += \
vendor/cm/prebuilt/common/etc/init.local.rc:root/init.cm.rc
-# Compcache/Zram support
-PRODUCT_COPY_FILES += \
- vendor/cm/prebuilt/common/bin/compcache:system/bin/compcache \
- vendor/cm/prebuilt/common/bin/handle_compcache:system/bin/handle_compcache
-
# Bring in camera effects
PRODUCT_COPY_FILES += \
vendor/cm/prebuilt/common/media/LMprec_508.emd:system/media/LMprec_508.emd \
diff --git a/prebuilt/common/bin/compcache b/prebuilt/common/bin/compcache
deleted file mode 100644
index bb3a349..0000000
--- a/prebuilt/common/bin/compcache
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/system/bin/sh
-#
-# Compcache manager
-# shade@chemlab.org (cyanogen)
-#
-
-isramzswap="$(find /system/lib/modules/ -name ramzswap.ko 2>/dev/null)"
-isramzswapbuiltin="$(ls -l /dev/block/ramzswap0 2>/dev/null)"
-
-if [ -n "$isramzswap$isramzswapbuiltin" ] ; then
- MODULE=ramzswap
- DEV=/dev/block/ramzswap0
-else
- DEV=/dev/block/zram0
- MODULE=zram
- SYSFS_PATH=/sys/block/zram0
-fi
-
-case "$1" in
- start)
- echo 3 > /proc/sys/vm/drop_caches
- echo 30 > /proc/sys/vm/swappiness
- modprobe $MODULE
- if [ $MODULE = ramzswap ]; then
- rzscontrol $DEV --disksize_kb=$2 --init
- else
- echo "$(($2 * 1024))" > $SYSFS_PATH/disksize
- mkswap $DEV >/dev/null
- fi
- swapon $DEV
- ;;
-
- stop)
- swapoff $DEV >/dev/null 2>&1
- rmmod $MODULE >/dev/null 2>&1
- ;;
- stats)
- if [ $MODULE = ramzswap ]; then
- rzscontrol $DEV --stats
- else
- cd $SYSFS_PATH && for i in * ; do
- echo -n "$i:"
- cat $i
- done
- fi
- ;;
- *)
- echo "Usage: $0 {start <size>|stop|stats}"
- exit 1
-esac
-
-exit 0
-
diff --git a/prebuilt/common/bin/handle_compcache b/prebuilt/common/bin/handle_compcache
deleted file mode 100644
index 21822d0..0000000
--- a/prebuilt/common/bin/handle_compcache
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/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.zram` == 1 ];
-then
- PROP=`getprop ro.zram.default`
- setprop persist.service.zram $PROP
-fi
-
-if [ -e /data/property/persist.service.zram ];
-then
- PROP=`getprop persist.service.zram`
-else
- PROP=`getprop ro.zram.default`
- setprop persist.service.zram $PROP
-fi
-
-if [ $PROP != 0 ]
-then
- CCSIZE=$(($(($MEMTOTAL * $PROP)) / 100))
- `dirname $0`/compcache start $CCSIZE
-else
- `dirname $0`/compcache stop
-fi
-
-exit 0
-
diff --git a/prebuilt/common/etc/init.local.rc b/prebuilt/common/etc/init.local.rc
index 5b1db3b..2ce5121 100644
--- a/prebuilt/common/etc/init.local.rc
+++ b/prebuilt/common/etc/init.local.rc
@@ -101,13 +101,6 @@
stop adbd
start adbd
-# Compcache - handle at boot
-service compcache /system/bin/handle_compcache
- class main
- user root
- group root
- oneshot
-
# sysinit (/system/etc/init.d)
service sysinit /system/bin/sysinit
user root