rootdir: properly enable zram

* use 512mb
* lz4 as default compression alg
This commit is contained in:
Mister Oyster 2017-01-29 21:04:38 +01:00
parent b9418ff447
commit e641f6c47a
4 changed files with 6 additions and 10 deletions

View File

@ -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 \

View File

@ -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

1
rootdir/fstab.swap Normal file
View File

@ -0,0 +1 @@
/dev/block/zram0 none swap defaults zramsize=536870912,zramstreams=3

View File

@ -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