Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Yabin Cui | 2f272c0 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 17 | #include <bootloader_message/bootloader_message.h> |
| 18 | |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 19 | #include <errno.h> |
| 20 | #include <fcntl.h> |
| 21 | #include <string.h> |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 22 | |
| 23 | #include <string> |
Tao Bao | 35e0f6d | 2019-05-16 14:42:42 -0700 | [diff] [blame] | 24 | #include <string_view> |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 25 | #include <vector> |
| 26 | |
| 27 | #include <android-base/file.h> |
| 28 | #include <android-base/stringprintf.h> |
| 29 | #include <android-base/unique_fd.h> |
Tom Cherry | 772c93c | 2018-12-04 09:37:39 -0800 | [diff] [blame] | 30 | #include <fstab/fstab.h> |
Yabin Cui | 8b309f6 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 31 | |
Tom Cherry | 72a114a | 2019-01-30 15:59:53 -0800 | [diff] [blame] | 32 | using android::fs_mgr::Fstab; |
| 33 | using android::fs_mgr::ReadDefaultFstab; |
| 34 | |
Tao Bao | 35e0f6d | 2019-05-16 14:42:42 -0700 | [diff] [blame] | 35 | static std::string g_misc_device_for_test; |
| 36 | |
| 37 | // Exposed for test purpose. |
| 38 | void SetMiscBlockDeviceForTest(std::string_view misc_device) { |
| 39 | g_misc_device_for_test = misc_device; |
| 40 | } |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 41 | |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 42 | #ifdef USE_OLD_BOOTLOADER_MESSAGE |
| 43 | #include <sys/system_properties.h> |
Ethan Yonker | b523650 | 2016-11-19 22:24:59 -0600 | [diff] [blame] | 44 | |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 45 | static struct fstab* read_fstab(std::string* err) { |
| 46 | // The fstab path is always "/fstab.${ro.hardware}". |
| 47 | std::string fstab_path = "/fstab."; |
| 48 | char value[PROP_VALUE_MAX]; |
| 49 | if (__system_property_get("ro.hardware", value) == 0) { |
| 50 | *err = "failed to get ro.hardware"; |
| 51 | return nullptr; |
| 52 | } |
| 53 | fstab_path += value; |
| 54 | struct fstab* fstab = fs_mgr_read_fstab(fstab_path.c_str()); |
| 55 | if (fstab == nullptr) { |
| 56 | *err = "failed to read " + fstab_path; |
| 57 | } |
| 58 | return fstab; |
| 59 | } |
Ethan Yonker | b523650 | 2016-11-19 22:24:59 -0600 | [diff] [blame] | 60 | #endif |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 61 | |
| 62 | static std::string get_misc_blk_device(std::string* err) { |
bigbiff | 26d5d5f | 2020-03-23 09:56:16 -0400 | [diff] [blame^] | 63 | <<<<<<< HEAD |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 64 | #ifdef USE_OLD_BOOTLOADER_MESSAGE |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 65 | struct fstab* fstab = read_fstab(err); |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 66 | #else |
Bowgo Tsai | 4508f23 | 2017-03-27 17:47:21 +0000 | [diff] [blame] | 67 | std::unique_ptr<fstab, decltype(&fs_mgr_free_fstab)> fstab(fs_mgr_read_fstab_default(), |
| 68 | fs_mgr_free_fstab); |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 69 | #endif |
Bowgo Tsai | d13b6cf | 2017-03-10 16:00:40 +0800 | [diff] [blame] | 70 | if (!fstab) { |
| 71 | *err = "failed to read default fstab"; |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 72 | return ""; |
| 73 | } |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 74 | #ifdef USE_OLD_BOOTLOADER_MESSAGE |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 75 | fstab_rec* record = fs_mgr_get_entry_for_mount_point(fstab, "/misc"); |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 76 | #else |
Bowgo Tsai | d13b6cf | 2017-03-10 16:00:40 +0800 | [diff] [blame] | 77 | fstab_rec* record = fs_mgr_get_entry_for_mount_point(fstab.get(), "/misc"); |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 78 | #endif |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 79 | if (record == nullptr) { |
| 80 | *err = "failed to find /misc partition"; |
| 81 | return ""; |
bigbiff | 26d5d5f | 2020-03-23 09:56:16 -0400 | [diff] [blame^] | 82 | ======= |
Tao Bao | 35e0f6d | 2019-05-16 14:42:42 -0700 | [diff] [blame] | 83 | if (!g_misc_device_for_test.empty()) { |
| 84 | return g_misc_device_for_test; |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 85 | } |
Tom Cherry | 772c93c | 2018-12-04 09:37:39 -0800 | [diff] [blame] | 86 | Fstab fstab; |
| 87 | if (!ReadDefaultFstab(&fstab)) { |
Yabin Cui | 8b309f6 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 88 | *err = "failed to read default fstab"; |
| 89 | return ""; |
| 90 | } |
Tom Cherry | 772c93c | 2018-12-04 09:37:39 -0800 | [diff] [blame] | 91 | for (const auto& entry : fstab) { |
| 92 | if (entry.mount_point == "/misc") { |
| 93 | return entry.blk_device; |
| 94 | } |
bigbiff | 26d5d5f | 2020-03-23 09:56:16 -0400 | [diff] [blame^] | 95 | >>>>>>> android-10.0.0_r25 |
Yabin Cui | 8b309f6 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 96 | } |
Tom Cherry | 772c93c | 2018-12-04 09:37:39 -0800 | [diff] [blame] | 97 | |
| 98 | *err = "failed to find /misc partition"; |
| 99 | return ""; |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 100 | } |
| 101 | |
Yabin Cui | 2f272c0 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 102 | // In recovery mode, recovery can get started and try to access the misc |
| 103 | // device before the kernel has actually created it. |
| 104 | static bool wait_for_device(const std::string& blk_device, std::string* err) { |
| 105 | int tries = 0; |
| 106 | int ret; |
| 107 | err->clear(); |
| 108 | do { |
| 109 | ++tries; |
| 110 | struct stat buf; |
| 111 | ret = stat(blk_device.c_str(), &buf); |
| 112 | if (ret == -1) { |
| 113 | *err += android::base::StringPrintf("failed to stat %s try %d: %s\n", |
| 114 | blk_device.c_str(), tries, strerror(errno)); |
| 115 | sleep(1); |
| 116 | } |
| 117 | } while (ret && tries < 10); |
| 118 | |
| 119 | if (ret) { |
| 120 | *err += android::base::StringPrintf("failed to stat %s\n", blk_device.c_str()); |
| 121 | } |
| 122 | return ret == 0; |
| 123 | } |
| 124 | |
Tao Bao | bedf5fc | 2016-11-18 12:01:26 -0800 | [diff] [blame] | 125 | static bool read_misc_partition(void* p, size_t size, const std::string& misc_blk_device, |
| 126 | size_t offset, std::string* err) { |
Yabin Cui | 2f272c0 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 127 | if (!wait_for_device(misc_blk_device, err)) { |
| 128 | return false; |
| 129 | } |
Yabin Cui | 0d5b859 | 2016-07-06 11:47:23 -0700 | [diff] [blame] | 130 | android::base::unique_fd fd(open(misc_blk_device.c_str(), O_RDONLY)); |
Tao Bao | bedf5fc | 2016-11-18 12:01:26 -0800 | [diff] [blame] | 131 | if (fd == -1) { |
Yabin Cui | 2f272c0 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 132 | *err = android::base::StringPrintf("failed to open %s: %s", misc_blk_device.c_str(), |
| 133 | strerror(errno)); |
| 134 | return false; |
| 135 | } |
Ethan Yonker | b523650 | 2016-11-19 22:24:59 -0600 | [diff] [blame] | 136 | if (lseek(fd, static_cast<off_t>(offset), SEEK_SET) != static_cast<off_t>(offset)) { |
Yabin Cui | 2f272c0 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 137 | *err = android::base::StringPrintf("failed to lseek %s: %s", misc_blk_device.c_str(), |
| 138 | strerror(errno)); |
| 139 | return false; |
| 140 | } |
Tao Bao | bedf5fc | 2016-11-18 12:01:26 -0800 | [diff] [blame] | 141 | if (!android::base::ReadFully(fd, p, size)) { |
Yabin Cui | 2f272c0 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 142 | *err = android::base::StringPrintf("failed to read %s: %s", misc_blk_device.c_str(), |
| 143 | strerror(errno)); |
| 144 | return false; |
| 145 | } |
| 146 | return true; |
| 147 | } |
| 148 | |
Tao Bao | bedf5fc | 2016-11-18 12:01:26 -0800 | [diff] [blame] | 149 | static bool write_misc_partition(const void* p, size_t size, const std::string& misc_blk_device, |
| 150 | size_t offset, std::string* err) { |
| 151 | android::base::unique_fd fd(open(misc_blk_device.c_str(), O_WRONLY)); |
Ethan Yonker | b523650 | 2016-11-19 22:24:59 -0600 | [diff] [blame] | 152 | if (fd == -1) { |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 153 | *err = android::base::StringPrintf("failed to open %s: %s", misc_blk_device.c_str(), |
| 154 | strerror(errno)); |
| 155 | return false; |
| 156 | } |
Ethan Yonker | b523650 | 2016-11-19 22:24:59 -0600 | [diff] [blame] | 157 | if (lseek(fd, static_cast<off_t>(offset), SEEK_SET) != static_cast<off_t>(offset)) { |
Yabin Cui | 6faf026 | 2016-06-09 14:09:39 -0700 | [diff] [blame] | 158 | *err = android::base::StringPrintf("failed to lseek %s: %s", misc_blk_device.c_str(), |
| 159 | strerror(errno)); |
| 160 | return false; |
| 161 | } |
Tao Bao | bedf5fc | 2016-11-18 12:01:26 -0800 | [diff] [blame] | 162 | if (!android::base::WriteFully(fd, p, size)) { |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 163 | *err = android::base::StringPrintf("failed to write %s: %s", misc_blk_device.c_str(), |
| 164 | strerror(errno)); |
| 165 | return false; |
| 166 | } |
Ethan Yonker | b523650 | 2016-11-19 22:24:59 -0600 | [diff] [blame] | 167 | if (fsync(fd) == -1) { |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 168 | *err = android::base::StringPrintf("failed to fsync %s: %s", misc_blk_device.c_str(), |
| 169 | strerror(errno)); |
| 170 | return false; |
| 171 | } |
| 172 | return true; |
| 173 | } |
| 174 | |
Alex Deymo | fb00d82 | 2016-11-08 15:46:07 -0800 | [diff] [blame] | 175 | std::string get_bootloader_message_blk_device(std::string* err) { |
| 176 | std::string misc_blk_device = get_misc_blk_device(err); |
| 177 | if (misc_blk_device.empty()) return ""; |
| 178 | if (!wait_for_device(misc_blk_device, err)) return ""; |
| 179 | return misc_blk_device; |
| 180 | } |
| 181 | |
Tao Bao | bedf5fc | 2016-11-18 12:01:26 -0800 | [diff] [blame] | 182 | bool read_bootloader_message_from(bootloader_message* boot, const std::string& misc_blk_device, |
| 183 | std::string* err) { |
| 184 | return read_misc_partition(boot, sizeof(*boot), misc_blk_device, |
| 185 | BOOTLOADER_MESSAGE_OFFSET_IN_MISC, err); |
| 186 | } |
| 187 | |
Yabin Cui | 2f272c0 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 188 | bool read_bootloader_message(bootloader_message* boot, std::string* err) { |
Tao Bao | bedf5fc | 2016-11-18 12:01:26 -0800 | [diff] [blame] | 189 | std::string misc_blk_device = get_misc_blk_device(err); |
| 190 | if (misc_blk_device.empty()) { |
| 191 | return false; |
| 192 | } |
| 193 | return read_bootloader_message_from(boot, misc_blk_device, err); |
| 194 | } |
| 195 | |
| 196 | bool write_bootloader_message_to(const bootloader_message& boot, const std::string& misc_blk_device, |
| 197 | std::string* err) { |
| 198 | return write_misc_partition(&boot, sizeof(boot), misc_blk_device, |
| 199 | BOOTLOADER_MESSAGE_OFFSET_IN_MISC, err); |
Yabin Cui | 2f272c0 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 200 | } |
| 201 | |
| 202 | bool write_bootloader_message(const bootloader_message& boot, std::string* err) { |
Tao Bao | bedf5fc | 2016-11-18 12:01:26 -0800 | [diff] [blame] | 203 | std::string misc_blk_device = get_misc_blk_device(err); |
| 204 | if (misc_blk_device.empty()) { |
| 205 | return false; |
| 206 | } |
| 207 | return write_bootloader_message_to(boot, misc_blk_device, err); |
Yabin Cui | 6faf026 | 2016-06-09 14:09:39 -0700 | [diff] [blame] | 208 | } |
| 209 | |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 210 | bool clear_bootloader_message(std::string* err) { |
| 211 | bootloader_message boot = {}; |
| 212 | return write_bootloader_message(boot, err); |
| 213 | } |
| 214 | |
| 215 | bool write_bootloader_message(const std::vector<std::string>& options, std::string* err) { |
| 216 | bootloader_message boot = {}; |
Tianjie Xu | a88cc54 | 2017-10-25 13:16:54 -0700 | [diff] [blame] | 217 | update_bootloader_message_in_struct(&boot, options); |
| 218 | |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 219 | return write_bootloader_message(boot, err); |
| 220 | } |
| 221 | |
Tao Bao | 2292db8 | 2016-12-13 21:53:31 -0800 | [diff] [blame] | 222 | bool update_bootloader_message(const std::vector<std::string>& options, std::string* err) { |
| 223 | bootloader_message boot; |
| 224 | if (!read_bootloader_message(&boot, err)) { |
| 225 | return false; |
| 226 | } |
Tianjie Xu | a88cc54 | 2017-10-25 13:16:54 -0700 | [diff] [blame] | 227 | update_bootloader_message_in_struct(&boot, options); |
Tao Bao | 2292db8 | 2016-12-13 21:53:31 -0800 | [diff] [blame] | 228 | |
Tianjie Xu | a88cc54 | 2017-10-25 13:16:54 -0700 | [diff] [blame] | 229 | return write_bootloader_message(boot, err); |
| 230 | } |
Tao Bao | 2292db8 | 2016-12-13 21:53:31 -0800 | [diff] [blame] | 231 | |
Tianjie Xu | a88cc54 | 2017-10-25 13:16:54 -0700 | [diff] [blame] | 232 | bool update_bootloader_message_in_struct(bootloader_message* boot, |
| 233 | const std::vector<std::string>& options) { |
| 234 | if (!boot) return false; |
| 235 | // Replace the command & recovery fields. |
| 236 | memset(boot->command, 0, sizeof(boot->command)); |
| 237 | memset(boot->recovery, 0, sizeof(boot->recovery)); |
| 238 | |
| 239 | strlcpy(boot->command, "boot-recovery", sizeof(boot->command)); |
| 240 | strlcpy(boot->recovery, "recovery\n", sizeof(boot->recovery)); |
Tao Bao | 2292db8 | 2016-12-13 21:53:31 -0800 | [diff] [blame] | 241 | for (const auto& s : options) { |
Tianjie Xu | a88cc54 | 2017-10-25 13:16:54 -0700 | [diff] [blame] | 242 | strlcat(boot->recovery, s.c_str(), sizeof(boot->recovery)); |
Tao Bao | 2292db8 | 2016-12-13 21:53:31 -0800 | [diff] [blame] | 243 | if (s.back() != '\n') { |
Tianjie Xu | a88cc54 | 2017-10-25 13:16:54 -0700 | [diff] [blame] | 244 | strlcat(boot->recovery, "\n", sizeof(boot->recovery)); |
Tao Bao | 2292db8 | 2016-12-13 21:53:31 -0800 | [diff] [blame] | 245 | } |
| 246 | } |
Tianjie Xu | a88cc54 | 2017-10-25 13:16:54 -0700 | [diff] [blame] | 247 | return true; |
Tao Bao | 2292db8 | 2016-12-13 21:53:31 -0800 | [diff] [blame] | 248 | } |
| 249 | |
Vineela Tummalapalli | cba7fa8 | 2016-10-28 19:44:40 -0700 | [diff] [blame] | 250 | bool write_reboot_bootloader(std::string* err) { |
| 251 | bootloader_message boot; |
| 252 | if (!read_bootloader_message(&boot, err)) { |
| 253 | return false; |
| 254 | } |
| 255 | if (boot.command[0] != '\0') { |
| 256 | *err = "Bootloader command pending."; |
| 257 | return false; |
| 258 | } |
| 259 | strlcpy(boot.command, "bootonce-bootloader", sizeof(boot.command)); |
| 260 | return write_bootloader_message(boot, err); |
| 261 | } |
| 262 | |
Yabin Cui | 2f272c0 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 263 | bool read_wipe_package(std::string* package_data, size_t size, std::string* err) { |
Tao Bao | bedf5fc | 2016-11-18 12:01:26 -0800 | [diff] [blame] | 264 | std::string misc_blk_device = get_misc_blk_device(err); |
| 265 | if (misc_blk_device.empty()) { |
| 266 | return false; |
| 267 | } |
Yabin Cui | 2f272c0 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 268 | package_data->resize(size); |
Tao Bao | bedf5fc | 2016-11-18 12:01:26 -0800 | [diff] [blame] | 269 | return read_misc_partition(&(*package_data)[0], size, misc_blk_device, |
| 270 | WIPE_PACKAGE_OFFSET_IN_MISC, err); |
Yabin Cui | 2f272c0 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 271 | } |
| 272 | |
Yabin Cui | 6faf026 | 2016-06-09 14:09:39 -0700 | [diff] [blame] | 273 | bool write_wipe_package(const std::string& package_data, std::string* err) { |
Tao Bao | bedf5fc | 2016-11-18 12:01:26 -0800 | [diff] [blame] | 274 | std::string misc_blk_device = get_misc_blk_device(err); |
| 275 | if (misc_blk_device.empty()) { |
| 276 | return false; |
| 277 | } |
| 278 | return write_misc_partition(package_data.data(), package_data.size(), misc_blk_device, |
Yabin Cui | 6faf026 | 2016-06-09 14:09:39 -0700 | [diff] [blame] | 279 | WIPE_PACKAGE_OFFSET_IN_MISC, err); |
| 280 | } |
| 281 | |
Tao Bao | 35e0f6d | 2019-05-16 14:42:42 -0700 | [diff] [blame] | 282 | static bool OffsetAndSizeInVendorSpace(size_t offset, size_t size) { |
| 283 | auto total_size = WIPE_PACKAGE_OFFSET_IN_MISC - VENDOR_SPACE_OFFSET_IN_MISC; |
| 284 | return size <= total_size && offset <= total_size - size; |
| 285 | } |
| 286 | |
| 287 | bool ReadMiscPartitionVendorSpace(void* data, size_t size, size_t offset, std::string* err) { |
| 288 | if (!OffsetAndSizeInVendorSpace(offset, size)) { |
| 289 | *err = android::base::StringPrintf("Out of bound read (offset %zu size %zu)", offset, size); |
| 290 | return false; |
| 291 | } |
| 292 | auto misc_blk_device = get_misc_blk_device(err); |
| 293 | if (misc_blk_device.empty()) { |
| 294 | return false; |
| 295 | } |
| 296 | return read_misc_partition(data, size, misc_blk_device, VENDOR_SPACE_OFFSET_IN_MISC + offset, |
| 297 | err); |
| 298 | } |
| 299 | |
| 300 | bool WriteMiscPartitionVendorSpace(const void* data, size_t size, size_t offset, std::string* err) { |
| 301 | if (!OffsetAndSizeInVendorSpace(offset, size)) { |
| 302 | *err = android::base::StringPrintf("Out of bound write (offset %zu size %zu)", offset, size); |
| 303 | return false; |
| 304 | } |
| 305 | auto misc_blk_device = get_misc_blk_device(err); |
| 306 | if (misc_blk_device.empty()) { |
| 307 | return false; |
| 308 | } |
| 309 | return write_misc_partition(data, size, misc_blk_device, VENDOR_SPACE_OFFSET_IN_MISC + offset, |
| 310 | err); |
| 311 | } |
| 312 | |
Vineela Tummalapalli | cba7fa8 | 2016-10-28 19:44:40 -0700 | [diff] [blame] | 313 | extern "C" bool write_reboot_bootloader(void) { |
| 314 | std::string err; |
| 315 | return write_reboot_bootloader(&err); |
| 316 | } |
| 317 | |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 318 | extern "C" bool write_bootloader_message(const char* options) { |
| 319 | std::string err; |
Yabin Cui | 8b309f6 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 320 | return write_bootloader_message({options}, &err); |
Yabin Cui | a58a6db | 2016-04-06 15:52:18 -0700 | [diff] [blame] | 321 | } |