blob: 502984243fbadbc299a40ac3a7205554bfe9bea2 [file] [log] [blame]
Jiyong Parke1346862020-05-18 14:31:30 +09001#
2# Copyright (C) 2020 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
Jiyong Parkc0bd8c72020-06-29 10:46:22 +090017# sysprop.mk defines rules for generating <partition>/[etc/]build.prop files
Jiyong Parke1346862020-05-18 14:31:30 +090018
19# -----------------------------------------------------------------
20# property_overrides_split_enabled
21property_overrides_split_enabled :=
22ifeq ($(BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED), true)
23 property_overrides_split_enabled := true
24endif
25
Jiyong Parke1346862020-05-18 14:31:30 +090026BUILDINFO_SH := build/make/tools/buildinfo.sh
Jiyong Parkae556382020-05-20 18:33:43 +090027POST_PROCESS_PROPS := $(HOST_OUT_EXECUTABLES)/post_process_props$(HOST_EXECUTABLE_SUFFIX)
Jiyong Parke1346862020-05-18 14:31:30 +090028
Jiyong Park35a83d12020-05-26 02:01:05 +090029# Emits a set of sysprops common to all partitions to a file.
Jiyong Parke1346862020-05-18 14:31:30 +090030# $(1): Partition name
31# $(2): Output file name
32define generate-common-build-props
Jiyong Park35a83d12020-05-26 02:01:05 +090033 echo "####################################" >> $(2);\
34 echo "# from generate-common-build-props" >> $(2);\
35 echo "# These properties identify this partition image." >> $(2);\
36 echo "####################################" >> $(2);\
37 $(if $(filter system,$(1)),\
38 echo "ro.product.$(1).brand=$(PRODUCT_SYSTEM_BRAND)" >> $(2);\
39 echo "ro.product.$(1).device=$(PRODUCT_SYSTEM_DEVICE)" >> $(2);\
40 echo "ro.product.$(1).manufacturer=$(PRODUCT_SYSTEM_MANUFACTURER)" >> $(2);\
41 echo "ro.product.$(1).model=$(PRODUCT_SYSTEM_MODEL)" >> $(2);\
42 echo "ro.product.$(1).name=$(PRODUCT_SYSTEM_NAME)" >> $(2);\
43 ,\
44 echo "ro.product.$(1).brand=$(PRODUCT_BRAND)" >> $(2);\
45 echo "ro.product.$(1).device=$(TARGET_DEVICE)" >> $(2);\
46 echo "ro.product.$(1).manufacturer=$(PRODUCT_MANUFACTURER)" >> $(2);\
47 echo "ro.product.$(1).model=$(PRODUCT_MODEL)" >> $(2);\
48 echo "ro.product.$(1).name=$(TARGET_PRODUCT)" >> $(2);\
49 )\
SzuWei Linbaf5c812020-12-31 16:59:27 +080050 $(if $(filter system vendor odm,$(1)),\
51 echo "ro.$(1).product.cpu.abilist=$(TARGET_CPU_ABI_LIST) " >> $(2);\
52 echo "ro.$(1).product.cpu.abilist32=$(TARGET_CPU_ABI_LIST_32_BIT)" >> $(2);\
53 echo "ro.$(1).product.cpu.abilist64=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\
54 )\
Jiyong Park35a83d12020-05-26 02:01:05 +090055 echo "ro.$(1).build.date=`$(DATE_FROM_FILE)`" >> $(2);\
56 echo "ro.$(1).build.date.utc=`$(DATE_FROM_FILE) +%s`" >> $(2);\
57 echo "ro.$(1).build.fingerprint=$(BUILD_FINGERPRINT_FROM_FILE)" >> $(2);\
58 echo "ro.$(1).build.id=$(BUILD_ID)" >> $(2);\
59 echo "ro.$(1).build.tags=$(BUILD_VERSION_TAGS)" >> $(2);\
60 echo "ro.$(1).build.type=$(TARGET_BUILD_VARIANT)" >> $(2);\
61 echo "ro.$(1).build.version.incremental=$(BUILD_NUMBER_FROM_FILE)" >> $(2);\
Tianjiee88ac672020-10-15 17:22:48 -070062 echo "ro.$(1).build.version.release=$(PLATFORM_VERSION_LAST_STABLE)" >> $(2);\
63 echo "ro.$(1).build.version.release_or_codename=$(PLATFORM_VERSION)" >> $(2);\
Jiyong Park35a83d12020-05-26 02:01:05 +090064 echo "ro.$(1).build.version.sdk=$(PLATFORM_SDK_VERSION)" >> $(2);\
Jiyong Parke1346862020-05-18 14:31:30 +090065
Jiyong Parke1346862020-05-18 14:31:30 +090066endef
67
Jiyong Parkc0bd8c72020-06-29 10:46:22 +090068# Rule for generating <partition>/[etc/]build.prop file
Jiyong Parke28fa802020-05-26 00:21:20 +090069#
70# $(1): partition name
71# $(2): path to the output
72# $(3): path to the input *.prop files. The contents of the files are directly
73# emitted to the output
74# $(4): list of variable names each of which contains name=value pairs
75# $(5): optional list of prop names to force remove from the output. Properties from both
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +010076# $(3) and (4) are affected
77# $(6): optional list of files to append at the end. The content of each file is emitted
78# to the output
Jiyong Parke28fa802020-05-26 00:21:20 +090079define build-properties
80ALL_DEFAULT_INSTALLED_MODULES += $(2)
81
Jiyong Parkd721e872020-06-22 17:30:57 +090082$(eval # Properties can be assigned using `prop ?= value` or `prop = value` syntax.)
83$(eval # Eliminate spaces around the ?= and = separators.)
Jiyong Parke28fa802020-05-26 00:21:20 +090084$(foreach name,$(strip $(4)),\
Jiyong Parkd721e872020-06-22 17:30:57 +090085 $(eval _temp := $$(call collapse-pairs,$$($(name)),?=))\
86 $(eval _resolved_$(name) := $$(call collapse-pairs,$$(_temp),=))\
Jiyong Parke28fa802020-05-26 00:21:20 +090087)
88
Jiyong Park0b4fccb2020-06-26 17:38:00 +090089$(eval # Implement the legacy behavior when BUILD_BROKEN_DUP_SYSPROP is on.)
90$(eval # Optional assignments are all converted to normal assignments and)
91$(eval # when their duplicates the first one wins)
92$(if $(filter true,$(BUILD_BROKEN_DUP_SYSPROP)),\
93 $(foreach name,$(strip $(4)),\
94 $(eval _temp := $$(subst ?=,=,$$(_resolved_$(name))))\
95 $(eval _resolved_$(name) := $$(call uniq-pairs-by-first-component,$$(_resolved_$(name)),=))\
96 )\
97 $(eval _option := --allow-dup)\
Jiyong Parke28fa802020-05-26 00:21:20 +090098)
99
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100100$(2): $(POST_PROCESS_PROPS) $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) $(3) $(6)
Jiyong Parke28fa802020-05-26 00:21:20 +0900101 $(hide) echo Building $$@
102 $(hide) mkdir -p $$(dir $$@)
103 $(hide) rm -f $$@ && touch $$@
104 $(hide) $$(call generate-common-build-props,$(call to-lower,$(strip $(1))),$$@)
105 $(hide) $(foreach file,$(strip $(3)),\
106 if [ -f "$(file)" ]; then\
107 echo "" >> $$@;\
108 echo "####################################" >> $$@;\
109 echo "# from $(file)" >> $$@;\
110 echo "####################################" >> $$@;\
111 cat $(file) >> $$@;\
112 fi;)
113 $(hide) $(foreach name,$(strip $(4)),\
114 echo "" >> $$@;\
115 echo "####################################" >> $$@;\
116 echo "# from variable $(name)" >> $$@;\
117 echo "####################################" >> $$@;\
118 $$(foreach line,$$(_resolved_$(name)),\
119 echo "$$(line)" >> $$@;\
120 )\
121 )
Jiyong Park0b4fccb2020-06-26 17:38:00 +0900122 $(hide) $(POST_PROCESS_PROPS) $$(_option) $$@ $(5)
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100123 $(hide) $(foreach file,$(strip $(6)),\
124 if [ -f "$(file)" ]; then\
125 cat $(file) >> $$@;\
126 fi;)
Jiyong Parke28fa802020-05-26 00:21:20 +0900127 $(hide) echo "# end of file" >> $$@
128endef
129
Jiyong Parke1346862020-05-18 14:31:30 +0900130# -----------------------------------------------------------------
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900131# Define fingerprint, thumbprint, and version tags for the current build
Jiyong Parke28fa802020-05-26 00:21:20 +0900132#
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900133# BUILD_VERSION_TAGS is a comma-separated list of tags chosen by the device
134# implementer that further distinguishes the build. It's basically defined
135# by the device implementer. Here, we are adding a mandatory tag that
136# identifies the signing config of the build.
Jiyong Parke1346862020-05-18 14:31:30 +0900137BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS)
138ifeq ($(TARGET_BUILD_TYPE),debug)
139 BUILD_VERSION_TAGS += debug
140endif
141# The "test-keys" tag marks builds signed with the old test keys,
142# which are available in the SDK. "dev-keys" marks builds signed with
143# non-default dev keys (usually private keys from a vendor directory).
144# Both of these tags will be removed and replaced with "release-keys"
145# when the target-files is signed in a post-build step.
146ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/make/target/product/security/testkey)
147BUILD_KEYS := test-keys
148else
149BUILD_KEYS := dev-keys
150endif
151BUILD_VERSION_TAGS += $(BUILD_KEYS)
152BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))
153
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900154# BUILD_FINGERPRINT is used used to uniquely identify the combined build and
155# product; used by the OTA server.
Jiyong Parke1346862020-05-18 14:31:30 +0900156ifeq (,$(strip $(BUILD_FINGERPRINT)))
157 ifeq ($(strip $(HAS_BUILD_NUMBER)),false)
158 BF_BUILD_NUMBER := $(BUILD_USERNAME)$$($(DATE_FROM_FILE) +%m%d%H%M)
159 else
160 BF_BUILD_NUMBER := $(file <$(BUILD_NUMBER_FILE))
161 endif
162 BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
163endif
164# unset it for safety.
165BF_BUILD_NUMBER :=
166
167BUILD_FINGERPRINT_FILE := $(PRODUCT_OUT)/build_fingerprint.txt
168ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_FINGERPRINT) >$(BUILD_FINGERPRINT_FILE) && grep " " $(BUILD_FINGERPRINT_FILE)))
169 $(error BUILD_FINGERPRINT cannot contain spaces: "$(file <$(BUILD_FINGERPRINT_FILE))")
170endif
171BUILD_FINGERPRINT_FROM_FILE := $$(cat $(BUILD_FINGERPRINT_FILE))
172# unset it for safety.
173BUILD_FINGERPRINT :=
174
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900175# BUILD_THUMBPRINT is used to uniquely identify the system build; used by the
176# OTA server. This purposefully excludes any product-specific variables.
Jiyong Parke1346862020-05-18 14:31:30 +0900177ifeq (,$(strip $(BUILD_THUMBPRINT)))
178 BUILD_THUMBPRINT := $(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER_FROM_FILE):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
179endif
180
181BUILD_THUMBPRINT_FILE := $(PRODUCT_OUT)/build_thumbprint.txt
182ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_THUMBPRINT) >$(BUILD_THUMBPRINT_FILE) && grep " " $(BUILD_THUMBPRINT_FILE)))
183 $(error BUILD_THUMBPRINT cannot contain spaces: "$(file <$(BUILD_THUMBPRINT_FILE))")
184endif
185BUILD_THUMBPRINT_FROM_FILE := $$(cat $(BUILD_THUMBPRINT_FILE))
186# unset it for safety.
187BUILD_THUMBPRINT :=
188
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900189# -----------------------------------------------------------------
190# Define human readable strings that describe this build
191#
Jiyong Parke1346862020-05-18 14:31:30 +0900192
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900193# BUILD_ID: detail info; has the same info as the build fingerprint
194BUILD_DESC := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) $(PLATFORM_VERSION) $(BUILD_ID) $(BUILD_NUMBER_FROM_FILE) $(BUILD_VERSION_TAGS)
195
196# BUILD_DISPLAY_ID is shown under Settings -> About Phone
Jiyong Parke1346862020-05-18 14:31:30 +0900197ifeq ($(TARGET_BUILD_VARIANT),user)
198 # User builds should show:
199 # release build number or branch.buld_number non-release builds
200
201 # Dev. branches should have DISPLAY_BUILD_NUMBER set
202 ifeq (true,$(DISPLAY_BUILD_NUMBER))
203 BUILD_DISPLAY_ID := $(BUILD_ID).$(BUILD_NUMBER_FROM_FILE) $(BUILD_KEYS)
204 else
205 BUILD_DISPLAY_ID := $(BUILD_ID) $(BUILD_KEYS)
206 endif
207else
208 # Non-user builds should show detailed build information
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900209 BUILD_DISPLAY_ID := $(BUILD_DESC)
Jiyong Parke1346862020-05-18 14:31:30 +0900210endif
211
Jiyong Parke1346862020-05-18 14:31:30 +0900212# TARGET_BUILD_FLAVOR and ro.build.flavor are used only by the test
213# harness to distinguish builds. Only add _asan for a sanitized build
214# if it isn't already a part of the flavor (via a dedicated lunch
215# config for example).
216TARGET_BUILD_FLAVOR := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)
217ifneq (, $(filter address, $(SANITIZE_TARGET)))
218ifeq (,$(findstring _asan,$(TARGET_BUILD_FLAVOR)))
219TARGET_BUILD_FLAVOR := $(TARGET_BUILD_FLAVOR)_asan
220endif
221endif
222
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900223KNOWN_OEM_THUMBPRINT_PROPERTIES := \
224 ro.product.brand \
225 ro.product.name \
226 ro.product.device
227OEM_THUMBPRINT_PROPERTIES := $(filter $(KNOWN_OEM_THUMBPRINT_PROPERTIES),\
228 $(PRODUCT_OEM_PROPERTIES))
229KNOWN_OEM_THUMBPRINT_PROPERTIES:=
230
231# -----------------------------------------------------------------
232# system/build.prop
233#
234# Note: parts of this file that can't be generated by the build-properties
235# macro are manually created as separate files and then fed into the macro
236
237# Accepts a whitespace separated list of product locales such as
238# (en_US en_AU en_GB...) and returns the first locale in the list with
239# underscores replaced with hyphens. In the example above, this will
240# return "en-US".
241define get-default-product-locale
242$(strip $(subst _,-, $(firstword $(1))))
243endef
244
Jiyong Parkc60c5142020-07-14 15:15:50 +0900245gen_from_buildinfo_sh := $(call intermediates-dir-for,PACKAGING,system_build_prop)/buildinfo.prop
Rupert Shuttleworth3b37bc82020-12-08 09:46:55 +0000246$(gen_from_buildinfo_sh): $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) | $(BUILD_DATETIME_FILE) $(BUILD_NUMBER_FILE)
Jiyong Parke1346862020-05-18 14:31:30 +0900247 $(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \
248 TARGET_BUILD_FLAVOR="$(TARGET_BUILD_FLAVOR)" \
249 TARGET_DEVICE="$(TARGET_DEVICE)" \
250 PRODUCT_DEFAULT_LOCALE="$(call get-default-product-locale,$(PRODUCT_LOCALES))" \
251 PRODUCT_DEFAULT_WIFI_CHANNELS="$(PRODUCT_DEFAULT_WIFI_CHANNELS)" \
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900252 PRIVATE_BUILD_DESC="$(BUILD_DESC)" \
Jiyong Parke1346862020-05-18 14:31:30 +0900253 BUILD_ID="$(BUILD_ID)" \
254 BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \
255 DATE="$(DATE_FROM_FILE)" \
256 BUILD_USERNAME="$(BUILD_USERNAME)" \
257 BUILD_HOSTNAME="$(BUILD_HOSTNAME)" \
258 BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \
259 BOARD_BUILD_SYSTEM_ROOT_IMAGE="$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)" \
260 PLATFORM_VERSION="$(PLATFORM_VERSION)" \
261 PLATFORM_VERSION_LAST_STABLE="$(PLATFORM_VERSION_LAST_STABLE)" \
262 PLATFORM_SECURITY_PATCH="$(PLATFORM_SECURITY_PATCH)" \
263 PLATFORM_BASE_OS="$(PLATFORM_BASE_OS)" \
264 PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \
265 PLATFORM_PREVIEW_SDK_VERSION="$(PLATFORM_PREVIEW_SDK_VERSION)" \
266 PLATFORM_PREVIEW_SDK_FINGERPRINT="$$(cat $(API_FINGERPRINT))" \
267 PLATFORM_VERSION_CODENAME="$(PLATFORM_VERSION_CODENAME)" \
268 PLATFORM_VERSION_ALL_CODENAMES="$(PLATFORM_VERSION_ALL_CODENAMES)" \
269 PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION="$(PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION)" \
270 BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \
271 $(if $(OEM_THUMBPRINT_PROPERTIES),BUILD_THUMBPRINT="$(BUILD_THUMBPRINT_FROM_FILE)") \
272 TARGET_CPU_ABI_LIST="$(TARGET_CPU_ABI_LIST)" \
273 TARGET_CPU_ABI_LIST_32_BIT="$(TARGET_CPU_ABI_LIST_32_BIT)" \
274 TARGET_CPU_ABI_LIST_64_BIT="$(TARGET_CPU_ABI_LIST_64_BIT)" \
275 TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \
276 TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900277 bash $(BUILDINFO_SH) > $@
Jiyong Parke1346862020-05-18 14:31:30 +0900278
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900279ifdef TARGET_SYSTEM_PROP
280system_prop_file := $(TARGET_SYSTEM_PROP)
281else
282system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop)
283endif
284
285_prop_files_ := \
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900286 $(gen_from_buildinfo_sh) \
287 $(system_prop_file)
288
289# Order matters here. When there are duplicates, the last one wins.
290# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
291_prop_vars_ := \
292 ADDITIONAL_SYSTEM_PROPERTIES \
Jiyong Parkeb49b342020-05-29 17:50:03 +0900293 PRODUCT_SYSTEM_PROPERTIES
294
295# TODO(b/117892318): deprecate this
296_prop_vars_ += \
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900297 PRODUCT_SYSTEM_DEFAULT_PROPERTIES
298
299ifndef property_overrides_split_enabled
300_prop_vars_ += \
Garfield Tan04714da2020-08-13 15:21:32 -0700301 ADDITIONAL_VENDOR_PROPERTIES \
302 PRODUCT_VENDOR_PROPERTIES
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900303endif
304
305_blacklist_names_ := \
306 $(PRODUCT_SYSTEM_PROPERTY_BLACKLIST) \
307 ro.product.first_api_level
308
309INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop
310
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100311$(eval $(call build-properties,\
312 system,\
313 $(INSTALLED_BUILD_PROP_TARGET),\
314 $(_prop_files_),\
315 $(_prop_vars_),\
316 $(_blacklist_names_),\
317 $(empty)))
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900318
Jiyong Parke1346862020-05-18 14:31:30 +0900319# -----------------------------------------------------------------
Jiyong Parke28fa802020-05-26 00:21:20 +0900320# vendor/build.prop
Jiyong Parke1346862020-05-18 14:31:30 +0900321#
Jiyong Parke28fa802020-05-26 00:21:20 +0900322_prop_files_ := $(if $(TARGET_VENDOR_PROP),\
323 $(TARGET_VENDOR_PROP),\
324 $(wildcard $(TARGET_DEVICE_DIR)/vendor.prop))
Jiyong Parke1346862020-05-18 14:31:30 +0900325
Jiyong Park3a2e95a2020-05-25 17:56:09 +0900326android_info_prop := $(call intermediates-dir-for,ETC,android_info_prop)/android_info.prop
327$(android_info_prop): $(INSTALLED_ANDROID_INFO_TXT_TARGET)
328 cat $< | grep 'require version-' | sed -e 's/require version-/ro.build.expect./g' > $@
329
Jiyong Parke28fa802020-05-26 00:21:20 +0900330_prop_files_ += $(android_info_pro)
Jiyong Park3a2e95a2020-05-25 17:56:09 +0900331
Jiyong Parke1346862020-05-18 14:31:30 +0900332ifdef property_overrides_split_enabled
Jiyong Parke28fa802020-05-26 00:21:20 +0900333# Order matters here. When there are duplicates, the last one wins.
334# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
335_prop_vars_ := \
336 ADDITIONAL_VENDOR_PROPERTIES \
Jiyong Parkeb49b342020-05-29 17:50:03 +0900337 PRODUCT_VENDOR_PROPERTIES
338
339# TODO(b/117892318): deprecate this
340_prop_vars_ += \
341 PRODUCT_DEFAULT_PROPERTY_OVERRIDES \
Jiyong Parke28fa802020-05-26 00:21:20 +0900342 PRODUCT_PROPERTY_OVERRIDES
Jiyong Parke1346862020-05-18 14:31:30 +0900343else
Jiyong Parke28fa802020-05-26 00:21:20 +0900344_prop_vars_ :=
Jiyong Parke1346862020-05-18 14:31:30 +0900345endif
346
Jiyong Parke28fa802020-05-26 00:21:20 +0900347INSTALLED_VENDOR_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR)/build.prop
348$(eval $(call build-properties,\
349 vendor,\
350 $(INSTALLED_VENDOR_BUILD_PROP_TARGET),\
351 $(_prop_files_),\
352 $(_prop_vars_),\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100353 $(PRODUCT_VENDOR_PROPERTY_BLACKLIST),\
354 $(empty)))
Jiyong Parke1346862020-05-18 14:31:30 +0900355
Jiyong Parke28fa802020-05-26 00:21:20 +0900356# -----------------------------------------------------------------
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900357# product/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900358#
359
360_prop_files_ := $(if $(TARGET_PRODUCT_PROP),\
361 $(TARGET_PRODUCT_PROP),\
362 $(wildcard $(TARGET_DEVICE_DIR)/product.prop))
363
364# Order matters here. When there are duplicates, the last one wins.
365# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
366_prop_vars_ := \
367 ADDITIONAL_PRODUCT_PROPERTIES \
368 PRODUCT_PRODUCT_PROPERTIES
369
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900370INSTALLED_PRODUCT_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT)/etc/build.prop
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100371
372ifdef PRODUCT_OEM_PROPERTIES
373import_oem_prop := $(call intermediates-dir-for,ETC,import_oem_prop)/oem.prop
374
375$(import_oem_prop):
376 $(hide) echo "####################################" >> $@; \
377 echo "# PRODUCT_OEM_PROPERTIES" >> $@; \
378 echo "####################################" >> $@;
379 $(hide) $(foreach prop,$(PRODUCT_OEM_PROPERTIES), \
380 echo "import /oem/oem.prop $(prop)" >> $@;)
381
382_footers_ := $(import_oem_prop)
383else
384_footers_ :=
385endif
386
Jiyong Parke28fa802020-05-26 00:21:20 +0900387$(eval $(call build-properties,\
388 product,\
389 $(INSTALLED_PRODUCT_BUILD_PROP_TARGET),\
390 $(_prop_files_),\
391 $(_prop_vars_),\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100392 $(empty),\
393 $(_footers_)))
Jiyong Parke1346862020-05-18 14:31:30 +0900394
395# ----------------------------------------------------------------
Jiyong Park62117c82020-06-26 09:56:31 +0900396# odm/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900397#
398_prop_files_ := $(if $(TARGET_ODM_PROP),\
399 $(TARGET_ODM_PROP),\
400 $(wildcard $(TARGET_DEVICE_DIR)/odm.prop))
Jiyong Parke1346862020-05-18 14:31:30 +0900401
Jiyong Parke28fa802020-05-26 00:21:20 +0900402# Order matters here. When there are duplicates, the last one wins.
403# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
404_prop_vars_ := \
405 ADDITIONAL_ODM_PROPERTIES \
406 PRODUCT_ODM_PROPERTIES
Jiyong Parke1346862020-05-18 14:31:30 +0900407
Jiyong Park62117c82020-06-26 09:56:31 +0900408INSTALLED_ODM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM)/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900409$(eval $(call build-properties,\
410 odm,\
411 $(INSTALLED_ODM_BUILD_PROP_TARGET),\
412 $(_prop_files),\
413 $(_prop_vars_),\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100414 $(empty),\
Jiyong Parke28fa802020-05-26 00:21:20 +0900415 $(empty)))
Jiyong Parke1346862020-05-18 14:31:30 +0900416
Yifan Hong51a971b2020-06-25 17:00:27 -0700417# ----------------------------------------------------------------
418# vendor_dlkm/etc/build.prop
419#
420
421INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR_DLKM)/etc/build.prop
422$(eval $(call build-properties,\
423 vendor_dlkm,\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100424 $(INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET),\
425 $(empty),\
426 $(empty),\
427 $(empty),\
428 $(empty)))
Yifan Hong51a971b2020-06-25 17:00:27 -0700429
Yifan Hong81a092f2020-07-15 17:02:07 -0700430# ----------------------------------------------------------------
431# odm_dlkm/etc/build.prop
432#
433
434INSTALLED_ODM_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM_DLKM)/etc/build.prop
435$(eval $(call build-properties,\
436 odm_dlkm,\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100437 $(INSTALLED_ODM_DLKM_BUILD_PROP_TARGET),\
438 $(empty),\
439 $(empty),\
440 $(empty),\
441 $(empty)))
Yifan Hong81a092f2020-07-15 17:02:07 -0700442
Jiyong Parke1346862020-05-18 14:31:30 +0900443# -----------------------------------------------------------------
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900444# system_ext/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900445#
446_prop_files_ := $(if $(TARGET_SYSTEM_EXT_PROP),\
447 $(TARGET_SYSTEM_EXT_PROP),\
448 $(wildcard $(TARGET_DEVICE_DIR)/system_ext.prop))
449
450# Order matters here. When there are duplicates, the last one wins.
451# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
452_prop_vars_ := PRODUCT_SYSTEM_EXT_PROPERTIES
453
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900454INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET := $(TARGET_OUT_SYSTEM_EXT)/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900455$(eval $(call build-properties,\
456 system_ext,\
457 $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET),\
458 $(_prop_files_),\
459 $(_prop_vars_),\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100460 $(empty),\
Jiyong Parke28fa802020-05-26 00:21:20 +0900461 $(empty)))
Yifan Hong33fd5d42020-09-24 18:18:26 -0700462
463# ----------------------------------------------------------------
464# ramdisk/boot/etc/build.prop
465#
466
467RAMDISK_BUILD_PROP_REL_PATH := system/etc/ramdisk/build.prop
468INSTALLED_RAMDISK_BUILD_PROP_TARGET := $(TARGET_RAMDISK_OUT)/$(RAMDISK_BUILD_PROP_REL_PATH)
469$(eval $(call build-properties,\
470 bootimage,\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100471 $(INSTALLED_RAMDISK_BUILD_PROP_TARGET),\
472 $(empty),\
473 $(empty),\
474 $(empty),\
475 $(empty)))