Loading init/mount_handler.cpp +9 −3 Original line number Diff line number Diff line Loading @@ -90,12 +90,18 @@ void SetMountProperty(const MountHandlerEntry& entry, bool add) { auto mount_prop = entry.mount_point; if (mount_prop == "/") mount_prop = "/root"; std::replace(mount_prop.begin(), mount_prop.end(), '/', '.'); mount_prop = "dev.mnt.blk" + mount_prop; auto blk_mount_prop = "dev.mnt.blk" + mount_prop; auto dev_mount_prop = "dev.mnt.dev" + mount_prop; // Set property even if its value does not change to trigger 'on property:' // handling, except for clearing non-existent or already clear property. // Goal is reduction of empty properties and associated triggers. if (value.empty() && android::base::GetProperty(mount_prop, "").empty()) return; android::base::SetProperty(mount_prop, value); if (value.empty() && android::base::GetProperty(blk_mount_prop, "").empty()) return; android::base::SetProperty(blk_mount_prop, value); if (!value.empty()) { android::base::SetProperty(dev_mount_prop, entry.blk_device.substr(strlen(devblock))); } else { android::base::SetProperty(dev_mount_prop, ""); } } } // namespace Loading rootdir/init.rc +2 −2 Original line number Diff line number Diff line Loading @@ -1003,11 +1003,11 @@ on boot # to access F2FS sysfs on dm-<num> directly mkdir /dev/sys/fs/by-name 0755 system system symlink /sys/fs/f2fs/${dev.mnt.blk.data} /dev/sys/fs/by-name/userdata symlink /sys/fs/f2fs/${dev.mnt.dev.data} /dev/sys/fs/by-name/userdata # to access dm-<num> sysfs mkdir /dev/sys/block/by-name 0755 system system symlink /sys/devices/virtual/block/${dev.mnt.blk.data} /dev/sys/block/by-name/userdata symlink /sys/devices/virtual/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 Loading Loading
init/mount_handler.cpp +9 −3 Original line number Diff line number Diff line Loading @@ -90,12 +90,18 @@ void SetMountProperty(const MountHandlerEntry& entry, bool add) { auto mount_prop = entry.mount_point; if (mount_prop == "/") mount_prop = "/root"; std::replace(mount_prop.begin(), mount_prop.end(), '/', '.'); mount_prop = "dev.mnt.blk" + mount_prop; auto blk_mount_prop = "dev.mnt.blk" + mount_prop; auto dev_mount_prop = "dev.mnt.dev" + mount_prop; // Set property even if its value does not change to trigger 'on property:' // handling, except for clearing non-existent or already clear property. // Goal is reduction of empty properties and associated triggers. if (value.empty() && android::base::GetProperty(mount_prop, "").empty()) return; android::base::SetProperty(mount_prop, value); if (value.empty() && android::base::GetProperty(blk_mount_prop, "").empty()) return; android::base::SetProperty(blk_mount_prop, value); if (!value.empty()) { android::base::SetProperty(dev_mount_prop, entry.blk_device.substr(strlen(devblock))); } else { android::base::SetProperty(dev_mount_prop, ""); } } } // namespace Loading
rootdir/init.rc +2 −2 Original line number Diff line number Diff line Loading @@ -1003,11 +1003,11 @@ on boot # to access F2FS sysfs on dm-<num> directly mkdir /dev/sys/fs/by-name 0755 system system symlink /sys/fs/f2fs/${dev.mnt.blk.data} /dev/sys/fs/by-name/userdata symlink /sys/fs/f2fs/${dev.mnt.dev.data} /dev/sys/fs/by-name/userdata # to access dm-<num> sysfs mkdir /dev/sys/block/by-name 0755 system system symlink /sys/devices/virtual/block/${dev.mnt.blk.data} /dev/sys/block/by-name/userdata symlink /sys/devices/virtual/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 Loading