From 965a4ba5414590e68e36b8ee937872139d94985f Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 4 Apr 2018 13:45:33 -0700 Subject: [PATCH] Sanders: rootdir: Wait for hwservicemanager ready before running fsck As property service is part of init, and if init is busy with built-in command e.g. fsck, the propety_set() won't go through until the built-in command is finished. Move the start of hwservicemanager earlier and wait for its done after launches bootanim and its dependencies (there is not wait time during boot but the command is as a safeguard). Bug: 74437368 Test: boot with simulated long fsck and bootanim shown early Test: boot see 'start_waiting_for_property("hwservicemanager.ready", "true"): already set' Change-Id: Iab4b857a51e0e6b8b059d063c1f0d65a0e987622 Signed-off-by: ronaxdevil --- rootdir/etc/init.qcom.rc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 2481fad..b644e7f 100644 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -51,7 +51,9 @@ on fs wait /dev/block/platform/soc/${ro.boot.bootdevice} symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice - mount_all /vendor/etc/fstab.qcom + # Start HW service manager early + start hwservicemanager + mount_all /vendor/etc/fstab.qcom --early write /proc/sys/vm/swappiness 100 chown root system /mnt/vendor/persist @@ -60,6 +62,20 @@ on fs mkdir /mnt/vendor/persist/bms 0700 root system restorecon_recursive /mnt/vendor/persist +on late-fs + # Start services for bootanim + start servicemanager + start surfaceflinger + start bootanim + + # Wait for hwservicemanager ready since fsck might be triggered in mount_all --late + # In such case, init won't responce the property_set from hwservicemanager and then + # cause services for bootanim not running. + wait_for_prop hwservicemanager.ready true + + # Mount RW partitions which need run fsck + mount_all /vendor/etc/fstab.qcom --late + on init write /sys/module/qpnp_rtc/parameters/poweron_alarm 1