Daniel Zheng | 0d30718 | 2023-01-31 21:07:53 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2023 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 | #include "task.h" |
Daniel Zheng | 7627b54 | 2023-04-13 13:43:17 -0700 | [diff] [blame] | 17 | |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 18 | #include <cstddef> |
Daniel Zheng | 47d70a5 | 2023-02-14 17:44:40 +0000 | [diff] [blame] | 19 | #include <iostream> |
Daniel Zheng | 7627b54 | 2023-04-13 13:43:17 -0700 | [diff] [blame] | 20 | |
| 21 | #include <android-base/logging.h> |
| 22 | #include <android-base/parseint.h> |
| 23 | |
Daniel Zheng | 71b3b43 | 2023-01-30 17:43:00 +0000 | [diff] [blame] | 24 | #include "fastboot.h" |
Daniel Zheng | 47d70a5 | 2023-02-14 17:44:40 +0000 | [diff] [blame] | 25 | #include "filesystem.h" |
| 26 | #include "super_flash_helper.h" |
Daniel Zheng | 29a211c | 2023-03-10 07:23:49 +0000 | [diff] [blame] | 27 | #include "util.h" |
Daniel Zheng | 0d30718 | 2023-01-31 21:07:53 +0000 | [diff] [blame] | 28 | |
Daniel Zheng | 47d70a5 | 2023-02-14 17:44:40 +0000 | [diff] [blame] | 29 | using namespace std::string_literals; |
Daniel Zheng | 5a9905a | 2023-05-23 10:51:01 -0700 | [diff] [blame] | 30 | FlashTask::FlashTask(const std::string& slot, const std::string& pname, const std::string& fname, |
Daniel Zheng | 791a83b | 2023-05-23 10:42:39 -0700 | [diff] [blame] | 31 | const bool apply_vbmeta, const FlashingPlan* fp) |
| 32 | : pname_(pname), fname_(fname), slot_(slot), apply_vbmeta_(apply_vbmeta), fp_(fp) {} |
Daniel Zheng | 0d30718 | 2023-01-31 21:07:53 +0000 | [diff] [blame] | 33 | |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 34 | bool FlashTask::IsDynamicParitition(const ImageSource* source, const FlashTask* task) { |
| 35 | std::vector<char> contents; |
| 36 | if (!source->ReadFile("super_empty.img", &contents)) { |
| 37 | return false; |
| 38 | } |
| 39 | auto metadata = android::fs_mgr::ReadFromImageBlob(contents.data(), contents.size()); |
| 40 | return should_flash_in_userspace(*metadata.get(), task->GetPartitionAndSlot()); |
| 41 | } |
| 42 | |
Daniel Zheng | 0d30718 | 2023-01-31 21:07:53 +0000 | [diff] [blame] | 43 | void FlashTask::Run() { |
| 44 | auto flash = [&](const std::string& partition) { |
Daniel Zheng | 376b704 | 2023-08-09 10:52:38 -0700 | [diff] [blame] | 45 | if (should_flash_in_userspace(partition) && !is_userspace_fastboot() && !fp_->force_flash) { |
Daniel Zheng | 0d30718 | 2023-01-31 21:07:53 +0000 | [diff] [blame] | 46 | die("The partition you are trying to flash is dynamic, and " |
| 47 | "should be flashed via fastbootd. Please run:\n" |
| 48 | "\n" |
| 49 | " fastboot reboot fastboot\n" |
| 50 | "\n" |
| 51 | "And try again. If you are intentionally trying to " |
| 52 | "overwrite a fixed partition, use --force."); |
| 53 | } |
Daniel Zheng | 791a83b | 2023-05-23 10:42:39 -0700 | [diff] [blame] | 54 | do_flash(partition.c_str(), fname_.c_str(), apply_vbmeta_, fp_); |
Daniel Zheng | 0d30718 | 2023-01-31 21:07:53 +0000 | [diff] [blame] | 55 | }; |
| 56 | do_for_partitions(pname_, slot_, flash, true); |
| 57 | } |
Daniel Zheng | 71b3b43 | 2023-01-30 17:43:00 +0000 | [diff] [blame] | 58 | |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 59 | std::string FlashTask::ToString() const { |
Daniel Zheng | 665a460 | 2023-06-05 11:24:59 -0700 | [diff] [blame] | 60 | std::string apply_vbmeta_string = ""; |
| 61 | if (apply_vbmeta_) { |
| 62 | apply_vbmeta_string = " --apply_vbmeta"; |
| 63 | } |
| 64 | return "flash" + apply_vbmeta_string + " " + pname_ + " " + fname_; |
| 65 | } |
| 66 | |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 67 | std::string FlashTask::GetPartitionAndSlot() const { |
Daniel Zheng | 29a211c | 2023-03-10 07:23:49 +0000 | [diff] [blame] | 68 | auto slot = slot_; |
| 69 | if (slot.empty()) { |
| 70 | slot = get_current_slot(); |
| 71 | } |
| 72 | if (slot.empty()) { |
| 73 | return pname_; |
| 74 | } |
| 75 | if (slot == "all") { |
| 76 | LOG(FATAL) << "Cannot retrieve a singular name when using all slots"; |
| 77 | } |
| 78 | return pname_ + "_" + slot; |
| 79 | } |
| 80 | |
Daniel Zheng | e6dbd4f | 2023-04-10 09:53:08 -0700 | [diff] [blame] | 81 | RebootTask::RebootTask(const FlashingPlan* fp) : fp_(fp){}; |
| 82 | RebootTask::RebootTask(const FlashingPlan* fp, const std::string& reboot_target) |
Daniel Zheng | 43987c9 | 2023-03-07 18:20:53 +0000 | [diff] [blame] | 83 | : reboot_target_(reboot_target), fp_(fp){}; |
Daniel Zheng | 71b3b43 | 2023-01-30 17:43:00 +0000 | [diff] [blame] | 84 | |
| 85 | void RebootTask::Run() { |
Daniel Zheng | 77af6af | 2023-04-20 14:30:28 -0700 | [diff] [blame] | 86 | if (reboot_target_ == "fastboot") { |
Daniel Zheng | 71b3b43 | 2023-01-30 17:43:00 +0000 | [diff] [blame] | 87 | if (!is_userspace_fastboot()) { |
| 88 | reboot_to_userspace_fastboot(); |
Daniel Zheng | bc01da5 | 2023-02-23 03:25:52 +0000 | [diff] [blame] | 89 | fp_->fb->WaitForDisconnect(); |
Daniel Zheng | 71b3b43 | 2023-01-30 17:43:00 +0000 | [diff] [blame] | 90 | } |
| 91 | } else if (reboot_target_ == "recovery") { |
Daniel Zheng | bc01da5 | 2023-02-23 03:25:52 +0000 | [diff] [blame] | 92 | fp_->fb->RebootTo("recovery"); |
| 93 | fp_->fb->WaitForDisconnect(); |
Daniel Zheng | 71b3b43 | 2023-01-30 17:43:00 +0000 | [diff] [blame] | 94 | } else if (reboot_target_ == "bootloader") { |
Daniel Zheng | bc01da5 | 2023-02-23 03:25:52 +0000 | [diff] [blame] | 95 | fp_->fb->RebootTo("bootloader"); |
| 96 | fp_->fb->WaitForDisconnect(); |
Daniel Zheng | 71b3b43 | 2023-01-30 17:43:00 +0000 | [diff] [blame] | 97 | } else if (reboot_target_ == "") { |
Daniel Zheng | bc01da5 | 2023-02-23 03:25:52 +0000 | [diff] [blame] | 98 | fp_->fb->Reboot(); |
| 99 | fp_->fb->WaitForDisconnect(); |
Daniel Zheng | 71b3b43 | 2023-01-30 17:43:00 +0000 | [diff] [blame] | 100 | } else { |
| 101 | syntax_error("unknown reboot target %s", reboot_target_.c_str()); |
| 102 | } |
| 103 | } |
Daniel Zheng | 47d70a5 | 2023-02-14 17:44:40 +0000 | [diff] [blame] | 104 | |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 105 | std::string RebootTask::ToString() const { |
Daniel Zheng | 665a460 | 2023-06-05 11:24:59 -0700 | [diff] [blame] | 106 | return "reboot " + reboot_target_; |
| 107 | } |
| 108 | |
Daniel Zheng | 3e04857 | 2023-06-21 15:21:06 -0700 | [diff] [blame] | 109 | OptimizedFlashSuperTask::OptimizedFlashSuperTask(const std::string& super_name, |
| 110 | std::unique_ptr<SuperFlashHelper> helper, |
| 111 | SparsePtr sparse_layout, uint64_t super_size, |
| 112 | const FlashingPlan* fp) |
Daniel Zheng | 47d70a5 | 2023-02-14 17:44:40 +0000 | [diff] [blame] | 113 | : super_name_(super_name), |
| 114 | helper_(std::move(helper)), |
David Anderson | 74c7807 | 2023-03-16 21:21:28 -0700 | [diff] [blame] | 115 | sparse_layout_(std::move(sparse_layout)), |
Daniel Zheng | 5769b26 | 2023-06-21 14:41:11 -0700 | [diff] [blame] | 116 | super_size_(super_size), |
| 117 | fp_(fp) {} |
Daniel Zheng | 47d70a5 | 2023-02-14 17:44:40 +0000 | [diff] [blame] | 118 | |
Daniel Zheng | 3e04857 | 2023-06-21 15:21:06 -0700 | [diff] [blame] | 119 | void OptimizedFlashSuperTask::Run() { |
David Anderson | 74c7807 | 2023-03-16 21:21:28 -0700 | [diff] [blame] | 120 | // Use the reported super partition size as the upper limit, rather than |
| 121 | // sparse_file_len, which (1) can fail and (2) is kind of expensive, since |
| 122 | // it will map in all of the embedded fds. |
Daniel Zheng | 47d70a5 | 2023-02-14 17:44:40 +0000 | [diff] [blame] | 123 | std::vector<SparsePtr> files; |
Daniel Zheng | 5769b26 | 2023-06-21 14:41:11 -0700 | [diff] [blame] | 124 | if (int limit = get_sparse_limit(super_size_, fp_)) { |
Daniel Zheng | 47d70a5 | 2023-02-14 17:44:40 +0000 | [diff] [blame] | 125 | files = resparse_file(sparse_layout_.get(), limit); |
| 126 | } else { |
| 127 | files.emplace_back(std::move(sparse_layout_)); |
| 128 | } |
| 129 | |
| 130 | // Send the data to the device. |
| 131 | flash_partition_files(super_name_, files); |
| 132 | } |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 133 | std::string OptimizedFlashSuperTask::ToString() const { |
Daniel Zheng | 665a460 | 2023-06-05 11:24:59 -0700 | [diff] [blame] | 134 | return "optimized-flash-super"; |
| 135 | } |
Daniel Zheng | 47d70a5 | 2023-02-14 17:44:40 +0000 | [diff] [blame] | 136 | |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 137 | // This looks for a block within tasks that has the following pattern [reboot fastboot, |
| 138 | // update-super, $LIST_OF_DYNAMIC_FLASH_TASKS] and returns true if this is found.Theoretically |
| 139 | // this check is just a pattern match and could break if fastboot-info has a bunch of junk commands |
| 140 | // but all devices should pretty much follow this pattern |
| 141 | bool OptimizedFlashSuperTask::CanOptimize(const ImageSource* source, |
| 142 | const std::vector<std::unique_ptr<Task>>& tasks) { |
| 143 | for (size_t i = 0; i < tasks.size(); i++) { |
| 144 | auto reboot_task = tasks[i]->AsRebootTask(); |
| 145 | if (!reboot_task || reboot_task->GetTarget() != "fastboot") { |
| 146 | continue; |
Daniel Zheng | 47d70a5 | 2023-02-14 17:44:40 +0000 | [diff] [blame] | 147 | } |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 148 | // The check for i >= tasks.size() - 2 is because we are peeking two tasks ahead. We need to |
| 149 | // check for an update-super && flash {dynamic_partition} |
| 150 | if (i >= tasks.size() - 2 || !tasks[i + 1]->AsUpdateSuperTask()) { |
| 151 | continue; |
| 152 | } |
| 153 | auto flash_task = tasks[i + 2]->AsFlashTask(); |
| 154 | if (!FlashTask::IsDynamicParitition(source, flash_task)) { |
| 155 | continue; |
| 156 | } |
| 157 | return true; |
Daniel Zheng | 47d70a5 | 2023-02-14 17:44:40 +0000 | [diff] [blame] | 158 | } |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 159 | return false; |
Daniel Zheng | 47d70a5 | 2023-02-14 17:44:40 +0000 | [diff] [blame] | 160 | } |
Daniel Zheng | 6bb8baa | 2023-03-03 07:14:23 +0000 | [diff] [blame] | 161 | |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 162 | std::unique_ptr<OptimizedFlashSuperTask> OptimizedFlashSuperTask::Initialize( |
Daniel Zheng | 29a211c | 2023-03-10 07:23:49 +0000 | [diff] [blame] | 163 | const FlashingPlan* fp, std::vector<std::unique_ptr<Task>>& tasks) { |
Daniel Zheng | d62002c | 2023-06-21 14:27:35 -0700 | [diff] [blame] | 164 | if (!fp->should_optimize_flash_super) { |
| 165 | LOG(INFO) << "super optimization is disabled"; |
| 166 | return nullptr; |
| 167 | } |
Daniel Zheng | 29a211c | 2023-03-10 07:23:49 +0000 | [diff] [blame] | 168 | if (!supports_AB()) { |
| 169 | LOG(VERBOSE) << "Cannot optimize flashing super on non-AB device"; |
| 170 | return nullptr; |
| 171 | } |
| 172 | if (fp->slot_override == "all") { |
| 173 | LOG(VERBOSE) << "Cannot optimize flashing super for all slots"; |
| 174 | return nullptr; |
| 175 | } |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 176 | if (!CanOptimize(fp->source, tasks)) { |
| 177 | return nullptr; |
| 178 | } |
Daniel Zheng | 29a211c | 2023-03-10 07:23:49 +0000 | [diff] [blame] | 179 | |
| 180 | // Does this device use dynamic partitions at all? |
| 181 | unique_fd fd = fp->source->OpenFile("super_empty.img"); |
| 182 | |
| 183 | if (fd < 0) { |
| 184 | LOG(VERBOSE) << "could not open super_empty.img"; |
| 185 | return nullptr; |
| 186 | } |
| 187 | |
| 188 | std::string super_name; |
| 189 | // Try to find whether there is a super partition. |
| 190 | if (fp->fb->GetVar("super-partition-name", &super_name) != fastboot::SUCCESS) { |
| 191 | super_name = "super"; |
| 192 | } |
| 193 | uint64_t partition_size; |
| 194 | std::string partition_size_str; |
| 195 | if (fp->fb->GetVar("partition-size:" + super_name, &partition_size_str) != fastboot::SUCCESS) { |
| 196 | LOG(VERBOSE) << "Cannot optimize super flashing: could not determine super partition"; |
| 197 | return nullptr; |
| 198 | } |
| 199 | partition_size_str = fb_fix_numeric_var(partition_size_str); |
| 200 | if (!android::base::ParseUint(partition_size_str, &partition_size)) { |
| 201 | LOG(VERBOSE) << "Could not parse " << super_name << " size: " << partition_size_str; |
| 202 | return nullptr; |
| 203 | } |
| 204 | |
| 205 | std::unique_ptr<SuperFlashHelper> helper = std::make_unique<SuperFlashHelper>(*fp->source); |
| 206 | if (!helper->Open(fd)) { |
| 207 | return nullptr; |
| 208 | } |
| 209 | |
| 210 | for (const auto& task : tasks) { |
| 211 | if (auto flash_task = task->AsFlashTask()) { |
Daniel Zheng | 2775df6 | 2023-05-25 15:14:59 -0700 | [diff] [blame] | 212 | auto partition = flash_task->GetPartitionAndSlot(); |
| 213 | if (!helper->AddPartition(partition, flash_task->GetImageName(), false)) { |
| 214 | return nullptr; |
Daniel Zheng | 29a211c | 2023-03-10 07:23:49 +0000 | [diff] [blame] | 215 | } |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | auto s = helper->GetSparseLayout(); |
| 220 | if (!s) return nullptr; |
| 221 | // Remove images that we already flashed, just in case we have non-dynamic OS images. |
| 222 | auto remove_if_callback = [&](const auto& task) -> bool { |
| 223 | if (auto flash_task = task->AsFlashTask()) { |
| 224 | return helper->WillFlash(flash_task->GetPartitionAndSlot()); |
| 225 | } else if (auto update_super_task = task->AsUpdateSuperTask()) { |
| 226 | return true; |
| 227 | } else if (auto reboot_task = task->AsRebootTask()) { |
| 228 | return true; |
| 229 | } |
| 230 | return false; |
| 231 | }; |
| 232 | tasks.erase(std::remove_if(tasks.begin(), tasks.end(), remove_if_callback), tasks.end()); |
| 233 | |
Daniel Zheng | 3e04857 | 2023-06-21 15:21:06 -0700 | [diff] [blame] | 234 | return std::make_unique<OptimizedFlashSuperTask>(super_name, std::move(helper), std::move(s), |
| 235 | partition_size, fp); |
Daniel Zheng | 29a211c | 2023-03-10 07:23:49 +0000 | [diff] [blame] | 236 | } |
| 237 | |
Daniel Zheng | e6dbd4f | 2023-04-10 09:53:08 -0700 | [diff] [blame] | 238 | UpdateSuperTask::UpdateSuperTask(const FlashingPlan* fp) : fp_(fp) {} |
Daniel Zheng | 6bb8baa | 2023-03-03 07:14:23 +0000 | [diff] [blame] | 239 | |
| 240 | void UpdateSuperTask::Run() { |
| 241 | unique_fd fd = fp_->source->OpenFile("super_empty.img"); |
| 242 | if (fd < 0) { |
| 243 | return; |
| 244 | } |
| 245 | if (!is_userspace_fastboot()) { |
| 246 | reboot_to_userspace_fastboot(); |
| 247 | } |
| 248 | |
| 249 | std::string super_name; |
| 250 | if (fp_->fb->GetVar("super-partition-name", &super_name) != fastboot::RetCode::SUCCESS) { |
| 251 | super_name = "super"; |
| 252 | } |
| 253 | fp_->fb->Download(super_name, fd, get_file_size(fd)); |
| 254 | |
| 255 | std::string command = "update-super:" + super_name; |
| 256 | if (fp_->wants_wipe) { |
| 257 | command += ":wipe"; |
| 258 | } |
| 259 | fp_->fb->RawCommand(command, "Updating super partition"); |
| 260 | } |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 261 | std::string UpdateSuperTask::ToString() const { |
Daniel Zheng | 665a460 | 2023-06-05 11:24:59 -0700 | [diff] [blame] | 262 | return "update-super"; |
| 263 | } |
Daniel Zheng | 9f7bf7e | 2023-03-03 07:16:46 +0000 | [diff] [blame] | 264 | |
Daniel Zheng | e6dbd4f | 2023-04-10 09:53:08 -0700 | [diff] [blame] | 265 | ResizeTask::ResizeTask(const FlashingPlan* fp, const std::string& pname, const std::string& size, |
Daniel Zheng | 9f7bf7e | 2023-03-03 07:16:46 +0000 | [diff] [blame] | 266 | const std::string& slot) |
| 267 | : fp_(fp), pname_(pname), size_(size), slot_(slot) {} |
| 268 | |
| 269 | void ResizeTask::Run() { |
| 270 | auto resize_partition = [this](const std::string& partition) -> void { |
| 271 | if (is_logical(partition)) { |
| 272 | fp_->fb->ResizePartition(partition, size_); |
| 273 | } |
| 274 | }; |
| 275 | do_for_partitions(pname_, slot_, resize_partition, false); |
| 276 | } |
Daniel Zheng | aa70f4c | 2023-03-07 18:59:51 +0000 | [diff] [blame] | 277 | |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 278 | std::string ResizeTask::ToString() const { |
Daniel Zheng | 665a460 | 2023-06-05 11:24:59 -0700 | [diff] [blame] | 279 | return "resize " + pname_; |
| 280 | } |
| 281 | |
Daniel Zheng | e6dbd4f | 2023-04-10 09:53:08 -0700 | [diff] [blame] | 282 | DeleteTask::DeleteTask(const FlashingPlan* fp, const std::string& pname) : fp_(fp), pname_(pname){}; |
Daniel Zheng | aa70f4c | 2023-03-07 18:59:51 +0000 | [diff] [blame] | 283 | |
| 284 | void DeleteTask::Run() { |
| 285 | fp_->fb->DeletePartition(pname_); |
Daniel Zheng | 15e7783 | 2023-03-13 17:09:43 +0000 | [diff] [blame] | 286 | } |
| 287 | |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 288 | std::string DeleteTask::ToString() const { |
Daniel Zheng | 665a460 | 2023-06-05 11:24:59 -0700 | [diff] [blame] | 289 | return "delete " + pname_; |
| 290 | } |
| 291 | |
Daniel Zheng | e6dbd4f | 2023-04-10 09:53:08 -0700 | [diff] [blame] | 292 | WipeTask::WipeTask(const FlashingPlan* fp, const std::string& pname) : fp_(fp), pname_(pname){}; |
Daniel Zheng | 15e7783 | 2023-03-13 17:09:43 +0000 | [diff] [blame] | 293 | |
| 294 | void WipeTask::Run() { |
| 295 | std::string partition_type; |
| 296 | if (fp_->fb->GetVar("partition-type:" + pname_, &partition_type) != fastboot::SUCCESS) { |
Daniel Zheng | 6f213b2 | 2023-03-28 22:47:04 +0000 | [diff] [blame] | 297 | LOG(ERROR) << "wipe task partition not found: " << pname_; |
Daniel Zheng | 15e7783 | 2023-03-13 17:09:43 +0000 | [diff] [blame] | 298 | return; |
| 299 | } |
| 300 | if (partition_type.empty()) return; |
Daniel Zheng | 6f213b2 | 2023-03-28 22:47:04 +0000 | [diff] [blame] | 301 | if (fp_->fb->Erase(pname_) != fastboot::SUCCESS) { |
| 302 | LOG(ERROR) << "wipe task erase failed with partition: " << pname_; |
| 303 | return; |
| 304 | } |
Daniel Zheng | 5769b26 | 2023-06-21 14:41:11 -0700 | [diff] [blame] | 305 | fb_perform_format(pname_, 1, partition_type, "", fp_->fs_options, fp_); |
Daniel Zheng | 15e7783 | 2023-03-13 17:09:43 +0000 | [diff] [blame] | 306 | } |
Daniel Zheng | 665a460 | 2023-06-05 11:24:59 -0700 | [diff] [blame] | 307 | |
Daniel Zheng | 1ef66b7 | 2023-08-24 15:44:56 -0700 | [diff] [blame^] | 308 | std::string WipeTask::ToString() const { |
Daniel Zheng | 665a460 | 2023-06-05 11:24:59 -0700 | [diff] [blame] | 309 | return "erase " + pname_; |
| 310 | } |