Don't set the build id if we need to append the digest
Background in http://go/compatible-build-fingerprint. If we want
to append unique vbmeta digest to build id, we cannot setup the
prop value at build time. Instead, set the old value as
ro.build.legacy.id; and let init set ro.build.id at runtime.
Bug: 186786987
Test: build a target file with the flag on
Change-Id: Ie139725bb7e5c65bd3f28f43b9975ba48ee10354
diff --git a/core/sysprop.mk b/core/sysprop.mk
index daebdd3..0fc96e0 100644
--- a/core/sysprop.mk
+++ b/core/sysprop.mk
@@ -260,6 +260,7 @@
BUILD_HOSTNAME="$(BUILD_HOSTNAME)" \
BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \
BOARD_BUILD_SYSTEM_ROOT_IMAGE="$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)" \
+ BOARD_USE_VBMETA_DIGTEST_IN_FINGERPRINT="$(BOARD_USE_VBMETA_DIGTEST_IN_FINGERPRINT)" \
PLATFORM_VERSION="$(PLATFORM_VERSION)" \
PLATFORM_VERSION_LAST_STABLE="$(PLATFORM_VERSION_LAST_STABLE)" \
PLATFORM_SECURITY_PATCH="$(PLATFORM_SECURITY_PATCH)" \
diff --git a/tools/buildinfo.sh b/tools/buildinfo.sh
index f27ed8c..a349cba 100755
--- a/tools/buildinfo.sh
+++ b/tools/buildinfo.sh
@@ -3,7 +3,12 @@
echo "# begin build properties"
echo "# autogenerated by buildinfo.sh"
-echo "ro.build.id=$BUILD_ID"
+# The ro.build.id will be set dynamically by init, by appending the unique vbmeta digest.
+if [ "$BOARD_USE_VBMETA_DIGTEST_IN_FINGERPRINT" = "true" ] ; then
+ echo "ro.build.legacy.id=$BUILD_ID"
+else
+ echo "ro.build.id=$BUILD_ID"
+fi
echo "ro.build.display.id=$BUILD_DISPLAY_ID"
echo "ro.build.version.incremental=$BUILD_NUMBER"
echo "ro.build.version.sdk=$PLATFORM_SDK_VERSION"