summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-03-11 02:38:39 +0100
committerandroid-build-merger <android-build-merger@google.com>2017-03-11 02:38:39 +0100
commit6c6861d7c50ef3a675d62df525aa3a0eced4e287 (patch)
treea4de2c9088329c7e7f942691ddd35a32b1dac82c
parentMerge "recovery: replacing fs_mgr_read_fstab() with new fs_mgr APIs" (diff)
parentMerge "update_verifier: Set the success flag if dm-verity is not enabled." (diff)
downloadandroid_bootable_recovery-6c6861d7c50ef3a675d62df525aa3a0eced4e287.tar
android_bootable_recovery-6c6861d7c50ef3a675d62df525aa3a0eced4e287.tar.gz
android_bootable_recovery-6c6861d7c50ef3a675d62df525aa3a0eced4e287.tar.bz2
android_bootable_recovery-6c6861d7c50ef3a675d62df525aa3a0eced4e287.tar.lz
android_bootable_recovery-6c6861d7c50ef3a675d62df525aa3a0eced4e287.tar.xz
android_bootable_recovery-6c6861d7c50ef3a675d62df525aa3a0eced4e287.tar.zst
android_bootable_recovery-6c6861d7c50ef3a675d62df525aa3a0eced4e287.zip
Diffstat (limited to '')
-rw-r--r--update_verifier/Android.mk4
-rw-r--r--update_verifier/update_verifier.cpp5
2 files changed, 9 insertions, 0 deletions
diff --git a/update_verifier/Android.mk b/update_verifier/Android.mk
index 49d19b0e1..c1051a54a 100644
--- a/update_verifier/Android.mk
+++ b/update_verifier/Android.mk
@@ -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)
diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp
index a4799cc31..83b1c46c4 100644
--- a/update_verifier/update_verifier.cpp
+++ b/update_verifier/update_verifier.cpp
@@ -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; });