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

Commit 62051237 authored by Chun-Wei Wang's avatar Chun-Wei Wang Committed by Gerrit Code Review
Browse files

Merge "Add a fastboot command to show GSI status" into main

parents f667b6d8 671a2a55
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -661,6 +661,17 @@ bool GsiHandler(FastbootDevice* device, const std::vector<std::string>& args) {
        if (!android::gsi::DisableGsi()) {
            return device->WriteStatus(FastbootResult::FAIL, strerror(errno));
        }
    } else if (args[1] == "status") {
        std::string active_dsu;
        if (!android::gsi::IsGsiRunning()) {
            device->WriteInfo("Not running");
        } else if (!android::gsi::GetActiveDsu(&active_dsu)) {
            return device->WriteFail(strerror(errno));
        } else {
            device->WriteInfo("Running active DSU: " + active_dsu);
        }
    } else {
        return device->WriteFail("Invalid arguments");
    }
    return device->WriteStatus(FastbootResult::OKAY, "Success");
}
+5 −7
Original line number Diff line number Diff line
@@ -2573,14 +2573,12 @@ int FastBootTool::Main(int argc, char* argv[]) {
                    std::make_unique<ResizeTask>(fp.get(), partition, size, fp->slot_override);
            resize_task->Run();
        } else if (command == "gsi") {
            std::string arg = next_arg(&args);
            if (arg == "wipe") {
                fb->RawCommand("gsi:wipe", "wiping GSI");
            } else if (arg == "disable") {
                fb->RawCommand("gsi:disable", "disabling GSI");
            } else {
                syntax_error("expected 'wipe' or 'disable'");
            if (args.empty()) syntax_error("invalid gsi command");
            std::string cmd("gsi");
            while (!args.empty()) {
                cmd += ":" + next_arg(&args);
            }
            fb->RawCommand(cmd, "");
        } else if (command == "wipe-super") {
            std::string image;
            if (args.empty()) {