From 2d3ce51e01e009845b72c84a136f6f7c5c96ca53 Mon Sep 17 00:00:00 2001 From: Danny Wood Date: Tue, 3 Aug 2021 15:46:48 +0100 Subject: [PATCH] universal7580: enable ZRAM * Also disable samsung sswap Change-Id: I5152fa95a168a7e3e3ae3de18ca76f33fe7f9cfb --- ramdisk/etc/fstab.samsungexynos7580 | 3 +++ ramdisk/etc/init.samsungexynos7580.rc | 14 ++++++++------ sepolicy/file_contexts | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ramdisk/etc/fstab.samsungexynos7580 b/ramdisk/etc/fstab.samsungexynos7580 index 685ac82..f0b0000 100644 --- a/ramdisk/etc/fstab.samsungexynos7580 +++ b/ramdisk/etc/fstab.samsungexynos7580 @@ -19,3 +19,6 @@ /devices/13560000.dwmmc2/mmc_host/mmc* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata /devices/13510000.usb/usb* auto auto defaults voldmanaged=usb:auto /devices/13520000.usb/usb* auto auto defaults voldmanaged=usb:auto + +# ZRAM +/dev/block/zram0 none swap defaults zramsize=75%,max_comp_streams=8 diff --git a/ramdisk/etc/init.samsungexynos7580.rc b/ramdisk/etc/init.samsungexynos7580.rc index 2d62c74..246e2dd 100644 --- a/ramdisk/etc/init.samsungexynos7580.rc +++ b/ramdisk/etc/init.samsungexynos7580.rc @@ -8,6 +8,10 @@ import init.target.rc on early-init mount debugfs /sys/kernel/debug /sys/kernel/debug mode=755 + # ZRAM setup + write /sys/block/zram0/comp_algorithm lz4 + write /proc/sys/vm/page-cluster 0 + on init # RIL <-> audioserver comm chmod 0644 /proc/cmdline @@ -227,6 +231,10 @@ on fs mount_all /fstab.samsungexynos7580 setprop ro.crypto.fuse_sdcard true + # Enable swap + swapon_all /fstab.samsungexynos7580 + write /proc/sys/vm/swappiness 100 + # Permissions for ION chmod 0660 /sys/class/ion_cma/ion_video_ext/isolated chown system system /sys/class/ion_cma/ion_video_ext/isolated @@ -809,9 +817,3 @@ on charger write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor powersave write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor powersave write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor powersave - -service sswap /vendor/bin/sswap -s -f 1024 - class core - user root - group root - oneshot diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index 339efd7..9626d8e 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -26,6 +26,7 @@ /dev/ttySAC[0-1]* u:object_r:gps_device:s0 /dev/block/vnswap0 u:object_r:sswap_device:s0 +/dev/block/zram0 u:object_r:swap_block_device:s0 /dev/block/mmcblk0p[0-9]* u:object_r:emmcblk_device:s0 -- 2.20.1