summaryrefslogtreecommitdiff
path: root/rootdir
diff options
context:
space:
mode:
authortunturn <arbiter1000@gmail.com>2017-03-06 22:56:46 +1100
committerMax Weffers <rcstar6696@gmail.com>2017-03-14 13:15:01 +0100
commitb2537330bcd883c0c1a61524f36c7c4a4b7e6d2d (patch)
tree1a5104c39b232eb9df8bb6aafaaac24dbcaa8786 /rootdir
parent6ebd79bf95405f416802c9376f80bd34649bea95 (diff)
shinano-common: enable ZRAM
Change-Id: I178efeca573134df78e1227f3db89cfb8ce2779d
Diffstat (limited to 'rootdir')
-rw-r--r--rootdir/fstab.qcom2
-rw-r--r--rootdir/init.qcom.rc6
2 files changed, 8 insertions, 0 deletions
diff --git a/rootdir/fstab.qcom b/rootdir/fstab.qcom
index 8bdd8a8..e7d21fd 100644
--- a/rootdir/fstab.qcom
+++ b/rootdir/fstab.qcom
@@ -15,3 +15,5 @@
/devices/msm_sdcc.2/mmc_host* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata
/devices/msm_sdcc.3/mmc_host* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata
/devices/platform/xhci-hcd auto auto defaults voldmanaged=usbdisk:auto
+/dev/block/zram0 none swap defaults zramsize=533413200,zramstreams=4,notrim
+
diff --git a/rootdir/init.qcom.rc b/rootdir/init.qcom.rc
index 6be57e2..a9e2002 100644
--- a/rootdir/init.qcom.rc
+++ b/rootdir/init.qcom.rc
@@ -64,6 +64,9 @@ on init
# Enable panic on out of memory
write /proc/sys/vm/panic_on_oom 2
+ # Setup zram options
+ write /sys/block/zram0/comp_algorithm lz4
+
# Create a tmpfs for dynamic network mounting
mkdir /storage/removable/remote 0700 root system
mount tmpfs tmpfs /storage/removable/remote mode=0755,uid=0,gid=0
@@ -81,6 +84,9 @@ on fs
chown system system /lta-label
chmod 0555 /lta-label
+ # Mount ZRAM
+ swapon_all fstab.qcom
+
on early-boot
# set RLIMIT_MEMLOCK to 64MB
setrlimit 8 67108864 67108864