update_engine_client: Make it easy to write a reboot manager.
This CL adds options -block_until_reboot_is_needed and -is_reboot_needed
flags to update_engine_client. This makes it easy to write a simple
script that can be used to reboot the device when an update has been
applied. For example, something like this:
while true;
update_engine_client -block_until_reboot_is_needed
if "$?" != "0"; then
log -p user.critical "update_engine_client failed!"
else
# TODO: app-specific logic to figure out if now is a good time to reboot
reboot
fi
sleep 1
done
BUG=chromium:353871
TEST=Manually tested.
Change-Id: I8399498911b5eb68ceb0c493926ef685a8b89e82
Reviewed-on: https://chromium-review.googlesource.com/193651
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
1 file changed