diff options
| author | Tianjie Xu <xunchang@google.com> | 2019-11-14 15:07:25 -0800 |
|---|---|---|
| committer | Tianjie Xu <xunchang@google.com> | 2019-11-14 17:43:56 -0800 |
| commit | 88bf6d20ebbf8850a2389ede2e959b10d7ebe09e (patch) | |
| tree | 83976e1de0958366619a94de8ad18d67dfbf98f5 /update_verifier | |
| parent | 423f0d109b98de73c7aa3c5229bc06212b647f9f (diff) | |
Clear the warm_reset flag after boot is successful
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. After the slot has been marked as boot successful, we can drop
the warm_reset flag to avoid the performance overhead on the next
reboot.
Bug: 143489994
Test: check the property is set to 0 by update_verifier
Change-Id: I722fb1906e6efa56dfc4ad7beccd5e2ba7e0ef7c
Diffstat (limited to 'update_verifier')
| -rw-r--r-- | update_verifier/update_verifier.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp index d04c455d..a042f900 100644 --- a/update_verifier/update_verifier.cpp +++ b/update_verifier/update_verifier.cpp @@ -371,6 +371,10 @@ int update_verifier(int argc, char** argv) { return reboot_device(); } LOG(INFO) << "Marked slot " << current_slot << " as booted successfully."; + // Clears the warm reset flag for next reboot. + if (!android::base::SetProperty("ota.warm_reset", "0")) { + LOG(WARNING) << "Failed to reset the warm reset flag"; + } } else { LOG(INFO) << "Deferred marking slot " << current_slot << " as booted successfully."; } |
