diff options
author | Tao Bao | 2016-12-12 19:06:24 -0600 |
---|---|---|
committer | Tao Bao | 2016-12-12 19:06:24 -0600 |
commit | 26d5ae741efd904fdc20187eddad33ca31dd64fa (patch) | |
tree | ff4695e61fdb52f49a663610dbcffaec376187fb /bootloader_message | |
parent | 7e31f421a514da09b90e46dbd642a5e9b16e0003 (diff) | |
download | platform-bootable-recovery-26d5ae741efd904fdc20187eddad33ca31dd64fa.tar.gz platform-bootable-recovery-26d5ae741efd904fdc20187eddad33ca31dd64fa.tar.xz platform-bootable-recovery-26d5ae741efd904fdc20187eddad33ca31dd64fa.zip |
Revert "write_bootloader_message(<options>) should not reset stage field."
This reverts commit 7e31f421a514da09b90e46dbd642a5e9b16e0003.
Bug: 33534933
Change-Id: Ib173f6b1e36a79deafc3592785195693a6779471
Diffstat (limited to 'bootloader_message')
-rw-r--r-- | bootloader_message/bootloader_message.cpp | 8 | ||||
-rw-r--r-- | bootloader_message/include/bootloader_message/bootloader_message.h | 3 |
2 files changed, 2 insertions, 9 deletions
diff --git a/bootloader_message/bootloader_message.cpp b/bootloader_message/bootloader_message.cpp index 294b1725..9a567184 100644 --- a/bootloader_message/bootloader_message.cpp +++ b/bootloader_message/bootloader_message.cpp | |||
@@ -164,13 +164,7 @@ bool clear_bootloader_message(std::string* err) { | |||
164 | } | 164 | } |
165 | 165 | ||
166 | bool write_bootloader_message(const std::vector<std::string>& options, std::string* err) { | 166 | bool write_bootloader_message(const std::vector<std::string>& options, std::string* err) { |
167 | bootloader_message boot; | 167 | bootloader_message boot = {}; |
168 | if (!read_bootloader_message(&boot, err)) { | ||
169 | return false; | ||
170 | } | ||
171 | // Zero out the entire fields. | ||
172 | memset(boot.command, 0, sizeof(boot.command)); | ||
173 | memset(boot.recovery, 0, sizeof(boot.recovery)); | ||
174 | strlcpy(boot.command, "boot-recovery", sizeof(boot.command)); | 168 | strlcpy(boot.command, "boot-recovery", sizeof(boot.command)); |
175 | strlcpy(boot.recovery, "recovery\n", sizeof(boot.recovery)); | 169 | strlcpy(boot.recovery, "recovery\n", sizeof(boot.recovery)); |
176 | for (const auto& s : options) { | 170 | for (const auto& s : options) { |
diff --git a/bootloader_message/include/bootloader_message/bootloader_message.h b/bootloader_message/include/bootloader_message/bootloader_message.h index 422e87d9..e45f4248 100644 --- a/bootloader_message/include/bootloader_message/bootloader_message.h +++ b/bootloader_message/include/bootloader_message/bootloader_message.h | |||
@@ -192,8 +192,7 @@ bool write_bootloader_message(const bootloader_message& boot, std::string* err); | |||
192 | bool write_bootloader_message_to(const bootloader_message& boot, | 192 | bool write_bootloader_message_to(const bootloader_message& boot, |
193 | const std::string& misc_blk_device, std::string* err); | 193 | const std::string& misc_blk_device, std::string* err); |
194 | 194 | ||
195 | // Write bootloader message (boots into recovery with the options) to BCB. Will | 195 | // Write bootloader message (boots into recovery with the options) to BCB. |
196 | // set command and recovery fields only. | ||
197 | bool write_bootloader_message(const std::vector<std::string>& options, std::string* err); | 196 | bool write_bootloader_message(const std::vector<std::string>& options, std::string* err); |
198 | 197 | ||
199 | // Clear BCB. | 198 | // Clear BCB. |