diff options
author | Vineela Tummalapalli <vineela.tummalapalli@intel.com> | 2016-11-10 02:52:23 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-11-10 02:52:23 +0000 |
commit | d1b560c6f97a01c79ebc90d94744f382dba76de4 (patch) | |
tree | 055ea591a6461264f248cf08b03bf7baee407177 /init/builtins.cpp | |
parent | d26107d939a1754a7d415040cdfd4432cd60b6a1 (diff) | |
parent | e759c83bdec4fd773c63e3e162b45f29740f024e (diff) |
Merge "Implement Reboot bootloader via bootloader_message"
am: e759c83bde
Change-Id: Id0a0e9e9c10f3df206138f297d2acafa87dc4ebf
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index 02066446d..9d1bb802e 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -708,6 +708,15 @@ static int do_powerctl(const std::vector<std::string>& args) { callback_on_ro_remount = unmount_and_fsck; } else if (cmd == ANDROID_RB_RESTART2) { reboot_target = &command[len + 1]; + // When rebooting to the bootloader notify the bootloader writing + // also the BCB. + if (strcmp(reboot_target, "bootloader") == 0) { + std::string err; + if (!write_reboot_bootloader(&err)) { + LOG(ERROR) << "reboot-bootloader: Error writing " + "bootloader_message: " << err; + } + } } } else if (command[len] != '\0') { LOG(ERROR) << "powerctl: unrecognized reboot target '" << &command[len] << "'"; |