write_bootloader_message(<options>) should not reset stage field.
Commit bd56f1590c switches to calling
write_bootloader_message(<options>) in get_args(), which
unintentionally resets the stage field thus breaks two-step OTAs.
This CL changes write_bootloader_message(<options>) to only set the
command field (to "boot-recovery") and the recovery field (with the
specified options).
Test: Apply a two-step package.
Change-Id: I6905918812c7d3402cc1524688079066a4d22d29
This commit is contained in:
@@ -164,7 +164,13 @@ bool clear_bootloader_message(std::string* err) {
|
||||
}
|
||||
|
||||
bool write_bootloader_message(const std::vector<std::string>& options, std::string* err) {
|
||||
bootloader_message boot = {};
|
||||
bootloader_message boot;
|
||||
if (!read_bootloader_message(&boot, err)) {
|
||||
return false;
|
||||
}
|
||||
// Zero out the entire fields.
|
||||
memset(boot.command, 0, sizeof(boot.command));
|
||||
memset(boot.recovery, 0, sizeof(boot.recovery));
|
||||
strlcpy(boot.command, "boot-recovery", sizeof(boot.command));
|
||||
strlcpy(boot.recovery, "recovery\n", sizeof(boot.recovery));
|
||||
for (const auto& s : options) {
|
||||
|
||||
Reference in New Issue
Block a user