summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorKelvin Zhang <zhangkelvin@google.com>2020-11-25 11:33:51 -0500
committerKelvin Zhang <zhangkelvin@google.com>2020-11-25 15:53:26 -0500
commitaf4135035abb5b2f1d16639bfb718dd75b1ca048 (patch)
tree7d4f36e5346db1621940616f7b4de764d6fad6a3 /common
parentfa5177845c6ddab264c92e31ba73c0442dd78ff7 (diff)
Monitor the property ota.warm_reset
The property is set to inform kernel to do a warm_reset on the next reboot. This is useful to persist the logs to debug device boot failures. More details in http://go/rvc-ota-persist-logs. The property is read by vendor_init. And according to its value, vendor_init writes a particular sysfs file to schedule a warm reset on the following reboot. The vendor init also schedules the warm reset if the current slot hasn't been marked as successful during boottime, i.e. ro.boot.slot_successful=no Move definition of relevant rc scripts to pixel common script Bug: 143489994 Bug: 173267277 Test: adb shell grep "ota.warm_reset" -r /vendor Change-Id: I1f475403430149a0242e8ac098f1ce0155cad054
Diffstat (limited to 'common')
-rw-r--r--common/init.pixel.rc10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/init.pixel.rc b/common/init.pixel.rc
index 9c4d223..ad75632 100644
--- a/common/init.pixel.rc
+++ b/common/init.pixel.rc
@@ -32,3 +32,13 @@ on property:persist.sys.theme=1
on property:persist.sys.theme=0
start vendor.theme_clear
+# Set or clear the warm reset flag upon the change of system property. The flag itself is set
+on init && property:ro.boot.slot_successful=no
+ write /sys/module/msm_poweroff/parameters/warm_reset 1
+
+# by writing a sysfs file; and the file will be read by kernel.
+on property:ota.warm_reset=1
+ write /sys/module/msm_poweroff/parameters/warm_reset 1
+
+on property:ota.warm_reset=0
+ write /sys/module/msm_poweroff/parameters/warm_reset 0