diff options
| author | Yifan Hong <elsk@google.com> | 2019-05-01 13:13:58 -0700 |
|---|---|---|
| committer | Yifan Hong <elsk@google.com> | 2019-05-02 15:50:15 -0700 |
| commit | c784ce50e8c10eaf70e1f97e24e8324aef45faf5 (patch) | |
| tree | 323ee0a251af20592aafcc3a1d31ff2fda93b063 /bootloader_message | |
| parent | b5fe2dd00c2f04e02d3598e7956eb1374430088f (diff) | |
libbootloader_message: write recovery to any device
Test: cuttlefish
Bug: 79094284
Change-Id: If1a6460a8cbed2e2d22fa9e16e6d7ca84f4592d0
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 | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/bootloader_message/bootloader_message.cpp b/bootloader_message/bootloader_message.cpp index 8c1d63bd..0ebc04a3 100644 --- a/bootloader_message/bootloader_message.cpp +++ b/bootloader_message/bootloader_message.cpp @@ -168,6 +168,14 @@ bool write_bootloader_message(const std::vector<std::string>& options, std::stri return write_bootloader_message(boot, err); } +bool write_bootloader_message_to(const std::vector<std::string>& options, + const std::string& misc_blk_device, std::string* err) { + bootloader_message boot = {}; + update_bootloader_message_in_struct(&boot, options); + + return write_bootloader_message_to(boot, misc_blk_device, err); +} + bool update_bootloader_message(const std::vector<std::string>& options, std::string* err) { bootloader_message boot; if (!read_bootloader_message(&boot, err)) { diff --git a/bootloader_message/include/bootloader_message/bootloader_message.h b/bootloader_message/include/bootloader_message/bootloader_message.h index 95c19ae5..2207d4cb 100644 --- a/bootloader_message/include/bootloader_message/bootloader_message.h +++ b/bootloader_message/include/bootloader_message/bootloader_message.h @@ -207,6 +207,11 @@ bool write_bootloader_message_to(const bootloader_message& boot, // set the command and recovery fields, and reset the rest. bool write_bootloader_message(const std::vector<std::string>& options, std::string* err); +// Write bootloader message (boots into recovery with the options) to the specific BCB device. Will +// set the command and recovery fields, and reset the rest. +bool write_bootloader_message_to(const std::vector<std::string>& options, + const std::string& misc_blk_device, std::string* err); + // Update bootloader message (boots into recovery with the options) to BCB. Will // only update the command and recovery fields. bool update_bootloader_message(const std::vector<std::string>& options, std::string* err); |
