blob: 7dd756a158060159021b34681320c1b922d6f4d1 [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 Parkae556382020-05-20 18:33:43 +090026POST_PROCESS_PROPS := $(HOST_OUT_EXECUTABLES)/post_process_props$(HOST_EXECUTABLE_SUFFIX)
Jiyong Parke1346862020-05-18 14:31:30 +090027
Jiyong Park35a83d12020-05-26 02:01:05 +090028# Emits a set of sysprops common to all partitions to a file.
Jiyong Parke1346862020-05-18 14:31:30 +090029# $(1): Partition name
30# $(2): Output file name
31define generate-common-build-props
Jiyong Park35a83d12020-05-26 02:01:05 +090032 echo "####################################" >> $(2);\
33 echo "# from generate-common-build-props" >> $(2);\
34 echo "# These properties identify this partition image." >> $(2);\
35 echo "####################################" >> $(2);\
Inseob Kimb97c96b2024-07-31 02:00:41 +000036 echo "ro.product.$(1).brand=$(PRODUCT_BRAND)" >> $(2);\
37 echo "ro.product.$(1).device=$(TARGET_DEVICE)" >> $(2);\
38 echo "ro.product.$(1).manufacturer=$(PRODUCT_MANUFACTURER)" >> $(2);\
39 echo "ro.product.$(1).model=$(PRODUCT_MODEL)" >> $(2);\
40 echo "ro.product.$(1).name=$(TARGET_PRODUCT)" >> $(2);\
41 if [ -n "$(strip $(PRODUCT_MODEL_FOR_ATTESTATION))" ]; then \
42 echo "ro.product.model_for_attestation=$(PRODUCT_MODEL_FOR_ATTESTATION)" >> $(2);\
43 fi; \
44 if [ -n "$(strip $(PRODUCT_BRAND_FOR_ATTESTATION))" ]; then \
45 echo "ro.product.brand_for_attestation=$(PRODUCT_BRAND_FOR_ATTESTATION)" >> $(2);\
46 fi; \
47 if [ -n "$(strip $(PRODUCT_NAME_FOR_ATTESTATION))" ]; then \
48 echo "ro.product.name_for_attestation=$(PRODUCT_NAME_FOR_ATTESTATION)" >> $(2);\
49 fi; \
50 if [ -n "$(strip $(PRODUCT_DEVICE_FOR_ATTESTATION))" ]; then \
51 echo "ro.product.device_for_attestation=$(PRODUCT_DEVICE_FOR_ATTESTATION)" >> $(2);\
52 fi; \
53 if [ -n "$(strip $(PRODUCT_MANUFACTURER_FOR_ATTESTATION))" ]; then \
54 echo "ro.product.manufacturer_for_attestation=$(PRODUCT_MANUFACTURER_FOR_ATTESTATION)" >> $(2);\
55 fi; \
Christopher Ferris66b6fd62022-04-08 15:20:23 -070056 $(if $(filter true,$(ZYGOTE_FORCE_64)),\
57 $(if $(filter vendor,$(1)),\
58 echo "ro.$(1).product.cpu.abilist=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\
59 echo "ro.$(1).product.cpu.abilist32=" >> $(2);\
60 echo "ro.$(1).product.cpu.abilist64=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\
61 )\
62 ,\
63 $(if $(filter system vendor odm,$(1)),\
64 echo "ro.$(1).product.cpu.abilist=$(TARGET_CPU_ABI_LIST)" >> $(2);\
65 echo "ro.$(1).product.cpu.abilist32=$(TARGET_CPU_ABI_LIST_32_BIT)" >> $(2);\
66 echo "ro.$(1).product.cpu.abilist64=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\
67 )\
SzuWei Linbaf5c812020-12-31 16:59:27 +080068 )\
Jiyong Park35a83d12020-05-26 02:01:05 +090069 echo "ro.$(1).build.date=`$(DATE_FROM_FILE)`" >> $(2);\
70 echo "ro.$(1).build.date.utc=`$(DATE_FROM_FILE) +%s`" >> $(2);\
Tiffany Yang19450e32023-05-23 17:36:54 -070071 # Allow optional assignments for ARC forward-declarations (b/249168657)
72 # TODO: Remove any tag-related inconsistencies once the goals from
73 # go/arc-android-sigprop-changes have been achieved.
74 echo "ro.$(1).build.fingerprint?=$(BUILD_FINGERPRINT_FROM_FILE)" >> $(2);\
75 echo "ro.$(1).build.id?=$(BUILD_ID)" >> $(2);\
76 echo "ro.$(1).build.tags?=$(BUILD_VERSION_TAGS)" >> $(2);\
Jiyong Park35a83d12020-05-26 02:01:05 +090077 echo "ro.$(1).build.type=$(TARGET_BUILD_VARIANT)" >> $(2);\
78 echo "ro.$(1).build.version.incremental=$(BUILD_NUMBER_FROM_FILE)" >> $(2);\
Tianjiee88ac672020-10-15 17:22:48 -070079 echo "ro.$(1).build.version.release=$(PLATFORM_VERSION_LAST_STABLE)" >> $(2);\
80 echo "ro.$(1).build.version.release_or_codename=$(PLATFORM_VERSION)" >> $(2);\
Jiyong Park35a83d12020-05-26 02:01:05 +090081 echo "ro.$(1).build.version.sdk=$(PLATFORM_SDK_VERSION)" >> $(2);\
Jiyong Parke1346862020-05-18 14:31:30 +090082
Jiyong Parke1346862020-05-18 14:31:30 +090083endef
84
Jiyong Parkc0bd8c72020-06-29 10:46:22 +090085# Rule for generating <partition>/[etc/]build.prop file
Jiyong Parke28fa802020-05-26 00:21:20 +090086#
87# $(1): partition name
88# $(2): path to the output
89# $(3): path to the input *.prop files. The contents of the files are directly
90# emitted to the output
91# $(4): list of variable names each of which contains name=value pairs
92# $(5): optional list of prop names to force remove from the output. Properties from both
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +010093# $(3) and (4) are affected
94# $(6): optional list of files to append at the end. The content of each file is emitted
95# to the output
Oleksiy Avramchenkod3d0f7d2020-12-15 14:38:32 +010096# $(7): optional flag to skip common properties generation
Jiyong Parke28fa802020-05-26 00:21:20 +090097define build-properties
98ALL_DEFAULT_INSTALLED_MODULES += $(2)
99
Jiyong Parkd721e872020-06-22 17:30:57 +0900100$(eval # Properties can be assigned using `prop ?= value` or `prop = value` syntax.)
101$(eval # Eliminate spaces around the ?= and = separators.)
Jiyong Parke28fa802020-05-26 00:21:20 +0900102$(foreach name,$(strip $(4)),\
Jiyong Parkd721e872020-06-22 17:30:57 +0900103 $(eval _temp := $$(call collapse-pairs,$$($(name)),?=))\
104 $(eval _resolved_$(name) := $$(call collapse-pairs,$$(_temp),=))\
Jiyong Parke28fa802020-05-26 00:21:20 +0900105)
106
Jiyong Park0b4fccb2020-06-26 17:38:00 +0900107$(eval # Implement the legacy behavior when BUILD_BROKEN_DUP_SYSPROP is on.)
108$(eval # Optional assignments are all converted to normal assignments and)
109$(eval # when their duplicates the first one wins)
110$(if $(filter true,$(BUILD_BROKEN_DUP_SYSPROP)),\
111 $(foreach name,$(strip $(4)),\
112 $(eval _temp := $$(subst ?=,=,$$(_resolved_$(name))))\
113 $(eval _resolved_$(name) := $$(call uniq-pairs-by-first-component,$$(_resolved_$(name)),=))\
114 )\
115 $(eval _option := --allow-dup)\
Jiyong Parke28fa802020-05-26 00:21:20 +0900116)
117
Jiakai Zhang53dd8952024-01-18 17:22:13 +0000118$(2): $(POST_PROCESS_PROPS) $(INTERNAL_BUILD_ID_MAKEFILE) $(3) $(6) $(BUILT_KERNEL_VERSION_FILE_FOR_UFFD_GC)
Jiyong Parke28fa802020-05-26 00:21:20 +0900119 $(hide) echo Building $$@
120 $(hide) mkdir -p $$(dir $$@)
121 $(hide) rm -f $$@ && touch $$@
Oleksiy Avramchenkod3d0f7d2020-12-15 14:38:32 +0100122ifneq ($(strip $(7)), true)
Jiyong Parke28fa802020-05-26 00:21:20 +0900123 $(hide) $$(call generate-common-build-props,$(call to-lower,$(strip $(1))),$$@)
Oleksiy Avramchenkod3d0f7d2020-12-15 14:38:32 +0100124endif
Jiyong Parke28fa802020-05-26 00:21:20 +0900125 $(hide) $(foreach file,$(strip $(3)),\
126 if [ -f "$(file)" ]; then\
127 echo "" >> $$@;\
128 echo "####################################" >> $$@;\
129 echo "# from $(file)" >> $$@;\
130 echo "####################################" >> $$@;\
131 cat $(file) >> $$@;\
132 fi;)
133 $(hide) $(foreach name,$(strip $(4)),\
134 echo "" >> $$@;\
135 echo "####################################" >> $$@;\
136 echo "# from variable $(name)" >> $$@;\
137 echo "####################################" >> $$@;\
138 $$(foreach line,$$(_resolved_$(name)),\
139 echo "$$(line)" >> $$@;\
140 )\
141 )
Jiakai Zhang53dd8952024-01-18 17:22:13 +0000142 $(hide) $(POST_PROCESS_PROPS) $$(_option) \
143 --sdk-version $(PLATFORM_SDK_VERSION) \
144 --kernel-version-file-for-uffd-gc "$(BUILT_KERNEL_VERSION_FILE_FOR_UFFD_GC)" \
145 $$@ $(5)
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100146 $(hide) $(foreach file,$(strip $(6)),\
147 if [ -f "$(file)" ]; then\
148 cat $(file) >> $$@;\
149 fi;)
Jiyong Parke28fa802020-05-26 00:21:20 +0900150 $(hide) echo "# end of file" >> $$@
Bob Badoure9bdbc52022-03-10 11:31:07 -0800151
Bob Badour1d31e2d2023-03-01 10:31:25 -0800152$(call declare-1p-target,$(2))
Jiyong Parke28fa802020-05-26 00:21:20 +0900153endef
154
Jiyong Parke1346862020-05-18 14:31:30 +0900155# -----------------------------------------------------------------
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900156# Define fingerprint, thumbprint, and version tags for the current build
Jiyong Parke28fa802020-05-26 00:21:20 +0900157#
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900158# BUILD_VERSION_TAGS is a comma-separated list of tags chosen by the device
159# implementer that further distinguishes the build. It's basically defined
160# by the device implementer. Here, we are adding a mandatory tag that
161# identifies the signing config of the build.
Jiyong Parke1346862020-05-18 14:31:30 +0900162BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS)
163ifeq ($(TARGET_BUILD_TYPE),debug)
164 BUILD_VERSION_TAGS += debug
165endif
166# The "test-keys" tag marks builds signed with the old test keys,
167# which are available in the SDK. "dev-keys" marks builds signed with
168# non-default dev keys (usually private keys from a vendor directory).
169# Both of these tags will be removed and replaced with "release-keys"
170# when the target-files is signed in a post-build step.
171ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/make/target/product/security/testkey)
172BUILD_KEYS := test-keys
173else
174BUILD_KEYS := dev-keys
175endif
176BUILD_VERSION_TAGS += $(BUILD_KEYS)
177BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))
178
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900179# BUILD_FINGERPRINT is used used to uniquely identify the combined build and
180# product; used by the OTA server.
Jiyong Parke1346862020-05-18 14:31:30 +0900181ifeq (,$(strip $(BUILD_FINGERPRINT)))
Cole Faustc874c702023-09-27 13:44:56 -0700182 BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER_FROM_FILE):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
Jiyong Parke1346862020-05-18 14:31:30 +0900183endif
Jiyong Parke1346862020-05-18 14:31:30 +0900184
185BUILD_FINGERPRINT_FILE := $(PRODUCT_OUT)/build_fingerprint.txt
186ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_FINGERPRINT) >$(BUILD_FINGERPRINT_FILE) && grep " " $(BUILD_FINGERPRINT_FILE)))
187 $(error BUILD_FINGERPRINT cannot contain spaces: "$(file <$(BUILD_FINGERPRINT_FILE))")
188endif
189BUILD_FINGERPRINT_FROM_FILE := $$(cat $(BUILD_FINGERPRINT_FILE))
190# unset it for safety.
191BUILD_FINGERPRINT :=
192
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900193# BUILD_THUMBPRINT is used to uniquely identify the system build; used by the
194# OTA server. This purposefully excludes any product-specific variables.
Jiyong Parke1346862020-05-18 14:31:30 +0900195ifeq (,$(strip $(BUILD_THUMBPRINT)))
196 BUILD_THUMBPRINT := $(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER_FROM_FILE):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
197endif
198
199BUILD_THUMBPRINT_FILE := $(PRODUCT_OUT)/build_thumbprint.txt
Jeongik Cha05210f92023-04-27 11:05:22 +0900200ifeq ($(strip $(HAS_BUILD_NUMBER)),true)
201$(BUILD_THUMBPRINT_FILE): $(BUILD_NUMBER_FILE)
202endif
Jiyong Parke1346862020-05-18 14:31:30 +0900203ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_THUMBPRINT) >$(BUILD_THUMBPRINT_FILE) && grep " " $(BUILD_THUMBPRINT_FILE)))
204 $(error BUILD_THUMBPRINT cannot contain spaces: "$(file <$(BUILD_THUMBPRINT_FILE))")
205endif
Jiyong Parke1346862020-05-18 14:31:30 +0900206# unset it for safety.
Inseob Kim06d22312024-03-27 05:19:56 +0000207BUILD_THUMBPRINT_FILE :=
Jiyong Parke1346862020-05-18 14:31:30 +0900208BUILD_THUMBPRINT :=
209
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900210KNOWN_OEM_THUMBPRINT_PROPERTIES := \
211 ro.product.brand \
212 ro.product.name \
213 ro.product.device
214OEM_THUMBPRINT_PROPERTIES := $(filter $(KNOWN_OEM_THUMBPRINT_PROPERTIES),\
215 $(PRODUCT_OEM_PROPERTIES))
216KNOWN_OEM_THUMBPRINT_PROPERTIES:=
217
218# -----------------------------------------------------------------
219# system/build.prop
220#
Inseob Kimb97c96b2024-07-31 02:00:41 +0000221# system/build.prop is built by Soong. See system-build.prop module in
222# build/soong/Android.bp.
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900223
Jiyong Parkbb26c6f2020-05-26 03:18:36 +0900224INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop
225
Jiyong Parke1346862020-05-18 14:31:30 +0900226# -----------------------------------------------------------------
Jiyong Parke28fa802020-05-26 00:21:20 +0900227# vendor/build.prop
Jiyong Parke1346862020-05-18 14:31:30 +0900228#
Jiyong Parke28fa802020-05-26 00:21:20 +0900229_prop_files_ := $(if $(TARGET_VENDOR_PROP),\
230 $(TARGET_VENDOR_PROP),\
231 $(wildcard $(TARGET_DEVICE_DIR)/vendor.prop))
Jiyong Parke1346862020-05-18 14:31:30 +0900232
Jiyong Park3a2e95a2020-05-25 17:56:09 +0900233android_info_prop := $(call intermediates-dir-for,ETC,android_info_prop)/android_info.prop
234$(android_info_prop): $(INSTALLED_ANDROID_INFO_TXT_TARGET)
235 cat $< | grep 'require version-' | sed -e 's/require version-/ro.build.expect./g' > $@
236
Donghyun Jo8c65ef62021-03-02 08:51:03 +0900237_prop_files_ += $(android_info_prop)
Jiyong Park3a2e95a2020-05-25 17:56:09 +0900238
Jiyong Parke1346862020-05-18 14:31:30 +0900239ifdef property_overrides_split_enabled
Jiyong Parke28fa802020-05-26 00:21:20 +0900240# Order matters here. When there are duplicates, the last one wins.
241# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
242_prop_vars_ := \
243 ADDITIONAL_VENDOR_PROPERTIES \
Jiyong Parkeb49b342020-05-29 17:50:03 +0900244 PRODUCT_VENDOR_PROPERTIES
245
246# TODO(b/117892318): deprecate this
247_prop_vars_ += \
248 PRODUCT_DEFAULT_PROPERTY_OVERRIDES \
Jiyong Parke28fa802020-05-26 00:21:20 +0900249 PRODUCT_PROPERTY_OVERRIDES
Jiyong Parke1346862020-05-18 14:31:30 +0900250else
Jiyong Parke28fa802020-05-26 00:21:20 +0900251_prop_vars_ :=
Jiyong Parke1346862020-05-18 14:31:30 +0900252endif
253
Jiyong Parke28fa802020-05-26 00:21:20 +0900254INSTALLED_VENDOR_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR)/build.prop
255$(eval $(call build-properties,\
256 vendor,\
257 $(INSTALLED_VENDOR_BUILD_PROP_TARGET),\
258 $(_prop_files_),\
259 $(_prop_vars_),\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100260 $(PRODUCT_VENDOR_PROPERTY_BLACKLIST),\
Oleksiy Avramchenkod3d0f7d2020-12-15 14:38:32 +0100261 $(empty),\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100262 $(empty)))
Jiyong Parke1346862020-05-18 14:31:30 +0900263
Bob Badour70c07dd2022-02-12 15:39:22 -0800264$(eval $(call declare-1p-target,$(INSTALLED_VENDOR_BUILD_PROP_TARGET)))
265
Jiyong Parke28fa802020-05-26 00:21:20 +0900266# -----------------------------------------------------------------
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900267# product/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900268#
269
270_prop_files_ := $(if $(TARGET_PRODUCT_PROP),\
271 $(TARGET_PRODUCT_PROP),\
272 $(wildcard $(TARGET_DEVICE_DIR)/product.prop))
273
274# Order matters here. When there are duplicates, the last one wins.
275# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
276_prop_vars_ := \
277 ADDITIONAL_PRODUCT_PROPERTIES \
278 PRODUCT_PRODUCT_PROPERTIES
279
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900280INSTALLED_PRODUCT_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT)/etc/build.prop
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100281
282ifdef PRODUCT_OEM_PROPERTIES
283import_oem_prop := $(call intermediates-dir-for,ETC,import_oem_prop)/oem.prop
284
285$(import_oem_prop):
286 $(hide) echo "####################################" >> $@; \
287 echo "# PRODUCT_OEM_PROPERTIES" >> $@; \
288 echo "####################################" >> $@;
289 $(hide) $(foreach prop,$(PRODUCT_OEM_PROPERTIES), \
290 echo "import /oem/oem.prop $(prop)" >> $@;)
291
292_footers_ := $(import_oem_prop)
293else
294_footers_ :=
295endif
296
Oleksiy Avramchenkod3d0f7d2020-12-15 14:38:32 +0100297# Skip common /product properties generation if device released before R and
298# has no product partition. This is the first part of the check.
299ifeq ($(call math_lt,$(if $(PRODUCT_SHIPPING_API_LEVEL),$(PRODUCT_SHIPPING_API_LEVEL),30),30), true)
300 _skip_common_properties := true
301endif
302
303# The second part of the check - always generate common properties for the
304# devices with product partition regardless of shipping level.
305ifneq ($(BOARD_USES_PRODUCTIMAGE),)
306 _skip_common_properties :=
307endif
308
Jiyong Parke28fa802020-05-26 00:21:20 +0900309$(eval $(call build-properties,\
310 product,\
311 $(INSTALLED_PRODUCT_BUILD_PROP_TARGET),\
312 $(_prop_files_),\
313 $(_prop_vars_),\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100314 $(empty),\
Oleksiy Avramchenkod3d0f7d2020-12-15 14:38:32 +0100315 $(_footers_),\
316 $(_skip_common_properties)))
317
Bob Badour70c07dd2022-02-12 15:39:22 -0800318$(eval $(call declare-1p-target,$(INSTALLED_PRODUCT_BUILD_PROP_TARGET)))
319
Oleksiy Avramchenkod3d0f7d2020-12-15 14:38:32 +0100320_skip_common_properties :=
Jiyong Parke1346862020-05-18 14:31:30 +0900321
322# ----------------------------------------------------------------
Jiyong Park62117c82020-06-26 09:56:31 +0900323# odm/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900324#
325_prop_files_ := $(if $(TARGET_ODM_PROP),\
326 $(TARGET_ODM_PROP),\
327 $(wildcard $(TARGET_DEVICE_DIR)/odm.prop))
Jiyong Parke1346862020-05-18 14:31:30 +0900328
Jiyong Parke28fa802020-05-26 00:21:20 +0900329# Order matters here. When there are duplicates, the last one wins.
330# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
331_prop_vars_ := \
332 ADDITIONAL_ODM_PROPERTIES \
333 PRODUCT_ODM_PROPERTIES
Jiyong Parke1346862020-05-18 14:31:30 +0900334
Jiyong Park62117c82020-06-26 09:56:31 +0900335INSTALLED_ODM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM)/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900336$(eval $(call build-properties,\
337 odm,\
338 $(INSTALLED_ODM_BUILD_PROP_TARGET),\
Hidefumi Kanekob09a36c2021-07-30 17:38:36 +0900339 $(_prop_files_),\
Jiyong Parke28fa802020-05-26 00:21:20 +0900340 $(_prop_vars_),\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100341 $(empty),\
Oleksiy Avramchenkod3d0f7d2020-12-15 14:38:32 +0100342 $(empty),\
Jiyong Parke28fa802020-05-26 00:21:20 +0900343 $(empty)))
Jiyong Parke1346862020-05-18 14:31:30 +0900344
Bob Badour70c07dd2022-02-12 15:39:22 -0800345$(eval $(call declare-1p-target,$(INSTALLED_ODM_BUILD_PROP_TARGET)))
346
Yifan Hong51a971b2020-06-25 17:00:27 -0700347# ----------------------------------------------------------------
348# vendor_dlkm/etc/build.prop
349#
350
351INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR_DLKM)/etc/build.prop
352$(eval $(call build-properties,\
353 vendor_dlkm,\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100354 $(INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET),\
355 $(empty),\
356 $(empty),\
357 $(empty),\
Oleksiy Avramchenkod3d0f7d2020-12-15 14:38:32 +0100358 $(empty),\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100359 $(empty)))
Yifan Hong51a971b2020-06-25 17:00:27 -0700360
Bob Badour70c07dd2022-02-12 15:39:22 -0800361$(eval $(call declare-1p-target,$(INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET)))
362
Yifan Hong81a092f2020-07-15 17:02:07 -0700363# ----------------------------------------------------------------
364# odm_dlkm/etc/build.prop
365#
366
367INSTALLED_ODM_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM_DLKM)/etc/build.prop
368$(eval $(call build-properties,\
369 odm_dlkm,\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100370 $(INSTALLED_ODM_DLKM_BUILD_PROP_TARGET),\
371 $(empty),\
372 $(empty),\
373 $(empty),\
Oleksiy Avramchenkod3d0f7d2020-12-15 14:38:32 +0100374 $(empty),\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100375 $(empty)))
Yifan Hong81a092f2020-07-15 17:02:07 -0700376
Bob Badour70c07dd2022-02-12 15:39:22 -0800377$(eval $(call declare-1p-target,$(INSTALLED_ODM_DLKM_BUILD_PROP_TARGET)))
378
Ramji Jiyani13a41372022-01-27 07:05:08 +0000379# ----------------------------------------------------------------
380# system_dlkm/build.prop
381#
382
383INSTALLED_SYSTEM_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_SYSTEM_DLKM)/etc/build.prop
384$(eval $(call build-properties,\
385 system_dlkm,\
386 $(INSTALLED_SYSTEM_DLKM_BUILD_PROP_TARGET),\
387 $(empty),\
388 $(empty),\
389 $(empty),\
390 $(empty),\
391 $(empty)))
392
Bob Badour70c07dd2022-02-12 15:39:22 -0800393$(eval $(call declare-1p-target,$(INSTALLED_SYSTEM_DLKM_BUILD_PROP_TARGET)))
394
Jiyong Parke1346862020-05-18 14:31:30 +0900395# -----------------------------------------------------------------
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900396# system_ext/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900397#
398_prop_files_ := $(if $(TARGET_SYSTEM_EXT_PROP),\
399 $(TARGET_SYSTEM_EXT_PROP),\
400 $(wildcard $(TARGET_DEVICE_DIR)/system_ext.prop))
401
402# 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_ := PRODUCT_SYSTEM_EXT_PROPERTIES
405
Jiyong Parkc0bd8c72020-06-29 10:46:22 +0900406INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET := $(TARGET_OUT_SYSTEM_EXT)/etc/build.prop
Jiyong Parke28fa802020-05-26 00:21:20 +0900407$(eval $(call build-properties,\
408 system_ext,\
409 $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET),\
410 $(_prop_files_),\
411 $(_prop_vars_),\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100412 $(empty),\
Oleksiy Avramchenkod3d0f7d2020-12-15 14:38:32 +0100413 $(empty),\
Jiyong Parke28fa802020-05-26 00:21:20 +0900414 $(empty)))
Yifan Hong33fd5d42020-09-24 18:18:26 -0700415
Bob Badour70c07dd2022-02-12 15:39:22 -0800416$(eval $(call declare-1p-target,$(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET)))
417
Yifan Hong33fd5d42020-09-24 18:18:26 -0700418# ----------------------------------------------------------------
419# ramdisk/boot/etc/build.prop
420#
421
422RAMDISK_BUILD_PROP_REL_PATH := system/etc/ramdisk/build.prop
423INSTALLED_RAMDISK_BUILD_PROP_TARGET := $(TARGET_RAMDISK_OUT)/$(RAMDISK_BUILD_PROP_REL_PATH)
424$(eval $(call build-properties,\
Kelvin Zhang8250d2c2022-03-23 19:46:09 +0000425 bootimage,\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100426 $(INSTALLED_RAMDISK_BUILD_PROP_TARGET),\
427 $(empty),\
428 $(empty),\
429 $(empty),\
Oleksiy Avramchenkod3d0f7d2020-12-15 14:38:32 +0100430 $(empty),\
Alexander Mishkovets5a6bc222020-11-11 15:25:37 +0100431 $(empty)))
Bob Badour70c07dd2022-02-12 15:39:22 -0800432
433$(eval $(call declare-1p-target,$(INSTALLED_RAMDISK_BUILD_PROP_TARGET)))
Wei Li49933362023-01-04 17:13:47 -0800434
435ALL_INSTALLED_BUILD_PROP_FILES := \
436 $(INSTALLED_BUILD_PROP_TARGET) \
437 $(INSTALLED_VENDOR_BUILD_PROP_TARGET) \
438 $(INSTALLED_PRODUCT_BUILD_PROP_TARGET) \
439 $(INSTALLED_ODM_BUILD_PROP_TARGET) \
440 $(INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET) \
441 $(INSTALLED_ODM_DLKM_BUILD_PROP_TARGET) \
442 $(INSTALLED_SYSTEM_DLKM_BUILD_PROP_TARGET) \
443 $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET) \
444 $(INSTALLED_RAMDISK_BUILD_PROP_TARGET)
445
446# $1 installed file path, e.g. out/target/product/vsoc_x86_64/system/build.prop
447define is-build-prop
448$(if $(findstring $1,$(ALL_INSTALLED_BUILD_PROP_FILES)),Y)
Tiffany Yang19450e32023-05-23 17:36:54 -0700449endef