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

Commit 6c6861d7 authored by Tao Bao's avatar Tao Bao Committed by android-build-merger
Browse files

Merge "update_verifier: Set the success flag if dm-verity is not enabled."

am: a7211b3c

Change-Id: I4e516463fe7a7a7f97e7bb6c7c7c42f5f320f7ef
parents 1a232572 a7211b3c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -32,4 +32,8 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_CFLAGS := -Werror
LOCAL_C_INCLUDES += $(LOCAL_PATH)/..

ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true)
    LOCAL_CFLAGS += -DPRODUCT_SUPPORTS_VERITY=1
endif

include $(BUILD_EXECUTABLE)
+5 −0
Original line number Diff line number Diff line
@@ -216,6 +216,8 @@ int main(int argc, char** argv) {

  if (is_successful == BoolResult::FALSE) {
    // The current slot has not booted successfully.

#ifdef PRODUCT_SUPPORTS_VERITY
    std::string verity_mode = android::base::GetProperty("ro.boot.veritymode", "");
    if (verity_mode.empty()) {
      LOG(ERROR) << "Failed to get dm-verity mode.";
@@ -232,6 +234,9 @@ int main(int argc, char** argv) {
      LOG(ERROR) << "Failed to verify all blocks in care map file.";
      return -1;
    }
#else
    LOG(WARNING) << "dm-verity not enabled; marking without verification.";
#endif

    CommandResult cr;
    module->markBootSuccessful([&cr](CommandResult result) { cr = result; });