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

Commit 6be7351b authored by Yi-Yo Chiang's avatar Yi-Yo Chiang
Browse files

remount: Don't assert ro.boot.vbmeta.* properties

ro.boot.vbmeta.* properties could be missing if device is verification
disabled.
Instead use ro.boot.verifiedbootstate to check device locked state.
No need to check ro.boot.vbmeta.digest, as we no longer support VB1.0.
In other words, all device running this piece of code must be using AVB.

Bug: 241688845
Test: adb-remount-test
Change-Id: If5d702ab3a6f12deef8204dba698e6c62eaae46f
parent 99ec013d
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -622,7 +622,7 @@ int main(int argc, char* argv[]) {
        return 1;
    }

    if (android::base::GetProperty("ro.boot.vbmeta.device_state", "") == "locked") {
    if (android::base::GetProperty("ro.boot.verifiedbootstate", "") != "orange") {
        LOG(ERROR) << "Device must be bootloader unlocked";
        return 1;
    }
@@ -632,14 +632,6 @@ int main(int argc, char* argv[]) {
    android::ProcessState::self()->startThreadPool();

    if (!remount) {
        // Figure out if we're using VB1.0 or VB2.0 (aka AVB) - by
        // contract, androidboot.vbmeta.digest is set by the bootloader
        // when using AVB).
        if (android::base::GetProperty("ro.boot.vbmeta.digest", "").empty()) {
            LOG(ERROR) << "Expected AVB device, VB1.0 is no longer supported";
            return 1;
        }

        auto ret = SetVerityState(enable_verity);

        // Disable any overlayfs unconditionally if we want verity enabled.