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 <qkrwngud825@gmail.com>
This commit is contained in:
Juhyung Park 2022-02-15 18:05:06 +09:00 committed by Jaegeuk Kim
parent 1821237a1e
commit 852111eea4

View file

@ -1087,7 +1087,7 @@ on boot
# to access dm-<num> 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