From e641f6c47a697d0149397aced09395f6a8bcef4b Mon Sep 17 00:00:00 2001 From: Mister Oyster Date: Sun, 29 Jan 2017 21:04:38 +0100 Subject: rootdir: properly enable zram * use 512mb * lz4 as default compression alg --- product/ramdisk.mk | 2 +- rootdir/enableswap.sh | 4 ---- rootdir/fstab.swap | 1 + rootdir/init.mt6735.rc | 9 ++++----- 4 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 rootdir/enableswap.sh create mode 100644 rootdir/fstab.swap 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 -- cgit v1.2.3