libbootloader_message: write recovery to any device

Test: cuttlefish
Bug: 79094284

Change-Id: If1a6460a8cbed2e2d22fa9e16e6d7ca84f4592d0
This commit is contained in:
Yifan Hong
2019-05-02 15:50:15 -07:00
parent b5fe2dd00c
commit c784ce50e8
2 changed files with 13 additions and 0 deletions
@@ -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)) {
@@ -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);