diff options
author | David Anderson <dvander@google.com> | 2018-08-22 13:32:49 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-08-22 13:32:49 +0200 |
commit | 771161e7930499d88c396d6f4cbf53dc10d9b2f0 (patch) | |
tree | cfc5079f407074caa2d4976894edff3b6939e401 | |
parent | Merge "Depend on mke2fs.conf.recovery." am: aa536568b3 am: e6c86871f4 (diff) | |
parent | Merge "recovery: Add "boot-fastboot" command to BCB." am: 0115b79cbd (diff) | |
download | android_bootable_recovery-771161e7930499d88c396d6f4cbf53dc10d9b2f0.tar android_bootable_recovery-771161e7930499d88c396d6f4cbf53dc10d9b2f0.tar.gz android_bootable_recovery-771161e7930499d88c396d6f4cbf53dc10d9b2f0.tar.bz2 android_bootable_recovery-771161e7930499d88c396d6f4cbf53dc10d9b2f0.tar.lz android_bootable_recovery-771161e7930499d88c396d6f4cbf53dc10d9b2f0.tar.xz android_bootable_recovery-771161e7930499d88c396d6f4cbf53dc10d9b2f0.tar.zst android_bootable_recovery-771161e7930499d88c396d6f4cbf53dc10d9b2f0.zip |
-rw-r--r-- | recovery_main.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/recovery_main.cpp b/recovery_main.cpp index 99f965098..020a5314f 100644 --- a/recovery_main.cpp +++ b/recovery_main.cpp @@ -97,8 +97,13 @@ static std::vector<std::string> get_args(const int argc, char** const argv) { } stage = std::string(boot.stage); + std::string boot_command; if (boot.command[0] != 0) { - std::string boot_command = std::string(boot.command, sizeof(boot.command)); + if (memchr(boot.command, '\0', sizeof(boot.command))) { + boot_command = std::string(boot.command); + } else { + boot_command = std::string(boot.command, sizeof(boot.command)); + } LOG(INFO) << "Boot command: " << boot_command; } @@ -149,6 +154,12 @@ static std::vector<std::string> get_args(const int argc, char** const argv) { LOG(ERROR) << "Failed to set BCB message: " << err; } + // Finally, if no arguments were specified, check whether we should boot + // into fastboot. + if (args.size() == 1 && boot_command == "boot-fastboot") { + args.emplace_back("--fastboot"); + } + return args; } |