summaryrefslogtreecommitdiff
path: root/init/builtins.cpp
diff options
context:
space:
mode:
authorVineela Tummalapalli <vineela.tummalapalli@intel.com>2016-10-28 19:30:07 -0700
committerAlex Deymo <deymo@google.com>2016-11-08 16:45:03 -0800
commit039734c7deba32a5f6d27a31dcfdc0a9fa19b0fb (patch)
treefd7bbb4bb7d09bc9a99cde3dd6c3c3666b708315 /init/builtins.cpp
parent847670437bd4b11ad1d32ec65be84f39954b0a6c (diff)
Implement Reboot bootloader via bootloader_message
- Write reboot bootloader message to misc - Clarify naming for reboot to recovery BUG: https://issuetracker.google.com/issues/32474515 Change-Id: I4e42509bfcf572e37c8fc070d6571afe406a48b6 Signed-off-by: Vineela Tummalapalli <vineela.tummalapalli@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com> Reviewed-on: https://android.intel.com/548494
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r--init/builtins.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp
index f37ccc2fe..3e50f4da8 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -703,6 +703,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] << "'";