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

Commit 33da5c94 authored by Bowgo Tsai's avatar Bowgo Tsai
Browse files

fastbootd: exporting CPU ABI info

CPU ABI info, e.g., arm64-v8a, can be useful to determine image
compatibility, prior to flash. Adding this info in fastbootd.

Bug: 74445765
Test: fastboot getvar cpu-abi # arm64-v8a
Change-Id: Ied494b646c551320295956b7890c0102fdb88382
parent 563a73e7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -68,3 +68,4 @@
#define FB_VAR_BATTERY_SOC_OK "battery-soc-ok"
#define FB_VAR_SUPER_PARTITION_NAME "super-partition-name"
#define FB_VAR_SNAPSHOT_UPDATE_STATUS "snapshot-update-status"
#define FB_VAR_CPU_ABI "cpu-abi"
+2 −1
Original line number Diff line number Diff line
@@ -105,7 +105,8 @@ bool GetVarHandler(FastbootDevice* device, const std::vector<std::string>& args)
            {FB_VAR_BATTERY_SOC_OK, {GetBatterySoCOk, nullptr}},
            {FB_VAR_HW_REVISION, {GetHardwareRevision, nullptr}},
            {FB_VAR_SUPER_PARTITION_NAME, {GetSuperPartitionName, nullptr}},
            {FB_VAR_SNAPSHOT_UPDATE_STATUS, {GetSnapshotUpdateStatus, nullptr}}};
            {FB_VAR_SNAPSHOT_UPDATE_STATUS, {GetSnapshotUpdateStatus, nullptr}},
            {FB_VAR_CPU_ABI, {GetCpuAbi, nullptr}}};

    if (args.size() < 2) {
        return device->WriteFail("Missing argument");
+6 −0
Original line number Diff line number Diff line
@@ -458,3 +458,9 @@ bool GetSnapshotUpdateStatus(FastbootDevice* device, const std::vector<std::stri
    }
    return true;
}

bool GetCpuAbi(FastbootDevice* /* device */, const std::vector<std::string>& /* args */,
               std::string* message) {
    *message = android::base::GetProperty("ro.product.cpu.abi", "");
    return true;
}
+1 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ bool GetSuperPartitionName(FastbootDevice* device, const std::vector<std::string
                           std::string* message);
bool GetSnapshotUpdateStatus(FastbootDevice* device, const std::vector<std::string>& args,
                             std::string* message);
bool GetCpuAbi(FastbootDevice* device, const std::vector<std::string>& args, std::string* message);

// Helpers for getvar all.
std::vector<std::vector<std::string>> GetAllPartitionArgsWithSlot(FastbootDevice* device);