Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 303fb49c authored by Daniel Zheng's avatar Daniel Zheng
Browse files

Adding in wipe tasks before other tasks run.

if we call -w and a reboot task runs beforehand, we don't actually wipe
the given partitions. We want the wipe to occur before reboots.

Test: fastboot flashall -w
Change-Id: If327c5de0858e222cf5fc14531bc20fb741c2960
parent 507c5f94
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2583,10 +2583,13 @@ int FastBootTool::Main(int argc, char* argv[]) {
        if (fp->force_flash) {
            CancelSnapshotIfNeeded();
        }
        std::vector<std::unique_ptr<Task>> wipe_tasks;
        std::vector<std::string> partitions = {"userdata", "cache", "metadata"};
        for (const auto& partition : partitions) {
            tasks.emplace_back(std::make_unique<WipeTask>(fp.get(), partition));
            wipe_tasks.emplace_back(std::make_unique<WipeTask>(fp.get(), partition));
        }
        tasks.insert(tasks.begin(), std::make_move_iterator(wipe_tasks.begin()),
                     std::make_move_iterator(wipe_tasks.end()));
    }
    if (fp->wants_set_active) {
        fb->SetActive(next_active);