aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Willemsen2019-01-02 14:27:43 -0600
committerDan Willemsen2019-01-02 16:33:29 -0600
commit63e48db6d19a676edb56b32d9afc10de363d6122 (patch)
tree63a2422bf17d57ac15639534126aeeb0659a6ca9
parent5723181c537d6d288b4554d9ded63634aec7f78e (diff)
downloadplatform-build-63e48db6d19a676edb56b32d9afc10de363d6122.tar.gz
platform-build-63e48db6d19a676edb56b32d9afc10de363d6122.tar.xz
platform-build-63e48db6d19a676edb56b32d9afc10de363d6122.zip
Add BUILD_USERNAME and BUILD_HOSTNAME
These replace $USER and `hostname`, which will soon become stable values due to sandboxing the build on Linux. Bug: 122270019 Test: check build.prop Change-Id: I7493e45a2a2defbdba5d82596cb91d68480f0187
-rw-r--r--core/Makefile4
-rw-r--r--core/main.mk2
-rw-r--r--core/version_defaults.mk2
-rwxr-xr-xtools/buildinfo.sh4
4 files changed, 7 insertions, 5 deletions
diff --git a/core/Makefile b/core/Makefile
index 179cf29de..56b45df69 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -317,7 +317,7 @@ $(intermediate_system_build_prop): PRIVATE_BUILD_DESC := $(build_desc)
317# The string used to uniquely identify the combined build and product; used by the OTA server. 317# The string used to uniquely identify the combined build and product; used by the OTA server.
318ifeq (,$(strip $(BUILD_FINGERPRINT))) 318ifeq (,$(strip $(BUILD_FINGERPRINT)))
319 ifeq ($(strip $(HAS_BUILD_NUMBER)),false) 319 ifeq ($(strip $(HAS_BUILD_NUMBER)),false)
320 BF_BUILD_NUMBER := $(USER)$$($(DATE_FROM_FILE) +%m%d%H%M) 320 BF_BUILD_NUMBER := $(BUILD_USERNAME)$$($(DATE_FROM_FILE) +%m%d%H%M)
321 else 321 else
322 BF_BUILD_NUMBER := $(file <$(BUILD_NUMBER_FILE)) 322 BF_BUILD_NUMBER := $(file <$(BUILD_NUMBER_FILE))
323 endif 323 endif
@@ -420,6 +420,8 @@ endif
420 BUILD_ID="$(BUILD_ID)" \ 420 BUILD_ID="$(BUILD_ID)" \
421 BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \ 421 BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \
422 DATE="$(DATE_FROM_FILE)" \ 422 DATE="$(DATE_FROM_FILE)" \
423 BUILD_USERNAME="$(BUILD_USERNAME)" \
424 BUILD_HOSTNAME="$(BUILD_HOSTNAME)" \
423 BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \ 425 BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \
424 BOARD_BUILD_SYSTEM_ROOT_IMAGE="$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)" \ 426 BOARD_BUILD_SYSTEM_ROOT_IMAGE="$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)" \
425 AB_OTA_UPDATER="$(AB_OTA_UPDATER)" \ 427 AB_OTA_UPDATER="$(AB_OTA_UPDATER)" \
diff --git a/core/main.mk b/core/main.mk
index 9fd1c35c5..4f81c2163 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -80,7 +80,7 @@ endif
80ifeq ($(strip $(HAS_BUILD_NUMBER)),false) 80ifeq ($(strip $(HAS_BUILD_NUMBER)),false)
81 # BUILD_NUMBER has a timestamp in it, which means that 81 # BUILD_NUMBER has a timestamp in it, which means that
82 # it will change every time. Pick a stable value. 82 # it will change every time. Pick a stable value.
83 FILE_NAME_TAG := eng.$(USER) 83 FILE_NAME_TAG := eng.$(BUILD_USERNAME)
84else 84else
85 FILE_NAME_TAG := $(file <$(BUILD_NUMBER_FILE)) 85 FILE_NAME_TAG := $(file <$(BUILD_NUMBER_FILE))
86endif 86endif
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 0fd40db12..c4f9a5229 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -314,7 +314,7 @@ ifndef BUILD_NUMBER
314 # If no BUILD_NUMBER is set, create a useful "I am an engineering build 314 # If no BUILD_NUMBER is set, create a useful "I am an engineering build
315 # from this date/time" value. Make it start with a non-digit so that 315 # from this date/time" value. Make it start with a non-digit so that
316 # anyone trying to parse it as an integer will probably get "0". 316 # anyone trying to parse it as an integer will probably get "0".
317 BUILD_NUMBER := eng.$(shell echo $${USER:0:6}).$(shell $(DATE) +%Y%m%d.%H%M%S) 317 BUILD_NUMBER := eng.$(shell echo $${BUILD_USERNAME:0:6}).$(shell $(DATE) +%Y%m%d.%H%M%S)
318 HAS_BUILD_NUMBER := false 318 HAS_BUILD_NUMBER := false
319endif 319endif
320.KATI_READONLY := BUILD_NUMBER HAS_BUILD_NUMBER 320.KATI_READONLY := BUILD_NUMBER HAS_BUILD_NUMBER
diff --git a/tools/buildinfo.sh b/tools/buildinfo.sh
index b76c08954..7286f95b3 100755
--- a/tools/buildinfo.sh
+++ b/tools/buildinfo.sh
@@ -18,8 +18,8 @@ echo "ro.build.version.min_supported_target_sdk=$PLATFORM_MIN_SUPPORTED_TARGET_S
18echo "ro.build.date=`$DATE`" 18echo "ro.build.date=`$DATE`"
19echo "ro.build.date.utc=`$DATE +%s`" 19echo "ro.build.date.utc=`$DATE +%s`"
20echo "ro.build.type=$TARGET_BUILD_TYPE" 20echo "ro.build.type=$TARGET_BUILD_TYPE"
21echo "ro.build.user=$USER" 21echo "ro.build.user=$BUILD_USERNAME"
22echo "ro.build.host=`hostname`" 22echo "ro.build.host=$BUILD_HOSTNAME"
23echo "ro.build.tags=$BUILD_VERSION_TAGS" 23echo "ro.build.tags=$BUILD_VERSION_TAGS"
24echo "ro.build.flavor=$TARGET_BUILD_FLAVOR" 24echo "ro.build.flavor=$TARGET_BUILD_FLAVOR"
25if [ -n "$BOARD_BUILD_SYSTEM_ROOT_IMAGE" ] ; then 25if [ -n "$BOARD_BUILD_SYSTEM_ROOT_IMAGE" ] ; then