blob: fdefcedaa9704c66c97c5b88b77e3c66a41d7f62 [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 )\
50 echo "ro.$(1).build.date=`$(DATE_FROM_FILE)`" >> $(2);\
51 echo "ro.$(1).build.date.utc=`$(DATE_FROM_FILE) +%s`" >> $(2);\
52 echo "ro.$(1).build.fingerprint=$(BUILD_FINGERPRINT_FROM_FILE)" >> $(2);\
53 echo "ro.$(1).build.id=$(BUILD_ID)" >> $(2);\
54 echo "ro.$(1).build.tags=$(BUILD_VERSION_TAGS)" >> $(2);\
55 echo "ro.$(1).build.type=$(TARGET_BUILD_VARIANT)" >> $(2);\
56 echo "ro.$(1).build.version.incremental=$(BUILD_NUMBER_FROM_FILE)" >> $(2);\
Tianjiee88ac672020-10-15 17:22:48 -070057 echo "ro.$(1).build.version.release=$(PLATFORM_VERSION_LAST_STABLE)" >> $(2);\
58 echo "ro.$(1).build.version.release_or_codename=$(PLATFORM_VERSION)" >> $(2);\
Jiyong Park35a83d12020-05-26 02:01:05 +090059 echo "ro.$(1).build.version.sdk=$(PLATFORM_SDK_VERSION)" >> $(2);\
Jiyong Parke1346862020-05-18 14:31:30 +090060
Jiyong Parke1346862020-05-18 14:31:30 +090061endef
62
Jiyong Parkc0bd8c72020-06-29 10:46:22 +090063# Rule for generating <partition>/[etc/]build.prop file
Jiyong Parke28fa802020-05-26 00:21:20 +090064#
65# $(1): partition name
66# $(2): path to the output
67# $(3): path to the input *.prop files. The contents of the files are directly
68# emitted to the output
69# $(4): list of variable names each of which contains name=value pairs
70# $(5): optional list of prop names to force remove from the output. Properties from both
71# $(3) and (4) are affected.
72define build-properties
73ALL_DEFAULT_INSTALLED_MODULES += $(2)
74
Jiyong Parkd721e872020-06-22 17:30:57 +090075$(eval # Properties can be assigned using `prop ?= value` or `prop = value` syntax.)
76$(eval # Eliminate spaces around the ?= and = separators.)
Jiyong Parke28fa802020-05-26 00:21:20 +090077$(foreach name,$(strip $(4)),\
Jiyong Parkd721e872020-06-22 17:30:57 +090078 $(eval _temp := $$(call collapse-pairs,$$($(name)),?=))\
79 $(eval _resolved_$(name) := $$(call collapse-pairs,$$(_temp),=))\
Jiyong Parke28fa802020-05-26 00:21:20 +090080)
81
Jiyong Park0b4fccb2020-06-26 17:38:00 +090082$(eval # Implement the legacy behavior when BUILD_BROKEN_DUP_SYSPROP is on.)
83$(eval # Optional assignments are all converted to normal assignments and)
84$(eval # when their duplicates the first one wins)
85$(if $(filter true,$(BUILD_BROKEN_DUP_SYSPROP)),\
86 $(foreach name,$(strip $(4)),\
87 $(eval _temp := $$(subst ?=,=,$$(_resolved_$(name))))\
88 $(eval _resolved_$(name) := $$(call uniq-pairs-by-first-component,$$(_resolved_$(name)),=))\
89 )\
90 $(eval _option := --allow-dup)\
Jiyong Parke28fa802020-05-26 00:21:20 +090091)
92
Jiyong Park35a83d12020-05-26 02:01:05 +090093$(2): $(POST_PROCESS_PROPS) $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) $(3)
Jiyong Parke28fa802020-05-26 00:21:20 +090094 $(hide) echo Building $$@
95 $(hide) mkdir -p $$(dir $$@)
96 $(hide) rm -f $$@ && touch $$@
97 $(hide) $$(call generate-common-build-props,$(call to-lower,$(strip $(1))),$$@)
98 $(hide) $(foreach file,$(strip $(3)),\
99 if [ -f "$(file)" ]; then\
100 echo "" >> $$@;\
101 echo "####################################" >> $$@;\
102 echo "# from $(file)" >> $$@;\
103 echo "####################################" >> $$@;\
104 cat $(file) >> $$@;\
105 fi;)
106 $(hide) $(foreach name,$(strip $(4)),\
107 echo "" >> $$@;\
108 echo "####################################" >> $$@;\
109 echo "# from variable $(name)" >> $$@;\
110 echo "####################################" >> $$@;\
111 $$(foreach line,$$(_resolved_$(name)),\
112 echo "$$(line)" >> $$@;\
113 )\
114 )
Jiyong Park0b4fccb2020-06-26 17:38:00 +0900115 $(hide) $(POST_PROCESS_PROPS) $$(_option) $$@ $(5)
Jiyong Parke28fa802020-05-26 00:21:20 +0900116 $(hide) echo "# end of file" >> $$@
117endef
118
Jiyong Parke1346862020-05-18 14:31:30 +0900119# -----------------------------------------------------------------
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900120# Define fingerprint, thumbprint, and version tags for the current build
Jiyong Parke28fa802020-05-26 00:21:20 +0900121#
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900122# BUILD_VERSION_TAGS is a comma-separated list of tags chosen by the device
123# implementer that further distinguishes the build. It's basically defined
124# by the device implementer. Here, we are adding a mandatory tag that
125# identifies the signing config of the build.
Jiyong Parke1346862020-05-18 14:31:30 +0900126BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS)
127ifeq ($(TARGET_BUILD_TYPE),debug)
128 BUILD_VERSION_TAGS += debug
129endif
130# The "test-keys" tag marks builds signed with the old test keys,
131# which are available in the SDK. "dev-keys" marks builds signed with
132# non-default dev keys (usually private keys from a vendor directory).
133# Both of these tags will be removed and replaced with "release-keys"
134# when the target-files is signed in a post-build step.
135ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/make/target/product/security/testkey)
136BUILD_KEYS := test-keys
137else
138BUILD_KEYS := dev-keys
139endif
140BUILD_VERSION_TAGS += $(BUILD_KEYS)
141BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))
142
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900143# BUILD_FINGERPRINT is used used to uniquely identify the combined build and
144# product; used by the OTA server.
Jiyong Parke1346862020-05-18 14:31:30 +0900145ifeq (,$(strip $(BUILD_FINGERPRINT)))
146 ifeq ($(strip $(HAS_BUILD_NUMBER)),false)
147 BF_BUILD_NUMBER := $(BUILD_USERNAME)$$($(DATE_FROM_FILE) +%m%d%H%M)
148 else
149 BF_BUILD_NUMBER := $(file <$(BUILD_NUMBER_FILE))
150 endif
151 BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
152endif
153# unset it for safety.
154BF_BUILD_NUMBER :=
155
156BUILD_FINGERPRINT_FILE := $(PRODUCT_OUT)/build_fingerprint.txt
157ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_FINGERPRINT) >$(BUILD_FINGERPRINT_FILE) && grep " " $(BUILD_FINGERPRINT_FILE)))
158 $(error BUILD_FINGERPRINT cannot contain spaces: "$(file <$(BUILD_FINGERPRINT_FILE))")
159endif
160BUILD_FINGERPRINT_FROM_FILE := $$(cat $(BUILD_FINGERPRINT_FILE))
161# unset it for safety.
162BUILD_FINGERPRINT :=
163
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900164# BUILD_THUMBPRINT is used to uniquely identify the system build; used by the
165# OTA server. This purposefully excludes any product-specific variables.
Jiyong Parke1346862020-05-18 14:31:30 +0900166ifeq (,$(strip $(BUILD_THUMBPRINT)))
167 BUILD_THUMBPRINT := $(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER_FROM_FILE):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
168endif
169
170BUILD_THUMBPRINT_FILE := $(PRODUCT_OUT)/build_thumbprint.txt
171ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_THUMBPRINT) >$(BUILD_THUMBPRINT_FILE) && grep " " $(BUILD_THUMBPRINT_FILE)))
172 $(error BUILD_THUMBPRINT cannot contain spaces: "$(file <$(BUILD_THUMBPRINT_FILE))")
173endif
174BUILD_THUMBPRINT_FROM_FILE := $$(cat $(BUILD_THUMBPRINT_FILE))
175# unset it for safety.
176BUILD_THUMBPRINT :=
177
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900178# -----------------------------------------------------------------
179# Define human readable strings that describe this build
180#
Jiyong Parke1346862020-05-18 14:31:30 +0900181
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900182# BUILD_ID: detail info; has the same info as the build fingerprint
183BUILD_DESC := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) $(PLATFORM_VERSION) $(BUILD_ID) $(BUILD_NUMBER_FROM_FILE) $(BUILD_VERSION_TAGS)
184
185# BUILD_DISPLAY_ID is shown under Settings -> About Phone
Jiyong Parke1346862020-05-18 14:31:30 +0900186ifeq ($(TARGET_BUILD_VARIANT),user)
187 # User builds should show:
188 # release build number or branch.buld_number non-release builds
189
190 # Dev. branches should have DISPLAY_BUILD_NUMBER set
191 ifeq (true,$(DISPLAY_BUILD_NUMBER))
192 BUILD_DISPLAY_ID := $(BUILD_ID).$(BUILD_NUMBER_FROM_FILE) $(BUILD_KEYS)
193 else
194 BUILD_DISPLAY_ID := $(BUILD_ID) $(BUILD_KEYS)
195 endif
196else
197 # Non-user builds should show detailed build information
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900198 BUILD_DISPLAY_ID := $(BUILD_DESC)
Jiyong Parke1346862020-05-18 14:31:30 +0900199endif
200
Jiyong Parke1346862020-05-18 14:31:30 +0900201# TARGET_BUILD_FLAVOR and ro.build.flavor are used only by the test
202# harness to distinguish builds. Only add _asan for a sanitized build
203# if it isn't already a part of the flavor (via a dedicated lunch
204# config for example).
205TARGET_BUILD_FLAVOR := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)
206ifneq (, $(filter address, $(SANITIZE_TARGET)))
207ifeq (,$(findstring _asan,$(TARGET_BUILD_FLAVOR)))
208TARGET_BUILD_FLAVOR := $(TARGET_BUILD_FLAVOR)_asan
209endif
210endif
211
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900212KNOWN_OEM_THUMBPRINT_PROPERTIES := \
213 ro.product.brand \
214 ro.product.name \
215 ro.product.device
216OEM_THUMBPRINT_PROPERTIES := $(filter $(KNOWN_OEM_THUMBPRINT_PROPERTIES),\
217 $(PRODUCT_OEM_PROPERTIES))
218KNOWN_OEM_THUMBPRINT_PROPERTIES:=
219
220# -----------------------------------------------------------------
221# system/build.prop
222#
223# Note: parts of this file that can't be generated by the build-properties
224# macro are manually created as separate files and then fed into the macro
225
226# Accepts a whitespace separated list of product locales such as
227# (en_US en_AU en_GB...) and returns the first locale in the list with
228# underscores replaced with hyphens. In the example above, this will
229# return "en-US".
230define get-default-product-locale
231$(strip $(subst _,-, $(firstword $(1))))
232endef
233
Jiyong Parkc60c5142020-07-14 15:15:50 +0900234gen_from_buildinfo_sh := $(call intermediates-dir-for,PACKAGING,system_build_prop)/buildinfo.prop
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900235$(gen_from_buildinfo_sh): $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT)
Jiyong Parke1346862020-05-18 14:31:30 +0900236 $(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \
237 TARGET_BUILD_FLAVOR="$(TARGET_BUILD_FLAVOR)" \
238 TARGET_DEVICE="$(TARGET_DEVICE)" \
239 PRODUCT_DEFAULT_LOCALE="$(call get-default-product-locale,$(PRODUCT_LOCALES))" \
240 PRODUCT_DEFAULT_WIFI_CHANNELS="$(PRODUCT_DEFAULT_WIFI_CHANNELS)" \
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900241 PRIVATE_BUILD_DESC="$(BUILD_DESC)" \
Jiyong Parke1346862020-05-18 14:31:30 +0900242 BUILD_ID="$(BUILD_ID)" \
243 BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \
244 DATE="$(DATE_FROM_FILE)" \
245 BUILD_USERNAME="$(BUILD_USERNAME)" \
246 BUILD_HOSTNAME="$(BUILD_HOSTNAME)" \
247 BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \
248 BOARD_BUILD_SYSTEM_ROOT_IMAGE="$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)" \
249 PLATFORM_VERSION="$(PLATFORM_VERSION)" \
250 PLATFORM_VERSION_LAST_STABLE="$(PLATFORM_VERSION_LAST_STABLE)" \
251 PLATFORM_SECURITY_PATCH="$(PLATFORM_SECURITY_PATCH)" \
252 PLATFORM_BASE_OS="$(PLATFORM_BASE_OS)" \
253 PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \
254 PLATFORM_PREVIEW_SDK_VERSION="$(PLATFORM_PREVIEW_SDK_VERSION)" \
255 PLATFORM_PREVIEW_SDK_FINGERPRINT="$$(cat $(API_FINGERPRINT))" \
256 PLATFORM_VERSION_CODENAME="$(PLATFORM_VERSION_CODENAME)" \
257 PLATFORM_VERSION_ALL_CODENAMES="$(PLATFORM_VERSION_ALL_CODENAMES)" \
258 PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION="$(PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION)" \
259 BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \
260 $(if $(OEM_THUMBPRINT_PROPERTIES),BUILD_THUMBPRINT="$(BUILD_THUMBPRINT_FROM_FILE)") \
261 TARGET_CPU_ABI_LIST="$(TARGET_CPU_ABI_LIST)" \
262 TARGET_CPU_ABI_LIST_32_BIT="$(TARGET_CPU_ABI_LIST_32_BIT)" \
263 TARGET_CPU_ABI_LIST_64_BIT="$(TARGET_CPU_ABI_LIST_64_BIT)" \
264 TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \
265 TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900266 bash $(BUILDINFO_SH) > $@
Jiyong Parke1346862020-05-18 14:31:30 +0900267
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900268ifneq ($(PRODUCT_OEM_PROPERTIES),)
269import_oem_prop := $(call intermediates-dir-for,ETC,system_build_prop)/oem.prop
Jiyong Parke1346862020-05-18 14:31:30 +0900270
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900271$(import_oem_prop):
272 $(hide) echo "#" >> $@; \
273 echo "# PRODUCT_OEM_PROPERTIES" >> $@; \
274 echo "#" >> $@;
275 $(hide) $(foreach prop,$(PRODUCT_OEM_PROPERTIES), \
276 echo "import /oem/oem.prop $(prop)" >> $@;)
277else
278import_oem_prop :=
279endif
280
281ifdef TARGET_SYSTEM_PROP
282system_prop_file := $(TARGET_SYSTEM_PROP)
283else
284system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop)
285endif
286
287_prop_files_ := \
288 $(import_oem_prop) \
289 $(gen_from_buildinfo_sh) \
290 $(system_prop_file)
291
292# Order matters here. When there are duplicates, the last one wins.
293# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
294_prop_vars_ := \
295 ADDITIONAL_SYSTEM_PROPERTIES \
Jiyong Parkeb49b342020-05-29 17:50:03 +0900296 PRODUCT_SYSTEM_PROPERTIES
297
298# TODO(b/117892318): deprecate this
299_prop_vars_ += \
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900300 PRODUCT_SYSTEM_DEFAULT_PROPERTIES
301
302ifndef property_overrides_split_enabled
303_prop_vars_ += \
Garfield Tan04714da2020-08-13 15:21:32 -0700304 ADDITIONAL_VENDOR_PROPERTIES \
305 PRODUCT_VENDOR_PROPERTIES
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900306endif
307
308_blacklist_names_ := \
309 $(PRODUCT_SYSTEM_PROPERTY_BLACKLIST) \
310 ro.product.first_api_level
311
312INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop
313
314$(eval $(call build-properties,system,$(INSTALLED_BUILD_PROP_TARGET),\
315$(_prop_files_),$(_prop_vars_),\
316$(_blacklist_names_)))
317
Jiyong Parke1346862020-05-18 14:31:30 +0900318# -----------------------------------------------------------------
Jiyong Parke28fa802020-05-26 00:21:20 +0900319# vendor/build.prop
Jiyong Parke1346862020-05-18 14:31:30 +0900320#
Jiyong Parke28fa802020-05-26 00:21:20 +0900321_prop_files_ := $(if $(TARGET_VENDOR_PROP),\
322 $(TARGET_VENDOR_PROP),\
323 $(wildcard $(TARGET_DEVICE_DIR)/vendor.prop))
Jiyong Parke1346862020-05-18 14:31:30 +0900324
Jiyong Park3a2e95a2020-05-25 17:56:09 +0900325android_info_prop := $(call intermediates-dir-for,ETC,android_info_prop)/android_info.prop
326$(android_info_prop): $(INSTALLED_ANDROID_INFO_TXT_TARGET)
327 cat $< | grep 'require version-' | sed -e 's/require version-/ro.build.expect./g' > $@
328
Jiyong Parke28fa802020-05-26 00:21:20 +0900329_prop_files_ += $(android_info_pro)
Jiyong Park3a2e95a2020-05-25 17:56:09 +0900330
Jiyong Parke1346862020-05-18 14:31:30 +0900331ifdef property_overrides_split_enabled
Jiyong Parke28fa802020-05-26 00:21:20 +0900332# Order matters here. When there are duplicates, the last one wins.
333# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
334_prop_vars_ := \
335 ADDITIONAL_VENDOR_PROPERTIES \
Jiyong Parkeb49b342020-05-29 17:50:03 +0900336 PRODUCT_VENDOR_PROPERTIES
337
338# TODO(b/117892318): deprecate this
339_prop_vars_ += \
340 PRODUCT_DEFAULT_PROPERTY_OVERRIDES \
Jiyong Parke28fa802020-05-26 00:21:20 +0900341 PRODUCT_PROPERTY_OVERRIDES
Jiyong Parke1346862020-05-18 14:31:30 +0900342else
Jiyong Parke28fa802020-05-26 00:21:20 +0900343_prop_vars_ :=
Jiyong Parke1346862020-05-18 14:31:30 +0900344endif
345
Jiyong Parke28fa802020-05-26 00:21:20 +0900346INSTALLED_VENDOR_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR)/build.prop
347$(eval $(call build-properties,\
348 vendor,\
349 $(INSTALLED_VENDOR_BUILD_PROP_TARGET),\
350 $(_prop_files_),\
351 $(_prop_vars_),\
352 $(PRODUCT_VENDOR_PROPERTY_BLACKLIST)))
Jiyong Parke1346862020-05-18 14:31:30 +0900353
Jiyong Parke28fa802020-05-26 00:21:20 +0900354# -----------------------------------------------------------------
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900355# product/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900356#
357
358_prop_files_ := $(if $(TARGET_PRODUCT_PROP),\
359 $(TARGET_PRODUCT_PROP),\
360 $(wildcard $(TARGET_DEVICE_DIR)/product.prop))
361
362# Order matters here. When there are duplicates, the last one wins.
363# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
364_prop_vars_ := \
365 ADDITIONAL_PRODUCT_PROPERTIES \
366 PRODUCT_PRODUCT_PROPERTIES
367
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900368INSTALLED_PRODUCT_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT)/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900369$(eval $(call build-properties,\
370 product,\
371 $(INSTALLED_PRODUCT_BUILD_PROP_TARGET),\
372 $(_prop_files_),\
373 $(_prop_vars_),\
374 $(empty)))
Jiyong Parke1346862020-05-18 14:31:30 +0900375
376# ----------------------------------------------------------------
Jiyong Park62117c82020-06-26 09:56:31 +0900377# odm/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900378#
379_prop_files_ := $(if $(TARGET_ODM_PROP),\
380 $(TARGET_ODM_PROP),\
381 $(wildcard $(TARGET_DEVICE_DIR)/odm.prop))
Jiyong Parke1346862020-05-18 14:31:30 +0900382
Jiyong Parke28fa802020-05-26 00:21:20 +0900383# Order matters here. When there are duplicates, the last one wins.
384# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
385_prop_vars_ := \
386 ADDITIONAL_ODM_PROPERTIES \
387 PRODUCT_ODM_PROPERTIES
Jiyong Parke1346862020-05-18 14:31:30 +0900388
Jiyong Park62117c82020-06-26 09:56:31 +0900389INSTALLED_ODM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM)/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900390$(eval $(call build-properties,\
391 odm,\
392 $(INSTALLED_ODM_BUILD_PROP_TARGET),\
393 $(_prop_files),\
394 $(_prop_vars_),\
395 $(empty)))
Jiyong Parke1346862020-05-18 14:31:30 +0900396
Yifan Hong51a971b2020-06-25 17:00:27 -0700397# ----------------------------------------------------------------
398# vendor_dlkm/etc/build.prop
399#
400
401INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR_DLKM)/etc/build.prop
402$(eval $(call build-properties,\
403 vendor_dlkm,\
404 $(INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET)))
405
Yifan Hong81a092f2020-07-15 17:02:07 -0700406# ----------------------------------------------------------------
407# odm_dlkm/etc/build.prop
408#
409
410INSTALLED_ODM_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM_DLKM)/etc/build.prop
411$(eval $(call build-properties,\
412 odm_dlkm,\
413 $(INSTALLED_ODM_DLKM_BUILD_PROP_TARGET)))
414
Jiyong Parke1346862020-05-18 14:31:30 +0900415# -----------------------------------------------------------------
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900416# system_ext/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900417#
418_prop_files_ := $(if $(TARGET_SYSTEM_EXT_PROP),\
419 $(TARGET_SYSTEM_EXT_PROP),\
420 $(wildcard $(TARGET_DEVICE_DIR)/system_ext.prop))
421
422# Order matters here. When there are duplicates, the last one wins.
423# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
424_prop_vars_ := PRODUCT_SYSTEM_EXT_PROPERTIES
425
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900426INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET := $(TARGET_OUT_SYSTEM_EXT)/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900427$(eval $(call build-properties,\
428 system_ext,\
429 $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET),\
430 $(_prop_files_),\
431 $(_prop_vars_),\
432 $(empty)))
Yifan Hong33fd5d42020-09-24 18:18:26 -0700433
434# ----------------------------------------------------------------
435# ramdisk/boot/etc/build.prop
436#
437
438RAMDISK_BUILD_PROP_REL_PATH := system/etc/ramdisk/build.prop
439INSTALLED_RAMDISK_BUILD_PROP_TARGET := $(TARGET_RAMDISK_OUT)/$(RAMDISK_BUILD_PROP_REL_PATH)
440$(eval $(call build-properties,\
441 bootimage,\
442 $(INSTALLED_RAMDISK_BUILD_PROP_TARGET)))