Skip to content

Commit

Permalink
Clear the warm_reset flag after boot is successful
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Tianjie Xu committed Nov 15, 2019
1 parent 423f0d1 commit 88bf6d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions update_verifier/update_verifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
}
Expand Down

0 comments on commit 88bf6d2

Please sign in to comment.