Lines Matching refs:misc_blk_device
75 static bool read_misc_partition(void* p, size_t size, const std::string& misc_blk_device, in read_misc_partition() argument
77 if (!wait_for_device(misc_blk_device, err)) { in read_misc_partition()
80 android::base::unique_fd fd(open(misc_blk_device.c_str(), O_RDONLY)); in read_misc_partition()
82 *err = android::base::StringPrintf("failed to open %s: %s", misc_blk_device.c_str(), in read_misc_partition()
87 *err = android::base::StringPrintf("failed to lseek %s: %s", misc_blk_device.c_str(), in read_misc_partition()
92 *err = android::base::StringPrintf("failed to read %s: %s", misc_blk_device.c_str(), in read_misc_partition()
99 static bool write_misc_partition(const void* p, size_t size, const std::string& misc_blk_device, in write_misc_partition() argument
101 android::base::unique_fd fd(open(misc_blk_device.c_str(), O_WRONLY)); in write_misc_partition()
103 *err = android::base::StringPrintf("failed to open %s: %s", misc_blk_device.c_str(), in write_misc_partition()
108 *err = android::base::StringPrintf("failed to lseek %s: %s", misc_blk_device.c_str(), in write_misc_partition()
113 *err = android::base::StringPrintf("failed to write %s: %s", misc_blk_device.c_str(), in write_misc_partition()
118 *err = android::base::StringPrintf("failed to fsync %s: %s", misc_blk_device.c_str(), in write_misc_partition()
126 std::string misc_blk_device = get_misc_blk_device(err); in get_bootloader_message_blk_device() local
127 if (misc_blk_device.empty()) return ""; in get_bootloader_message_blk_device()
128 if (!wait_for_device(misc_blk_device, err)) return ""; in get_bootloader_message_blk_device()
129 return misc_blk_device; in get_bootloader_message_blk_device()
132 bool read_bootloader_message_from(bootloader_message* boot, const std::string& misc_blk_device, in read_bootloader_message_from() argument
134 return read_misc_partition(boot, sizeof(*boot), misc_blk_device, in read_bootloader_message_from()
139 std::string misc_blk_device = get_misc_blk_device(err); in read_bootloader_message() local
140 if (misc_blk_device.empty()) { in read_bootloader_message()
143 return read_bootloader_message_from(boot, misc_blk_device, err); in read_bootloader_message()
146 bool read_bootloader_control_from(bootloader_control* boot_ctrl, const std::string& misc_blk_device, in read_bootloader_control_from() argument
148 return read_misc_partition(boot_ctrl, sizeof(bootloader_control), misc_blk_device, in read_bootloader_control_from()
152 bool write_bootloader_message_to(const bootloader_message& boot, const std::string& misc_blk_device, in write_bootloader_message_to() argument
154 return write_misc_partition(&boot, sizeof(boot), misc_blk_device, in write_bootloader_message_to()
159 std::string misc_blk_device = get_misc_blk_device(err); in write_bootloader_message() local
160 if (misc_blk_device.empty()) { in write_bootloader_message()
163 return write_bootloader_message_to(boot, misc_blk_device, err); in write_bootloader_message()
166 …rite_bootloader_control_to(const bootloader_control* boot_ctrl, const std::string& misc_blk_device, in write_bootloader_control_to() argument
168 return write_misc_partition(boot_ctrl, sizeof(bootloader_control), misc_blk_device, in write_bootloader_control_to()
226 std::string misc_blk_device = get_misc_blk_device(err); in read_wipe_package() local
227 if (misc_blk_device.empty()) { in read_wipe_package()
231 return read_misc_partition(&(*package_data)[0], size, misc_blk_device, in read_wipe_package()
236 std::string misc_blk_device = get_misc_blk_device(err); in write_wipe_package() local
237 if (misc_blk_device.empty()) { in write_wipe_package()
240 return write_misc_partition(package_data.data(), package_data.size(), misc_blk_device, in write_wipe_package()