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

Commit 727f7014 authored by Daniel Zheng's avatar Daniel Zheng Committed by Automerger Merge Worker
Browse files

Merge "Adding flag to flash only static partitions" into main am: 720007ba

parents bf51390a 720007ba
Loading
Loading
Loading
Loading
+17 −1
Original line number Original line Diff line number Diff line
@@ -1801,6 +1801,7 @@ void FlashAllTool::Flash() {
    CancelSnapshotIfNeeded();
    CancelSnapshotIfNeeded();


    tasks_ = CollectTasks();
    tasks_ = CollectTasks();

    for (auto& task : tasks_) {
    for (auto& task : tasks_) {
        task->Run();
        task->Run();
    }
    }
@@ -1815,7 +1816,18 @@ std::vector<std::unique_ptr<Task>> FlashAllTool::CollectTasks() {
    } else {
    } else {
        tasks = CollectTasksFromImageList();
        tasks = CollectTasksFromImageList();
    }
    }

    if (fp_->exclude_dynamic_partitions) {
        auto is_non_static_flash_task = [](const auto& task) -> bool {
            if (auto flash_task = task->AsFlashTask()) {
                if (!should_flash_in_userspace(flash_task->GetPartitionAndSlot())) {
                    return false;
                }
            }
            return true;
        };
        tasks.erase(std::remove_if(tasks.begin(), tasks.end(), is_non_static_flash_task),
                    tasks.end());
    }
    return tasks;
    return tasks;
}
}


@@ -2219,6 +2231,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
                                      {"disable-verification", no_argument, 0, 0},
                                      {"disable-verification", no_argument, 0, 0},
                                      {"disable-verity", no_argument, 0, 0},
                                      {"disable-verity", no_argument, 0, 0},
                                      {"disable-super-optimization", no_argument, 0, 0},
                                      {"disable-super-optimization", no_argument, 0, 0},
                                      {"exclude-dynamic-partitions", no_argument, 0, 0},
                                      {"disable-fastboot-info", no_argument, 0, 0},
                                      {"disable-fastboot-info", no_argument, 0, 0},
                                      {"force", no_argument, 0, 0},
                                      {"force", no_argument, 0, 0},
                                      {"fs-options", required_argument, 0, 0},
                                      {"fs-options", required_argument, 0, 0},
@@ -2260,6 +2273,9 @@ int FastBootTool::Main(int argc, char* argv[]) {
                g_disable_verity = true;
                g_disable_verity = true;
            } else if (name == "disable-super-optimization") {
            } else if (name == "disable-super-optimization") {
                fp->should_optimize_flash_super = false;
                fp->should_optimize_flash_super = false;
            } else if (name == "exclude-dynamic-partitions") {
                fp->exclude_dynamic_partitions = true;
                fp->should_optimize_flash_super = false;
            } else if (name == "disable-fastboot-info") {
            } else if (name == "disable-fastboot-info") {
                fp->should_use_fastboot_info = false;
                fp->should_use_fastboot_info = false;
            } else if (name == "force") {
            } else if (name == "force") {
+1 −0
Original line number Original line Diff line number Diff line
@@ -99,6 +99,7 @@ struct FlashingPlan {
    bool force_flash = false;
    bool force_flash = false;
    bool should_optimize_flash_super = true;
    bool should_optimize_flash_super = true;
    bool should_use_fastboot_info = true;
    bool should_use_fastboot_info = true;
    bool exclude_dynamic_partitions = false;
    uint64_t sparse_limit = 0;
    uint64_t sparse_limit = 0;


    std::string slot_override;
    std::string slot_override;