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

Commit 008b0338 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9914775 from 46df2590 to udc-release

Change-Id: I06108969184a867cad8c36202bcb74384ec7b0e6
parents ff8263f1 46df2590
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -190,6 +190,7 @@ static void print_backtrace(CallbackType callback, const Tombstone& tombstone,
static void print_thread_backtrace(CallbackType callback, const Tombstone& tombstone,
                                   const Thread& thread, bool should_log) {
  CBS("");
  CB(should_log, "%d total frames", thread.current_backtrace().size());
  CB(should_log, "backtrace:");
  if (!thread.backtrace_note().empty()) {
    CB(should_log, "  NOTE: %s",
+28 −25
Original line number Diff line number Diff line
@@ -1600,10 +1600,10 @@ void FlashAllTool::Flash() {

    // Change the slot first, so we boot into the correct recovery image when
    // using fastbootd.
    if (fp_->slot == "all") {
    if (fp_->slot_override == "all") {
        set_active("a");
    } else {
        set_active(fp_->slot);
        set_active(fp_->slot_override);
    }

    DetermineSlot();
@@ -1654,17 +1654,17 @@ void FlashAllTool::CheckRequirements() {
}

void FlashAllTool::DetermineSlot() {
    if (fp_->slot.empty()) {
    if (fp_->slot_override.empty()) {
        fp_->current_slot = get_current_slot();
    } else {
        fp_->current_slot = fp_->slot;
        fp_->current_slot = fp_->slot_override;
    }

    if (fp_->skip_secondary) {
        return;
    }
    if (fp_->slot != "" && fp_->slot != "all") {
        fp_->secondary_slot = get_other_slot(fp_->slot);
    if (fp_->slot_override != "" && fp_->slot_override != "all") {
        fp_->secondary_slot = get_other_slot(fp_->slot_override);
    } else {
        fp_->secondary_slot = get_other_slot();
    }
@@ -1678,7 +1678,7 @@ void FlashAllTool::DetermineSlot() {

void FlashAllTool::CollectImages() {
    for (size_t i = 0; i < images.size(); ++i) {
        std::string slot = fp_->slot;
        std::string slot = fp_->slot_override;
        if (images[i].IsSecondary()) {
            if (fp_->skip_secondary) {
                continue;
@@ -2017,7 +2017,6 @@ int FastBootTool::Main(int argc, char* argv[]) {
    std::unique_ptr<FlashingPlan> fp = std::make_unique<FlashingPlan>();

    int longindex;
    std::string slot_override;
    std::string next_active;

    g_boot_img_hdr.kernel_addr = 0x00008000;
@@ -2090,7 +2089,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
            } else if (name == "skip-secondary") {
                fp->skip_secondary = true;
            } else if (name == "slot") {
                slot_override = optarg;
                fp->slot_override = optarg;
            } else if (name == "dtb-offset") {
                g_boot_img_hdr.dtb_addr = strtoul(optarg, 0, 16);
            } else if (name == "tags-offset") {
@@ -2182,12 +2181,12 @@ int FastBootTool::Main(int argc, char* argv[]) {

    const double start = now();

    if (slot_override != "") slot_override = verify_slot(slot_override);
    if (fp->slot_override != "") fp->slot_override = verify_slot(fp->slot_override);
    if (next_active != "") next_active = verify_slot(next_active, false);

    if (fp->wants_set_active) {
        if (next_active == "") {
            if (slot_override == "") {
            if (fp->slot_override == "") {
                std::string current_slot;
                if (fb->GetVar("current-slot", &current_slot) == fastboot::SUCCESS) {
                    if (current_slot[0] == '_') current_slot.erase(0, 1);
@@ -2196,7 +2195,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
                    fp->wants_set_active = false;
                }
            } else {
                next_active = verify_slot(slot_override, false);
                next_active = verify_slot(fp->slot_override, false);
            }
        }
    }
@@ -2221,7 +2220,7 @@ int FastBootTool::Main(int argc, char* argv[]) {

                fb->Erase(partition);
            };
            do_for_partitions(partition, slot_override, erase, true);
            do_for_partitions(partition, fp->slot_override, erase, true);
        } else if (android::base::StartsWith(command, "format")) {
            // Parsing for: "format[:[type][:[size]]]"
            // Some valid things:
@@ -2241,7 +2240,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
            auto format = [&](const std::string& partition) {
                fb_perform_format(partition, 0, type_override, size_override, fp->fs_options);
            };
            do_for_partitions(partition, slot_override, format, true);
            do_for_partitions(partition, fp->slot_override, format, true);
        } else if (command == "signature") {
            std::string filename = next_arg(&args);
            std::vector<char> data;
@@ -2255,7 +2254,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
            if (args.size() == 1) {
                std::string reboot_target = next_arg(&args);
                reboot_task = std::make_unique<RebootTask>(fp.get(), reboot_target);
            } else {
            } else if (!fp->skip_reboot) {
                reboot_task = std::make_unique<RebootTask>(fp.get());
            }
            if (!args.empty()) syntax_error("junk after reboot command");
@@ -2286,7 +2285,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
            }
            if (fname.empty()) die("cannot determine image filename for '%s'", pname.c_str());

            FlashTask task(slot_override, pname, fname, is_vbmeta_partition(pname));
            FlashTask task(fp->slot_override, pname, fname, is_vbmeta_partition(pname));
            task.Run();
        } else if (command == "flash:raw") {
            std::string partition = next_arg(&args);
@@ -2300,9 +2299,9 @@ int FastBootTool::Main(int argc, char* argv[]) {
            auto flashraw = [&data](const std::string& partition) {
                fb->FlashPartition(partition, data);
            };
            do_for_partitions(partition, slot_override, flashraw, true);
            do_for_partitions(partition, fp->slot_override, flashraw, true);
        } else if (command == "flashall") {
            if (slot_override == "all") {
            if (fp->slot_override == "all") {
                fprintf(stderr,
                        "Warning: slot set to 'all'. Secondary slots will not be flashed.\n");
                fp->skip_secondary = true;
@@ -2310,9 +2309,11 @@ int FastBootTool::Main(int argc, char* argv[]) {
            } else {
                do_flashall(fp.get());
            }
            if (!fp->skip_reboot) {
                reboot_task = std::make_unique<RebootTask>(fp.get());
            }
        } else if (command == "update") {
            bool slot_all = (slot_override == "all");
            bool slot_all = (fp->slot_override == "all");
            if (slot_all) {
                fprintf(stderr,
                        "Warning: slot set to 'all'. Secondary slots will not be flashed.\n");
@@ -2322,7 +2323,9 @@ int FastBootTool::Main(int argc, char* argv[]) {
                filename = next_arg(&args);
            }
            do_update(filename.c_str(), fp.get());
            if (!fp->skip_reboot) {
                reboot_task = std::make_unique<RebootTask>(fp.get());
            }
        } else if (command == FB_CMD_SET_ACTIVE) {
            std::string slot = verify_slot(next_arg(&args), false);
            fb->SetActive(slot);
@@ -2361,7 +2364,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
            std::string partition = next_arg(&args);
            std::string size = next_arg(&args);
            std::unique_ptr<ResizeTask> resize_task =
                    std::make_unique<ResizeTask>(fp.get(), partition, size, slot_override);
                    std::make_unique<ResizeTask>(fp.get(), partition, size, fp->slot_override);
            resize_task->Run();
        } else if (command == "gsi") {
            std::string arg = next_arg(&args);
@@ -2379,7 +2382,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
            } else {
                image = next_arg(&args);
            }
            do_wipe_super(image, slot_override);
            do_wipe_super(image, fp->slot_override);
        } else if (command == "snapshot-update") {
            std::string arg;
            if (!args.empty()) {
@@ -2392,7 +2395,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
        } else if (command == FB_CMD_FETCH) {
            std::string partition = next_arg(&args);
            std::string outfile = next_arg(&args);
            do_fetch(partition, slot_override, outfile);
            do_fetch(partition, fp->slot_override, outfile);
        } else {
            syntax_error("unknown command %s", command.c_str());
        }
@@ -2411,7 +2414,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
    if (fp->wants_set_active) {
        fb->SetActive(next_active);
    }
    if (reboot_task && !fp->skip_reboot) {
    if (reboot_task) {
        reboot_task->Run();
    }
    fprintf(stderr, "Finished. Total time: %.3fs\n", (now() - start));
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ struct FlashingPlan {
    bool skip_secondary = false;
    bool force_flash = false;

    std::string slot;
    std::string slot_override;
    std::string current_slot;
    std::string secondary_slot;
    fastboot::FastBootDriver* fb;
+7 −7
Original line number Diff line number Diff line
@@ -42,8 +42,8 @@ void FlashTask::Run() {
    do_for_partitions(pname_, slot_, flash, true);
}

RebootTask::RebootTask(FlashingPlan* fp) : fp_(fp){};
RebootTask::RebootTask(FlashingPlan* fp, const std::string& reboot_target)
RebootTask::RebootTask(const FlashingPlan* fp) : fp_(fp){};
RebootTask::RebootTask(const FlashingPlan* fp, const std::string& reboot_target)
    : reboot_target_(reboot_target), fp_(fp){};

void RebootTask::Run() {
@@ -95,7 +95,7 @@ std::unique_ptr<FlashSuperLayoutTask> FlashSuperLayoutTask::Initialize(
        LOG(VERBOSE) << "Cannot optimize flashing super on non-AB device";
        return nullptr;
    }
    if (fp->slot == "all") {
    if (fp->slot_override == "all") {
        LOG(VERBOSE) << "Cannot optimize flashing super for all slots";
        return nullptr;
    }
@@ -153,7 +153,7 @@ std::unique_ptr<FlashSuperLayoutTask> FlashSuperLayoutTask::Initialize(
                                                  partition_size);
}

UpdateSuperTask::UpdateSuperTask(FlashingPlan* fp) : fp_(fp) {}
UpdateSuperTask::UpdateSuperTask(const FlashingPlan* fp) : fp_(fp) {}

void UpdateSuperTask::Run() {
    unique_fd fd = fp_->source->OpenFile("super_empty.img");
@@ -177,7 +177,7 @@ void UpdateSuperTask::Run() {
    fp_->fb->RawCommand(command, "Updating super partition");
}

ResizeTask::ResizeTask(FlashingPlan* fp, const std::string& pname, const std::string& size,
ResizeTask::ResizeTask(const FlashingPlan* fp, const std::string& pname, const std::string& size,
                       const std::string& slot)
    : fp_(fp), pname_(pname), size_(size), slot_(slot) {}

@@ -190,13 +190,13 @@ void ResizeTask::Run() {
    do_for_partitions(pname_, slot_, resize_partition, false);
}

DeleteTask::DeleteTask(FlashingPlan* fp, const std::string& pname) : fp_(fp), pname_(pname){};
DeleteTask::DeleteTask(const FlashingPlan* fp, const std::string& pname) : fp_(fp), pname_(pname){};

void DeleteTask::Run() {
    fp_->fb->DeletePartition(pname_);
}

WipeTask::WipeTask(FlashingPlan* fp, const std::string& pname) : fp_(fp), pname_(pname){};
WipeTask::WipeTask(const FlashingPlan* fp, const std::string& pname) : fp_(fp), pname_(pname){};

void WipeTask::Run() {
    std::string partition_type;
+6 −6
Original line number Diff line number Diff line
@@ -46,8 +46,8 @@ class FlashTask : public Task {

class RebootTask : public Task {
  public:
    RebootTask(FlashingPlan* fp);
    RebootTask(FlashingPlan* fp, const std::string& reboot_target);
    RebootTask(const FlashingPlan* fp);
    RebootTask(const FlashingPlan* fp, const std::string& reboot_target);
    void Run() override;

  private:
@@ -73,7 +73,7 @@ class FlashSuperLayoutTask : public Task {

class UpdateSuperTask : public Task {
  public:
    UpdateSuperTask(FlashingPlan* fp);
    UpdateSuperTask(const FlashingPlan* fp);
    void Run() override;

  private:
@@ -82,7 +82,7 @@ class UpdateSuperTask : public Task {

class ResizeTask : public Task {
  public:
    ResizeTask(FlashingPlan* fp, const std::string& pname, const std::string& size,
    ResizeTask(const FlashingPlan* fp, const std::string& pname, const std::string& size,
               const std::string& slot);
    void Run() override;

@@ -95,7 +95,7 @@ class ResizeTask : public Task {

class DeleteTask : public Task {
  public:
    DeleteTask(FlashingPlan* _fp, const std::string& _pname);
    DeleteTask(const FlashingPlan* _fp, const std::string& _pname);
    void Run() override;

  private:
@@ -105,7 +105,7 @@ class DeleteTask : public Task {

class WipeTask : public Task {
  public:
    WipeTask(FlashingPlan* fp, const std::string& pname);
    WipeTask(const FlashingPlan* fp, const std::string& pname);
    void Run() override;

  private: