aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMister Oyster <oysterized@gmail.com>2017-01-29 21:04:38 +0100
committerMister Oyster <oysterized@gmail.com>2017-01-29 21:04:38 +0100
commite641f6c47a697d0149397aced09395f6a8bcef4b (patch)
treee4707785e9acb95691ef38df76d6871763e7596e
parentb9418ff44712377c8c4ce9690e2b56a88c2110e1 (diff)
rootdir: properly enable zram
* use 512mb * lz4 as default compression alg
-rw-r--r--product/ramdisk.mk2
-rw-r--r--rootdir/enableswap.sh4
-rw-r--r--rootdir/fstab.swap1
-rwxr-xr-xrootdir/init.mt6735.rc9
4 files changed, 6 insertions, 10 deletions
diff --git a/product/ramdisk.mk b/product/ramdisk.mk
index 2a774ab..a796106 100644
--- a/product/ramdisk.mk
+++ b/product/ramdisk.mk
@@ -1,6 +1,6 @@
# Ramdisk
PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/rootdir/enableswap.sh:root/enableswap.sh \
+ $(LOCAL_PATH)/rootdir/fstab.swap:root/fstab.swap \
$(LOCAL_PATH)/rootdir/factory_init.project.rc:root/factory_init.project.rc \
$(LOCAL_PATH)/rootdir/factory_init.rc:root/factory_init.rc \
$(LOCAL_PATH)/rootdir/fstab.mt6735:root/fstab.mt6735 \
diff --git a/rootdir/enableswap.sh b/rootdir/enableswap.sh
deleted file mode 100644
index 186b4b9..0000000
--- a/rootdir/enableswap.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-echo 0 > /sys/block/zram0/disksize
-/system/bin/tiny_mkswap /dev/block/zram0
-/system/bin/tiny_swapon /dev/block/zram0
diff --git a/rootdir/fstab.swap b/rootdir/fstab.swap
new file mode 100644
index 0000000..fcbd8ff
--- /dev/null
+++ b/rootdir/fstab.swap
@@ -0,0 +1 @@
+/dev/block/zram0 none swap defaults zramsize=536870912,zramstreams=3
diff --git a/rootdir/init.mt6735.rc b/rootdir/init.mt6735.rc
index 849b5a1..4171dcd 100755
--- a/rootdir/init.mt6735.rc
+++ b/rootdir/init.mt6735.rc
@@ -66,6 +66,10 @@ on fs
write /proc/bootprof "INIT:Mount_END"
on post-fs
+ write /sys/block/zram0/comp_algorithm lz4
+ swapon_all /fstab.swap
+ write /proc/sys/vm/page-cluster 0
+
# Support legacy paths
symlink /sdcard /storage/sdcard0
@@ -923,11 +927,6 @@ service PPLAgent /system/bin/ppl_agent
user system
group system cache
-service enableswap /system/bin/sh /enableswap.sh
- class late_start
- oneshot
- seclabel u:r:enableswap:s0
-
service agpsd /system/bin/mtk_agpsd
class main
socket agpsd stream 660 gps system