Allow write access to system_server on zram sysfs
System server needs to be able to write to idle and
writeback nodes in the zram sysfs directory.
Bug: 117682284
Bug: 122674343
Test: Test writeback on go ref device
Change-Id: I1cd663b73a7ebb255fe7e459601e720961bbd69e
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 9b20964..026dbed 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -643,6 +643,12 @@
chown root system /sys/module/lowmemorykiller/parameters/minfree
chmod 0664 /sys/module/lowmemorykiller/parameters/minfree
+ # System server manages zram writeback
+ chown root system /sys/block/zram0/idle
+ chmod 0664 /sys/block/zram0/idle
+ chown root system /sys/block/zram0/writeback
+ chmod 0664 /sys/block/zram0/writeback
+
# Tweak background writeout
write /proc/sys/vm/dirty_expire_centisecs 200
write /proc/sys/vm/dirty_background_ratio 5