From 852111eea4eaf3c56e4ca9296a42b5b2a10df712 Mon Sep 17 00:00:00 2001 From: Juhyung Park Date: Tue, 15 Feb 2022 18:05:06 +0900 Subject: [PATCH] init.rc: use /sys/class/block instead of /sys/devices/virtual/block /sys/class/block covers all of dm-[0-9], sd[a-z], mmcblk[0-9]. Use it instead of /sys/devices/virtual/block, which only covers dm devices. This allows f2fs tunings to be applied more reliably regardless of how the userdata partition is set up. Do note that while everything under /sys/devices/virtual/block are expected to have correct SELinux labels by AOSP, some under /sys/class/block are not as it's symlinked to platform-specific paths, and it is up to the vendors to label them correctly. Test: Confirm entries under /dev/sys aren't dangling and cp_interval, gc_urgent_sleep_time, iostat_enable and discard_max_bytes are all set up properly under FBE, FDE and unencrypted. Change-Id: I089af5bc068445f33919df6659671e50456d49f9 Signed-off-by: Juhyung Park --- rootdir/init.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootdir/init.rc b/rootdir/init.rc index c4c9eca1d..224f605ac 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -1087,7 +1087,7 @@ on boot # to access dm- sysfs mkdir /dev/sys/block/by-name 0755 system system - symlink /sys/devices/virtual/block/${dev.mnt.dev.data} /dev/sys/block/by-name/userdata + symlink /sys/class/block/${dev.mnt.dev.data} /dev/sys/block/by-name/userdata # F2FS tuning. Set cp_interval larger than dirty_expire_centisecs, 30 secs, # to avoid power consumption when system becomes mostly idle. Be careful