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

am: 6c6861d7c5

Change-Id: I93a04b0b60ee1b18554c4d2bf993084d16f6a039
This commit is contained in:
Tao Bao
2017-03-11 01:42:08 +00:00
committed by android-build-merger
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -32,4 +32,8 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_CFLAGS := -Werror LOCAL_CFLAGS := -Werror
LOCAL_C_INCLUDES += $(LOCAL_PATH)/.. LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true)
LOCAL_CFLAGS += -DPRODUCT_SUPPORTS_VERITY=1
endif
include $(BUILD_EXECUTABLE) include $(BUILD_EXECUTABLE)
+5
View File
@@ -216,6 +216,8 @@ int main(int argc, char** argv) {
if (is_successful == BoolResult::FALSE) { if (is_successful == BoolResult::FALSE) {
// The current slot has not booted successfully. // The current slot has not booted successfully.
#ifdef PRODUCT_SUPPORTS_VERITY
std::string verity_mode = android::base::GetProperty("ro.boot.veritymode", ""); std::string verity_mode = android::base::GetProperty("ro.boot.veritymode", "");
if (verity_mode.empty()) { if (verity_mode.empty()) {
LOG(ERROR) << "Failed to get dm-verity mode."; 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."; LOG(ERROR) << "Failed to verify all blocks in care map file.";
return -1; return -1;
} }
#else
LOG(WARNING) << "dm-verity not enabled; marking without verification.";
#endif
CommandResult cr; CommandResult cr;
module->markBootSuccessful([&cr](CommandResult result) { cr = result; }); module->markBootSuccessful([&cr](CommandResult result) { cr = result; });