aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Luo <royluo@google.com>2024-04-08 18:15:09 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-04-08 18:15:09 +0000
commit3bf54b57d2abe885fbcbf886b13d69c8287732da (patch)
tree9c1c5ea28d675c278428086282887336df55df4b
parent17833ea655def06ad28b9d6af78c868d7fcdfacf (diff)
parentcdcdf52e7cc75082ebe337aa133176954bdcb4a2 (diff)
downloadrecovery-3bf54b57d2abe885fbcbf886b13d69c8287732da.tar.gz
Merge "recovery: do not update bootloader message for boot-fastboot" into main
-rw-r--r--recovery_main.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/recovery_main.cpp b/recovery_main.cpp
index cb3f0c13..903a3173 100644
--- a/recovery_main.cpp
+++ b/recovery_main.cpp
@@ -155,9 +155,13 @@ static std::vector<std::string> get_args(const int argc, char** const argv, std:
// Write the arguments (excluding the filename in args[0]) back into the
// bootloader control block. So the device will always boot into recovery to
// finish the pending work, until FinishRecovery() is called.
- std::vector<std::string> options(args.cbegin() + 1, args.cend());
- if (!update_bootloader_message(options, &err)) {
- LOG(ERROR) << "Failed to set BCB message: " << err;
+ // This should only be done for boot-recovery command so that other commands
+ // won't be overwritten.
+ if (boot_command == "boot-recovery") {
+ std::vector<std::string> options(args.cbegin() + 1, args.cend());
+ if (!update_bootloader_message(options, &err)) {
+ LOG(ERROR) << "Failed to set BCB message: " << err;
+ }
}
// Finally, if no arguments were specified, check whether we should boot