blob: a74ff9fedcca74795792b3e69bac125c5cf951e3 [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);\
57 echo "ro.$(1).build.version.release=$(PLATFORM_VERSION)" >> $(2);\
58 echo "ro.$(1).build.version.sdk=$(PLATFORM_SDK_VERSION)" >> $(2);\
Jiyong Parke1346862020-05-18 14:31:30 +090059
Jiyong Parke1346862020-05-18 14:31:30 +090060endef
61
Jiyong Parkc0bd8c72020-06-29 10:46:22 +090062# Rule for generating <partition>/[etc/]build.prop file
Jiyong Parke28fa802020-05-26 00:21:20 +090063#
64# $(1): partition name
65# $(2): path to the output
66# $(3): path to the input *.prop files. The contents of the files are directly
67# emitted to the output
68# $(4): list of variable names each of which contains name=value pairs
69# $(5): optional list of prop names to force remove from the output. Properties from both
70# $(3) and (4) are affected.
71define build-properties
72ALL_DEFAULT_INSTALLED_MODULES += $(2)
73
Jiyong Parkd721e872020-06-22 17:30:57 +090074$(eval # Properties can be assigned using `prop ?= value` or `prop = value` syntax.)
75$(eval # Eliminate spaces around the ?= and = separators.)
Jiyong Parke28fa802020-05-26 00:21:20 +090076$(foreach name,$(strip $(4)),\
Jiyong Parkd721e872020-06-22 17:30:57 +090077 $(eval _temp := $$(call collapse-pairs,$$($(name)),?=))\
78 $(eval _resolved_$(name) := $$(call collapse-pairs,$$(_temp),=))\
Jiyong Parke28fa802020-05-26 00:21:20 +090079)
80
Jiyong Park0b4fccb2020-06-26 17:38:00 +090081$(eval # Implement the legacy behavior when BUILD_BROKEN_DUP_SYSPROP is on.)
82$(eval # Optional assignments are all converted to normal assignments and)
83$(eval # when their duplicates the first one wins)
84$(if $(filter true,$(BUILD_BROKEN_DUP_SYSPROP)),\
85 $(foreach name,$(strip $(4)),\
86 $(eval _temp := $$(subst ?=,=,$$(_resolved_$(name))))\
87 $(eval _resolved_$(name) := $$(call uniq-pairs-by-first-component,$$(_resolved_$(name)),=))\
88 )\
89 $(eval _option := --allow-dup)\
Jiyong Parke28fa802020-05-26 00:21:20 +090090)
91
Jiyong Park35a83d12020-05-26 02:01:05 +090092$(2): $(POST_PROCESS_PROPS) $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) $(3)
Jiyong Parke28fa802020-05-26 00:21:20 +090093 $(hide) echo Building $$@
94 $(hide) mkdir -p $$(dir $$@)
95 $(hide) rm -f $$@ && touch $$@
96 $(hide) $$(call generate-common-build-props,$(call to-lower,$(strip $(1))),$$@)
97 $(hide) $(foreach file,$(strip $(3)),\
98 if [ -f "$(file)" ]; then\
99 echo "" >> $$@;\
100 echo "####################################" >> $$@;\
101 echo "# from $(file)" >> $$@;\
102 echo "####################################" >> $$@;\
103 cat $(file) >> $$@;\
104 fi;)
105 $(hide) $(foreach name,$(strip $(4)),\
106 echo "" >> $$@;\
107 echo "####################################" >> $$@;\
108 echo "# from variable $(name)" >> $$@;\
109 echo "####################################" >> $$@;\
110 $$(foreach line,$$(_resolved_$(name)),\
111 echo "$$(line)" >> $$@;\
112 )\
113 )
Jiyong Park0b4fccb2020-06-26 17:38:00 +0900114 $(hide) $(POST_PROCESS_PROPS) $$(_option) $$@ $(5)
Jiyong Parke28fa802020-05-26 00:21:20 +0900115 $(hide) echo "# end of file" >> $$@
116endef
117
Jiyong Parke1346862020-05-18 14:31:30 +0900118# -----------------------------------------------------------------
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900119# Define fingerprint, thumbprint, and version tags for the current build
Jiyong Parke28fa802020-05-26 00:21:20 +0900120#
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900121# BUILD_VERSION_TAGS is a comma-separated list of tags chosen by the device
122# implementer that further distinguishes the build. It's basically defined
123# by the device implementer. Here, we are adding a mandatory tag that
124# identifies the signing config of the build.
Jiyong Parke1346862020-05-18 14:31:30 +0900125BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS)
126ifeq ($(TARGET_BUILD_TYPE),debug)
127 BUILD_VERSION_TAGS += debug
128endif
129# The "test-keys" tag marks builds signed with the old test keys,
130# which are available in the SDK. "dev-keys" marks builds signed with
131# non-default dev keys (usually private keys from a vendor directory).
132# Both of these tags will be removed and replaced with "release-keys"
133# when the target-files is signed in a post-build step.
134ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/make/target/product/security/testkey)
135BUILD_KEYS := test-keys
136else
137BUILD_KEYS := dev-keys
138endif
139BUILD_VERSION_TAGS += $(BUILD_KEYS)
140BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))
141
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900142# BUILD_FINGERPRINT is used used to uniquely identify the combined build and
143# product; used by the OTA server.
Jiyong Parke1346862020-05-18 14:31:30 +0900144ifeq (,$(strip $(BUILD_FINGERPRINT)))
145 ifeq ($(strip $(HAS_BUILD_NUMBER)),false)
146 BF_BUILD_NUMBER := $(BUILD_USERNAME)$$($(DATE_FROM_FILE) +%m%d%H%M)
147 else
148 BF_BUILD_NUMBER := $(file <$(BUILD_NUMBER_FILE))
149 endif
150 BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
151endif
152# unset it for safety.
153BF_BUILD_NUMBER :=
154
155BUILD_FINGERPRINT_FILE := $(PRODUCT_OUT)/build_fingerprint.txt
156ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_FINGERPRINT) >$(BUILD_FINGERPRINT_FILE) && grep " " $(BUILD_FINGERPRINT_FILE)))
157 $(error BUILD_FINGERPRINT cannot contain spaces: "$(file <$(BUILD_FINGERPRINT_FILE))")
158endif
159BUILD_FINGERPRINT_FROM_FILE := $$(cat $(BUILD_FINGERPRINT_FILE))
160# unset it for safety.
161BUILD_FINGERPRINT :=
162
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900163# BUILD_THUMBPRINT is used to uniquely identify the system build; used by the
164# OTA server. This purposefully excludes any product-specific variables.
Jiyong Parke1346862020-05-18 14:31:30 +0900165ifeq (,$(strip $(BUILD_THUMBPRINT)))
166 BUILD_THUMBPRINT := $(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER_FROM_FILE):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
167endif
168
169BUILD_THUMBPRINT_FILE := $(PRODUCT_OUT)/build_thumbprint.txt
170ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_THUMBPRINT) >$(BUILD_THUMBPRINT_FILE) && grep " " $(BUILD_THUMBPRINT_FILE)))
171 $(error BUILD_THUMBPRINT cannot contain spaces: "$(file <$(BUILD_THUMBPRINT_FILE))")
172endif
173BUILD_THUMBPRINT_FROM_FILE := $$(cat $(BUILD_THUMBPRINT_FILE))
174# unset it for safety.
175BUILD_THUMBPRINT :=
176
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900177# -----------------------------------------------------------------
178# Define human readable strings that describe this build
179#
Jiyong Parke1346862020-05-18 14:31:30 +0900180
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900181# BUILD_ID: detail info; has the same info as the build fingerprint
182BUILD_DESC := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) $(PLATFORM_VERSION) $(BUILD_ID) $(BUILD_NUMBER_FROM_FILE) $(BUILD_VERSION_TAGS)
183
184# BUILD_DISPLAY_ID is shown under Settings -> About Phone
Jiyong Parke1346862020-05-18 14:31:30 +0900185ifeq ($(TARGET_BUILD_VARIANT),user)
186 # User builds should show:
187 # release build number or branch.buld_number non-release builds
188
189 # Dev. branches should have DISPLAY_BUILD_NUMBER set
190 ifeq (true,$(DISPLAY_BUILD_NUMBER))
191 BUILD_DISPLAY_ID := $(BUILD_ID).$(BUILD_NUMBER_FROM_FILE) $(BUILD_KEYS)
192 else
193 BUILD_DISPLAY_ID := $(BUILD_ID) $(BUILD_KEYS)
194 endif
195else
196 # Non-user builds should show detailed build information
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900197 BUILD_DISPLAY_ID := $(BUILD_DESC)
Jiyong Parke1346862020-05-18 14:31:30 +0900198endif
199
Jiyong Parke1346862020-05-18 14:31:30 +0900200# TARGET_BUILD_FLAVOR and ro.build.flavor are used only by the test
201# harness to distinguish builds. Only add _asan for a sanitized build
202# if it isn't already a part of the flavor (via a dedicated lunch
203# config for example).
204TARGET_BUILD_FLAVOR := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)
205ifneq (, $(filter address, $(SANITIZE_TARGET)))
206ifeq (,$(findstring _asan,$(TARGET_BUILD_FLAVOR)))
207TARGET_BUILD_FLAVOR := $(TARGET_BUILD_FLAVOR)_asan
208endif
209endif
210
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900211KNOWN_OEM_THUMBPRINT_PROPERTIES := \
212 ro.product.brand \
213 ro.product.name \
214 ro.product.device
215OEM_THUMBPRINT_PROPERTIES := $(filter $(KNOWN_OEM_THUMBPRINT_PROPERTIES),\
216 $(PRODUCT_OEM_PROPERTIES))
217KNOWN_OEM_THUMBPRINT_PROPERTIES:=
218
219# -----------------------------------------------------------------
220# system/build.prop
221#
222# Note: parts of this file that can't be generated by the build-properties
223# macro are manually created as separate files and then fed into the macro
224
225# Accepts a whitespace separated list of product locales such as
226# (en_US en_AU en_GB...) and returns the first locale in the list with
227# underscores replaced with hyphens. In the example above, this will
228# return "en-US".
229define get-default-product-locale
230$(strip $(subst _,-, $(firstword $(1))))
231endef
232
Jiyong Parkc60c5142020-07-14 15:15:50 +0900233gen_from_buildinfo_sh := $(call intermediates-dir-for,PACKAGING,system_build_prop)/buildinfo.prop
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900234$(gen_from_buildinfo_sh): $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT)
Jiyong Parke1346862020-05-18 14:31:30 +0900235 $(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \
236 TARGET_BUILD_FLAVOR="$(TARGET_BUILD_FLAVOR)" \
237 TARGET_DEVICE="$(TARGET_DEVICE)" \
238 PRODUCT_DEFAULT_LOCALE="$(call get-default-product-locale,$(PRODUCT_LOCALES))" \
239 PRODUCT_DEFAULT_WIFI_CHANNELS="$(PRODUCT_DEFAULT_WIFI_CHANNELS)" \
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900240 PRIVATE_BUILD_DESC="$(BUILD_DESC)" \
Jiyong Parke1346862020-05-18 14:31:30 +0900241 BUILD_ID="$(BUILD_ID)" \
242 BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \
243 DATE="$(DATE_FROM_FILE)" \
244 BUILD_USERNAME="$(BUILD_USERNAME)" \
245 BUILD_HOSTNAME="$(BUILD_HOSTNAME)" \
246 BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \
247 BOARD_BUILD_SYSTEM_ROOT_IMAGE="$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)" \
248 PLATFORM_VERSION="$(PLATFORM_VERSION)" \
249 PLATFORM_VERSION_LAST_STABLE="$(PLATFORM_VERSION_LAST_STABLE)" \
250 PLATFORM_SECURITY_PATCH="$(PLATFORM_SECURITY_PATCH)" \
251 PLATFORM_BASE_OS="$(PLATFORM_BASE_OS)" \
252 PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \
253 PLATFORM_PREVIEW_SDK_VERSION="$(PLATFORM_PREVIEW_SDK_VERSION)" \
254 PLATFORM_PREVIEW_SDK_FINGERPRINT="$$(cat $(API_FINGERPRINT))" \
255 PLATFORM_VERSION_CODENAME="$(PLATFORM_VERSION_CODENAME)" \
256 PLATFORM_VERSION_ALL_CODENAMES="$(PLATFORM_VERSION_ALL_CODENAMES)" \
257 PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION="$(PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION)" \
258 BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \
259 $(if $(OEM_THUMBPRINT_PROPERTIES),BUILD_THUMBPRINT="$(BUILD_THUMBPRINT_FROM_FILE)") \
260 TARGET_CPU_ABI_LIST="$(TARGET_CPU_ABI_LIST)" \
261 TARGET_CPU_ABI_LIST_32_BIT="$(TARGET_CPU_ABI_LIST_32_BIT)" \
262 TARGET_CPU_ABI_LIST_64_BIT="$(TARGET_CPU_ABI_LIST_64_BIT)" \
263 TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \
264 TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900265 bash $(BUILDINFO_SH) > $@
Jiyong Parke1346862020-05-18 14:31:30 +0900266
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900267ifneq ($(PRODUCT_OEM_PROPERTIES),)
268import_oem_prop := $(call intermediates-dir-for,ETC,system_build_prop)/oem.prop
Jiyong Parke1346862020-05-18 14:31:30 +0900269
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900270$(import_oem_prop):
271 $(hide) echo "#" >> $@; \
272 echo "# PRODUCT_OEM_PROPERTIES" >> $@; \
273 echo "#" >> $@;
274 $(hide) $(foreach prop,$(PRODUCT_OEM_PROPERTIES), \
275 echo "import /oem/oem.prop $(prop)" >> $@;)
276else
277import_oem_prop :=
278endif
279
280ifdef TARGET_SYSTEM_PROP
281system_prop_file := $(TARGET_SYSTEM_PROP)
282else
283system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop)
284endif
285
286_prop_files_ := \
287 $(import_oem_prop) \
288 $(gen_from_buildinfo_sh) \
289 $(system_prop_file)
290
291# Order matters here. When there are duplicates, the last one wins.
292# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
293_prop_vars_ := \
294 ADDITIONAL_SYSTEM_PROPERTIES \
Jiyong Parkeb49b342020-05-29 17:50:03 +0900295 PRODUCT_SYSTEM_PROPERTIES
296
297# TODO(b/117892318): deprecate this
298_prop_vars_ += \
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900299 PRODUCT_SYSTEM_DEFAULT_PROPERTIES
300
301ifndef property_overrides_split_enabled
302_prop_vars_ += \
Garfield Tan04714da2020-08-13 15:21:32 -0700303 ADDITIONAL_VENDOR_PROPERTIES \
304 PRODUCT_VENDOR_PROPERTIES
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900305endif
306
307_blacklist_names_ := \
308 $(PRODUCT_SYSTEM_PROPERTY_BLACKLIST) \
309 ro.product.first_api_level
310
311INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop
312
313$(eval $(call build-properties,system,$(INSTALLED_BUILD_PROP_TARGET),\
314$(_prop_files_),$(_prop_vars_),\
315$(_blacklist_names_)))
316
Jiyong Parke1346862020-05-18 14:31:30 +0900317# -----------------------------------------------------------------
Jiyong Parke28fa802020-05-26 00:21:20 +0900318# vendor/build.prop
Jiyong Parke1346862020-05-18 14:31:30 +0900319#
Jiyong Parke28fa802020-05-26 00:21:20 +0900320_prop_files_ := $(if $(TARGET_VENDOR_PROP),\
321 $(TARGET_VENDOR_PROP),\
322 $(wildcard $(TARGET_DEVICE_DIR)/vendor.prop))
Jiyong Parke1346862020-05-18 14:31:30 +0900323
Jiyong Park3a2e95a2020-05-25 17:56:09 +0900324android_info_prop := $(call intermediates-dir-for,ETC,android_info_prop)/android_info.prop
325$(android_info_prop): $(INSTALLED_ANDROID_INFO_TXT_TARGET)
326 cat $< | grep 'require version-' | sed -e 's/require version-/ro.build.expect./g' > $@
327
Jiyong Parke28fa802020-05-26 00:21:20 +0900328_prop_files_ += $(android_info_pro)
Jiyong Park3a2e95a2020-05-25 17:56:09 +0900329
Jiyong Parke1346862020-05-18 14:31:30 +0900330ifdef property_overrides_split_enabled
Jiyong Parke28fa802020-05-26 00:21:20 +0900331# Order matters here. When there are duplicates, the last one wins.
332# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
333_prop_vars_ := \
334 ADDITIONAL_VENDOR_PROPERTIES \
Jiyong Parkeb49b342020-05-29 17:50:03 +0900335 PRODUCT_VENDOR_PROPERTIES
336
337# TODO(b/117892318): deprecate this
338_prop_vars_ += \
339 PRODUCT_DEFAULT_PROPERTY_OVERRIDES \
Jiyong Parke28fa802020-05-26 00:21:20 +0900340 PRODUCT_PROPERTY_OVERRIDES
Jiyong Parke1346862020-05-18 14:31:30 +0900341else
Jiyong Parke28fa802020-05-26 00:21:20 +0900342_prop_vars_ :=
Jiyong Parke1346862020-05-18 14:31:30 +0900343endif
344
Jiyong Parke28fa802020-05-26 00:21:20 +0900345INSTALLED_VENDOR_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR)/build.prop
346$(eval $(call build-properties,\
347 vendor,\
348 $(INSTALLED_VENDOR_BUILD_PROP_TARGET),\
349 $(_prop_files_),\
350 $(_prop_vars_),\
351 $(PRODUCT_VENDOR_PROPERTY_BLACKLIST)))
Jiyong Parke1346862020-05-18 14:31:30 +0900352
Jiyong Parke28fa802020-05-26 00:21:20 +0900353# -----------------------------------------------------------------
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900354# product/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900355#
356
357_prop_files_ := $(if $(TARGET_PRODUCT_PROP),\
358 $(TARGET_PRODUCT_PROP),\
359 $(wildcard $(TARGET_DEVICE_DIR)/product.prop))
360
361# Order matters here. When there are duplicates, the last one wins.
362# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
363_prop_vars_ := \
364 ADDITIONAL_PRODUCT_PROPERTIES \
365 PRODUCT_PRODUCT_PROPERTIES
366
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900367INSTALLED_PRODUCT_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT)/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900368$(eval $(call build-properties,\
369 product,\
370 $(INSTALLED_PRODUCT_BUILD_PROP_TARGET),\
371 $(_prop_files_),\
372 $(_prop_vars_),\
373 $(empty)))
Jiyong Parke1346862020-05-18 14:31:30 +0900374
375# ----------------------------------------------------------------
Jiyong Park62117c82020-06-26 09:56:31 +0900376# odm/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900377#
378_prop_files_ := $(if $(TARGET_ODM_PROP),\
379 $(TARGET_ODM_PROP),\
380 $(wildcard $(TARGET_DEVICE_DIR)/odm.prop))
Jiyong Parke1346862020-05-18 14:31:30 +0900381
Jiyong Parke28fa802020-05-26 00:21:20 +0900382# Order matters here. When there are duplicates, the last one wins.
383# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
384_prop_vars_ := \
385 ADDITIONAL_ODM_PROPERTIES \
386 PRODUCT_ODM_PROPERTIES
Jiyong Parke1346862020-05-18 14:31:30 +0900387
Jiyong Park62117c82020-06-26 09:56:31 +0900388INSTALLED_ODM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM)/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900389$(eval $(call build-properties,\
390 odm,\
391 $(INSTALLED_ODM_BUILD_PROP_TARGET),\
392 $(_prop_files),\
393 $(_prop_vars_),\
394 $(empty)))
Jiyong Parke1346862020-05-18 14:31:30 +0900395
Yifan Hong51a971b2020-06-25 17:00:27 -0700396# ----------------------------------------------------------------
397# vendor_dlkm/etc/build.prop
398#
399
400INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR_DLKM)/etc/build.prop
401$(eval $(call build-properties,\
402 vendor_dlkm,\
403 $(INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET)))
404
Yifan Hong81a092f2020-07-15 17:02:07 -0700405# ----------------------------------------------------------------
406# odm_dlkm/etc/build.prop
407#
408
409INSTALLED_ODM_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM_DLKM)/etc/build.prop
410$(eval $(call build-properties,\
411 odm_dlkm,\
412 $(INSTALLED_ODM_DLKM_BUILD_PROP_TARGET)))
413
Jiyong Parke1346862020-05-18 14:31:30 +0900414# -----------------------------------------------------------------
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900415# system_ext/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900416#
417_prop_files_ := $(if $(TARGET_SYSTEM_EXT_PROP),\
418 $(TARGET_SYSTEM_EXT_PROP),\
419 $(wildcard $(TARGET_DEVICE_DIR)/system_ext.prop))
420
421# Order matters here. When there are duplicates, the last one wins.
422# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
423_prop_vars_ := PRODUCT_SYSTEM_EXT_PROPERTIES
424
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900425INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET := $(TARGET_OUT_SYSTEM_EXT)/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900426$(eval $(call build-properties,\
427 system_ext,\
428 $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET),\
429 $(_prop_files_),\
430 $(_prop_vars_),\
431 $(empty)))
Yifan Hong33fd5d42020-09-24 18:18:26 -0700432
433# ----------------------------------------------------------------
434# ramdisk/boot/etc/build.prop
435#
436
437RAMDISK_BUILD_PROP_REL_PATH := system/etc/ramdisk/build.prop
438INSTALLED_RAMDISK_BUILD_PROP_TARGET := $(TARGET_RAMDISK_OUT)/$(RAMDISK_BUILD_PROP_REL_PATH)
439$(eval $(call build-properties,\
440 bootimage,\
441 $(INSTALLED_RAMDISK_BUILD_PROP_TARGET)))