• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
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
17# sysprop.mk defines rules for generating <partition>/[etc/]build.prop files
18
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
26BUILDINFO_SH := build/make/tools/buildinfo.sh
27POST_PROCESS_PROPS := $(HOST_OUT_EXECUTABLES)/post_process_props$(HOST_EXECUTABLE_SUFFIX)
28
29# Emits a set of sysprops common to all partitions to a file.
30# $(1): Partition name
31# $(2): Output file name
32define generate-common-build-props
33    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    $(if $(filter true,$(ZYGOTE_FORCE_64)),\
51        $(if $(filter vendor,$(1)),\
52            echo "ro.$(1).product.cpu.abilist=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\
53            echo "ro.$(1).product.cpu.abilist32=" >> $(2);\
54            echo "ro.$(1).product.cpu.abilist64=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\
55        )\
56    ,\
57        $(if $(filter system vendor odm,$(1)),\
58            echo "ro.$(1).product.cpu.abilist=$(TARGET_CPU_ABI_LIST)" >> $(2);\
59            echo "ro.$(1).product.cpu.abilist32=$(TARGET_CPU_ABI_LIST_32_BIT)" >> $(2);\
60            echo "ro.$(1).product.cpu.abilist64=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\
61        )\
62    )\
63    echo "ro.$(1).build.date=`$(DATE_FROM_FILE)`" >> $(2);\
64    echo "ro.$(1).build.date.utc=`$(DATE_FROM_FILE) +%s`" >> $(2);\
65    echo "ro.$(1).build.fingerprint=$(BUILD_FINGERPRINT_FROM_FILE)" >> $(2);\
66    echo "ro.$(1).build.id=$(BUILD_ID)" >> $(2);\
67    echo "ro.$(1).build.tags=$(BUILD_VERSION_TAGS)" >> $(2);\
68    echo "ro.$(1).build.type=$(TARGET_BUILD_VARIANT)" >> $(2);\
69    echo "ro.$(1).build.version.incremental=$(BUILD_NUMBER_FROM_FILE)" >> $(2);\
70    echo "ro.$(1).build.version.release=$(PLATFORM_VERSION_LAST_STABLE)" >> $(2);\
71    echo "ro.$(1).build.version.release_or_codename=$(PLATFORM_VERSION)" >> $(2);\
72    echo "ro.$(1).build.version.sdk=$(PLATFORM_SDK_VERSION)" >> $(2);\
73
74endef
75
76# Rule for generating <partition>/[etc/]build.prop file
77#
78# $(1): partition name
79# $(2): path to the output
80# $(3): path to the input *.prop files. The contents of the files are directly
81#       emitted to the output
82# $(4): list of variable names each of which contains name=value pairs
83# $(5): optional list of prop names to force remove from the output. Properties from both
84#       $(3) and (4) are affected
85# $(6): optional list of files to append at the end. The content of each file is emitted
86#       to the output
87# $(7): optional flag to skip common properties generation
88define build-properties
89ALL_DEFAULT_INSTALLED_MODULES += $(2)
90
91$(eval # Properties can be assigned using `prop ?= value` or `prop = value` syntax.)
92$(eval # Eliminate spaces around the ?= and = separators.)
93$(foreach name,$(strip $(4)),\
94    $(eval _temp := $$(call collapse-pairs,$$($(name)),?=))\
95    $(eval _resolved_$(name) := $$(call collapse-pairs,$$(_temp),=))\
96)
97
98$(eval # Implement the legacy behavior when BUILD_BROKEN_DUP_SYSPROP is on.)
99$(eval # Optional assignments are all converted to normal assignments and)
100$(eval # when their duplicates the first one wins)
101$(if $(filter true,$(BUILD_BROKEN_DUP_SYSPROP)),\
102    $(foreach name,$(strip $(4)),\
103        $(eval _temp := $$(subst ?=,=,$$(_resolved_$(name))))\
104        $(eval _resolved_$(name) := $$(call uniq-pairs-by-first-component,$$(_resolved_$(name)),=))\
105    )\
106    $(eval _option := --allow-dup)\
107)
108
109$(2): $(POST_PROCESS_PROPS) $(INTERNAL_BUILD_ID_MAKEFILE) $(3) $(6)
110	$(hide) echo Building $$@
111	$(hide) mkdir -p $$(dir $$@)
112	$(hide) rm -f $$@ && touch $$@
113ifneq ($(strip $(7)), true)
114	$(hide) $$(call generate-common-build-props,$(call to-lower,$(strip $(1))),$$@)
115endif
116	$(hide) $(foreach file,$(strip $(3)),\
117	    if [ -f "$(file)" ]; then\
118	        echo "" >> $$@;\
119	        echo "####################################" >> $$@;\
120	        echo "# from $(file)" >> $$@;\
121	        echo "####################################" >> $$@;\
122	        cat $(file) >> $$@;\
123	    fi;)
124	$(hide) $(foreach name,$(strip $(4)),\
125	    echo "" >> $$@;\
126	    echo "####################################" >> $$@;\
127	    echo "# from variable $(name)" >> $$@;\
128	    echo "####################################" >> $$@;\
129	    $$(foreach line,$$(_resolved_$(name)),\
130	        echo "$$(line)" >> $$@;\
131	    )\
132	)
133	$(hide) $(POST_PROCESS_PROPS) $$(_option) --sdk-version $(PLATFORM_SDK_VERSION) $$@ $(5)
134	$(hide) $(foreach file,$(strip $(6)),\
135	    if [ -f "$(file)" ]; then\
136	        cat $(file) >> $$@;\
137	    fi;)
138	$(hide) echo "# end of file" >> $$@
139
140$(call declare-0p-target,$(2))
141endef
142
143# -----------------------------------------------------------------
144# Define fingerprint, thumbprint, and version tags for the current build
145#
146# BUILD_VERSION_TAGS is a comma-separated list of tags chosen by the device
147# implementer that further distinguishes the build. It's basically defined
148# by the device implementer. Here, we are adding a mandatory tag that
149# identifies the signing config of the build.
150BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS)
151ifeq ($(TARGET_BUILD_TYPE),debug)
152  BUILD_VERSION_TAGS += debug
153endif
154# The "test-keys" tag marks builds signed with the old test keys,
155# which are available in the SDK.  "dev-keys" marks builds signed with
156# non-default dev keys (usually private keys from a vendor directory).
157# Both of these tags will be removed and replaced with "release-keys"
158# when the target-files is signed in a post-build step.
159ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/make/target/product/security/testkey)
160BUILD_KEYS := test-keys
161else
162BUILD_KEYS := dev-keys
163endif
164BUILD_VERSION_TAGS += $(BUILD_KEYS)
165BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))
166
167# BUILD_FINGERPRINT is used used to uniquely identify the combined build and
168# product; used by the OTA server.
169ifeq (,$(strip $(BUILD_FINGERPRINT)))
170  ifeq ($(strip $(HAS_BUILD_NUMBER)),false)
171    BF_BUILD_NUMBER := $(BUILD_USERNAME)$$($(DATE_FROM_FILE) +%m%d%H%M)
172  else
173    BF_BUILD_NUMBER := $(file <$(BUILD_NUMBER_FILE))
174  endif
175  BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
176endif
177# unset it for safety.
178BF_BUILD_NUMBER :=
179
180BUILD_FINGERPRINT_FILE := $(PRODUCT_OUT)/build_fingerprint.txt
181ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_FINGERPRINT) >$(BUILD_FINGERPRINT_FILE) && grep " " $(BUILD_FINGERPRINT_FILE)))
182  $(error BUILD_FINGERPRINT cannot contain spaces: "$(file <$(BUILD_FINGERPRINT_FILE))")
183endif
184BUILD_FINGERPRINT_FROM_FILE := $$(cat $(BUILD_FINGERPRINT_FILE))
185# unset it for safety.
186BUILD_FINGERPRINT :=
187
188# BUILD_THUMBPRINT is used to uniquely identify the system build; used by the
189# OTA server. This purposefully excludes any product-specific variables.
190ifeq (,$(strip $(BUILD_THUMBPRINT)))
191  BUILD_THUMBPRINT := $(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER_FROM_FILE):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
192endif
193
194BUILD_THUMBPRINT_FILE := $(PRODUCT_OUT)/build_thumbprint.txt
195ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_THUMBPRINT) >$(BUILD_THUMBPRINT_FILE) && grep " " $(BUILD_THUMBPRINT_FILE)))
196  $(error BUILD_THUMBPRINT cannot contain spaces: "$(file <$(BUILD_THUMBPRINT_FILE))")
197endif
198BUILD_THUMBPRINT_FROM_FILE := $$(cat $(BUILD_THUMBPRINT_FILE))
199# unset it for safety.
200BUILD_THUMBPRINT :=
201
202# -----------------------------------------------------------------
203# Define human readable strings that describe this build
204#
205
206# BUILD_ID: detail info; has the same info as the build fingerprint
207BUILD_DESC := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) $(PLATFORM_VERSION) $(BUILD_ID) $(BUILD_NUMBER_FROM_FILE) $(BUILD_VERSION_TAGS)
208
209# BUILD_DISPLAY_ID is shown under Settings -> About Phone
210ifeq ($(TARGET_BUILD_VARIANT),user)
211  # User builds should show:
212  # release build number or branch.buld_number non-release builds
213
214  # Dev. branches should have DISPLAY_BUILD_NUMBER set
215  ifeq (true,$(DISPLAY_BUILD_NUMBER))
216    BUILD_DISPLAY_ID := $(BUILD_ID).$(BUILD_NUMBER_FROM_FILE) $(BUILD_KEYS)
217  else
218    BUILD_DISPLAY_ID := $(BUILD_ID) $(BUILD_KEYS)
219  endif
220else
221  # Non-user builds should show detailed build information
222  BUILD_DISPLAY_ID := $(BUILD_DESC)
223endif
224
225# TARGET_BUILD_FLAVOR and ro.build.flavor are used only by the test
226# harness to distinguish builds. Only add _asan for a sanitized build
227# if it isn't already a part of the flavor (via a dedicated lunch
228# config for example).
229TARGET_BUILD_FLAVOR := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)
230ifneq (, $(filter address, $(SANITIZE_TARGET)))
231ifeq (,$(findstring _asan,$(TARGET_BUILD_FLAVOR)))
232TARGET_BUILD_FLAVOR := $(TARGET_BUILD_FLAVOR)_asan
233endif
234endif
235
236KNOWN_OEM_THUMBPRINT_PROPERTIES := \
237    ro.product.brand \
238    ro.product.name \
239    ro.product.device
240OEM_THUMBPRINT_PROPERTIES := $(filter $(KNOWN_OEM_THUMBPRINT_PROPERTIES),\
241    $(PRODUCT_OEM_PROPERTIES))
242KNOWN_OEM_THUMBPRINT_PROPERTIES:=
243
244# -----------------------------------------------------------------
245# system/build.prop
246#
247# Note: parts of this file that can't be generated by the build-properties
248# macro are manually created as separate files and then fed into the macro
249
250# Accepts a whitespace separated list of product locales such as
251# (en_US en_AU en_GB...) and returns the first locale in the list with
252# underscores replaced with hyphens. In the example above, this will
253# return "en-US".
254define get-default-product-locale
255$(strip $(subst _,-, $(firstword $(1))))
256endef
257
258gen_from_buildinfo_sh := $(call intermediates-dir-for,PACKAGING,system_build_prop)/buildinfo.prop
259$(gen_from_buildinfo_sh): $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) | $(BUILD_DATETIME_FILE) $(BUILD_NUMBER_FILE)
260	$(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \
261	        TARGET_BUILD_FLAVOR="$(TARGET_BUILD_FLAVOR)" \
262	        TARGET_DEVICE="$(TARGET_DEVICE)" \
263	        PRODUCT_DEFAULT_LOCALE="$(call get-default-product-locale,$(PRODUCT_LOCALES))" \
264	        PRODUCT_DEFAULT_WIFI_CHANNELS="$(PRODUCT_DEFAULT_WIFI_CHANNELS)" \
265	        PRIVATE_BUILD_DESC="$(BUILD_DESC)" \
266	        BUILD_ID="$(BUILD_ID)" \
267	        BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \
268	        DATE="$(DATE_FROM_FILE)" \
269	        BUILD_USERNAME="$(BUILD_USERNAME)" \
270	        BUILD_HOSTNAME="$(BUILD_HOSTNAME)" \
271	        BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \
272	        BOARD_BUILD_SYSTEM_ROOT_IMAGE="$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)" \
273	        BOARD_USE_VBMETA_DIGTEST_IN_FINGERPRINT="$(BOARD_USE_VBMETA_DIGTEST_IN_FINGERPRINT)" \
274	        PLATFORM_VERSION="$(PLATFORM_VERSION)" \
275	        PLATFORM_DISPLAY_VERSION="$(PLATFORM_DISPLAY_VERSION)" \
276	        PLATFORM_VERSION_LAST_STABLE="$(PLATFORM_VERSION_LAST_STABLE)" \
277	        PLATFORM_SECURITY_PATCH="$(PLATFORM_SECURITY_PATCH)" \
278	        PLATFORM_BASE_OS="$(PLATFORM_BASE_OS)" \
279	        PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \
280	        PLATFORM_PREVIEW_SDK_VERSION="$(PLATFORM_PREVIEW_SDK_VERSION)" \
281	        PLATFORM_PREVIEW_SDK_FINGERPRINT="$$(cat $(API_FINGERPRINT))" \
282	        PLATFORM_VERSION_CODENAME="$(PLATFORM_VERSION_CODENAME)" \
283	        PLATFORM_VERSION_ALL_CODENAMES="$(PLATFORM_VERSION_ALL_CODENAMES)" \
284	        PLATFORM_VERSION_KNOWN_CODENAMES="$(PLATFORM_VERSION_KNOWN_CODENAMES)" \
285	        PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION="$(PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION)" \
286	        BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \
287	        $(if $(OEM_THUMBPRINT_PROPERTIES),BUILD_THUMBPRINT="$(BUILD_THUMBPRINT_FROM_FILE)") \
288	        TARGET_CPU_ABI_LIST="$(TARGET_CPU_ABI_LIST)" \
289	        TARGET_CPU_ABI_LIST_32_BIT="$(TARGET_CPU_ABI_LIST_32_BIT)" \
290	        TARGET_CPU_ABI_LIST_64_BIT="$(TARGET_CPU_ABI_LIST_64_BIT)" \
291	        TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \
292	        TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \
293	        ZYGOTE_FORCE_64_BIT="$(ZYGOTE_FORCE_64_BIT)" \
294	        bash $(BUILDINFO_SH) > $@
295
296ifdef TARGET_SYSTEM_PROP
297system_prop_file := $(TARGET_SYSTEM_PROP)
298else
299system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop)
300endif
301
302_prop_files_ := \
303  $(gen_from_buildinfo_sh) \
304  $(system_prop_file)
305
306# Order matters here. When there are duplicates, the last one wins.
307# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
308_prop_vars_ := \
309    ADDITIONAL_SYSTEM_PROPERTIES \
310    PRODUCT_SYSTEM_PROPERTIES
311
312# TODO(b/117892318): deprecate this
313_prop_vars_ += \
314    PRODUCT_SYSTEM_DEFAULT_PROPERTIES
315
316ifndef property_overrides_split_enabled
317_prop_vars_ += \
318    ADDITIONAL_VENDOR_PROPERTIES \
319    PRODUCT_VENDOR_PROPERTIES
320endif
321
322INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop
323
324$(eval $(call build-properties,\
325    system,\
326    $(INSTALLED_BUILD_PROP_TARGET),\
327    $(_prop_files_),\
328    $(_prop_vars_),\
329    $(PRODUCT_SYSTEM_PROPERTY_BLACKLIST),\
330    $(empty),\
331    $(empty)))
332
333$(eval $(call declare-1p-target,$(INSTALLED_BUILD_PROP_TARGET)))
334
335# -----------------------------------------------------------------
336# vendor/build.prop
337#
338_prop_files_ := $(if $(TARGET_VENDOR_PROP),\
339    $(TARGET_VENDOR_PROP),\
340    $(wildcard $(TARGET_DEVICE_DIR)/vendor.prop))
341
342android_info_prop := $(call intermediates-dir-for,ETC,android_info_prop)/android_info.prop
343$(android_info_prop): $(INSTALLED_ANDROID_INFO_TXT_TARGET)
344	cat $< | grep 'require version-' | sed -e 's/require version-/ro.build.expect./g' > $@
345
346_prop_files_ += $(android_info_prop)
347
348ifdef property_overrides_split_enabled
349# Order matters here. When there are duplicates, the last one wins.
350# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
351_prop_vars_ := \
352    ADDITIONAL_VENDOR_PROPERTIES \
353    PRODUCT_VENDOR_PROPERTIES
354
355# TODO(b/117892318): deprecate this
356_prop_vars_ += \
357    PRODUCT_DEFAULT_PROPERTY_OVERRIDES \
358    PRODUCT_PROPERTY_OVERRIDES
359else
360_prop_vars_ :=
361endif
362
363INSTALLED_VENDOR_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR)/build.prop
364$(eval $(call build-properties,\
365    vendor,\
366    $(INSTALLED_VENDOR_BUILD_PROP_TARGET),\
367    $(_prop_files_),\
368    $(_prop_vars_),\
369    $(PRODUCT_VENDOR_PROPERTY_BLACKLIST),\
370    $(empty),\
371    $(empty)))
372
373$(eval $(call declare-1p-target,$(INSTALLED_VENDOR_BUILD_PROP_TARGET)))
374
375# -----------------------------------------------------------------
376# product/etc/build.prop
377#
378
379_prop_files_ := $(if $(TARGET_PRODUCT_PROP),\
380    $(TARGET_PRODUCT_PROP),\
381    $(wildcard $(TARGET_DEVICE_DIR)/product.prop))
382
383# 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_PRODUCT_PROPERTIES \
387    PRODUCT_PRODUCT_PROPERTIES
388
389INSTALLED_PRODUCT_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT)/etc/build.prop
390
391ifdef PRODUCT_OEM_PROPERTIES
392import_oem_prop := $(call intermediates-dir-for,ETC,import_oem_prop)/oem.prop
393
394$(import_oem_prop):
395	$(hide) echo "####################################" >> $@; \
396	        echo "# PRODUCT_OEM_PROPERTIES" >> $@; \
397	        echo "####################################" >> $@;
398	$(hide) $(foreach prop,$(PRODUCT_OEM_PROPERTIES), \
399	    echo "import /oem/oem.prop $(prop)" >> $@;)
400
401_footers_ := $(import_oem_prop)
402else
403_footers_ :=
404endif
405
406# Skip common /product properties generation if device released before R and
407# has no product partition. This is the first part of the check.
408ifeq ($(call math_lt,$(if $(PRODUCT_SHIPPING_API_LEVEL),$(PRODUCT_SHIPPING_API_LEVEL),30),30), true)
409  _skip_common_properties := true
410endif
411
412# The second part of the check - always generate common properties for the
413# devices with product partition regardless of shipping level.
414ifneq ($(BOARD_USES_PRODUCTIMAGE),)
415  _skip_common_properties :=
416endif
417
418$(eval $(call build-properties,\
419    product,\
420    $(INSTALLED_PRODUCT_BUILD_PROP_TARGET),\
421    $(_prop_files_),\
422    $(_prop_vars_),\
423    $(empty),\
424    $(_footers_),\
425    $(_skip_common_properties)))
426
427$(eval $(call declare-1p-target,$(INSTALLED_PRODUCT_BUILD_PROP_TARGET)))
428
429_skip_common_properties :=
430
431# ----------------------------------------------------------------
432# odm/etc/build.prop
433#
434_prop_files_ := $(if $(TARGET_ODM_PROP),\
435    $(TARGET_ODM_PROP),\
436    $(wildcard $(TARGET_DEVICE_DIR)/odm.prop))
437
438# Order matters here. When there are duplicates, the last one wins.
439# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
440_prop_vars_ := \
441    ADDITIONAL_ODM_PROPERTIES \
442    PRODUCT_ODM_PROPERTIES
443
444INSTALLED_ODM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM)/etc/build.prop
445$(eval $(call build-properties,\
446    odm,\
447    $(INSTALLED_ODM_BUILD_PROP_TARGET),\
448    $(_prop_files_),\
449    $(_prop_vars_),\
450    $(empty),\
451    $(empty),\
452    $(empty)))
453
454$(eval $(call declare-1p-target,$(INSTALLED_ODM_BUILD_PROP_TARGET)))
455
456# ----------------------------------------------------------------
457# vendor_dlkm/etc/build.prop
458#
459
460INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR_DLKM)/etc/build.prop
461$(eval $(call build-properties,\
462    vendor_dlkm,\
463    $(INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET),\
464    $(empty),\
465    $(empty),\
466    $(empty),\
467    $(empty),\
468    $(empty)))
469
470$(eval $(call declare-1p-target,$(INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET)))
471
472# ----------------------------------------------------------------
473# odm_dlkm/etc/build.prop
474#
475
476INSTALLED_ODM_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM_DLKM)/etc/build.prop
477$(eval $(call build-properties,\
478    odm_dlkm,\
479    $(INSTALLED_ODM_DLKM_BUILD_PROP_TARGET),\
480    $(empty),\
481    $(empty),\
482    $(empty),\
483    $(empty),\
484    $(empty)))
485
486$(eval $(call declare-1p-target,$(INSTALLED_ODM_DLKM_BUILD_PROP_TARGET)))
487
488# ----------------------------------------------------------------
489# system_dlkm/build.prop
490#
491
492INSTALLED_SYSTEM_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_SYSTEM_DLKM)/etc/build.prop
493$(eval $(call build-properties,\
494    system_dlkm,\
495    $(INSTALLED_SYSTEM_DLKM_BUILD_PROP_TARGET),\
496    $(empty),\
497    $(empty),\
498    $(empty),\
499    $(empty),\
500    $(empty)))
501
502$(eval $(call declare-1p-target,$(INSTALLED_SYSTEM_DLKM_BUILD_PROP_TARGET)))
503
504# -----------------------------------------------------------------
505# system_ext/etc/build.prop
506#
507_prop_files_ := $(if $(TARGET_SYSTEM_EXT_PROP),\
508    $(TARGET_SYSTEM_EXT_PROP),\
509    $(wildcard $(TARGET_DEVICE_DIR)/system_ext.prop))
510
511# Order matters here. When there are duplicates, the last one wins.
512# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
513_prop_vars_ := PRODUCT_SYSTEM_EXT_PROPERTIES
514
515INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET := $(TARGET_OUT_SYSTEM_EXT)/etc/build.prop
516$(eval $(call build-properties,\
517    system_ext,\
518    $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET),\
519    $(_prop_files_),\
520    $(_prop_vars_),\
521    $(empty),\
522    $(empty),\
523    $(empty)))
524
525$(eval $(call declare-1p-target,$(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET)))
526
527# ----------------------------------------------------------------
528# ramdisk/boot/etc/build.prop
529#
530
531RAMDISK_BUILD_PROP_REL_PATH := system/etc/ramdisk/build.prop
532INSTALLED_RAMDISK_BUILD_PROP_TARGET := $(TARGET_RAMDISK_OUT)/$(RAMDISK_BUILD_PROP_REL_PATH)
533$(eval $(call build-properties,\
534    bootimage,\
535    $(INSTALLED_RAMDISK_BUILD_PROP_TARGET),\
536    $(empty),\
537    $(empty),\
538    $(empty),\
539    $(empty),\
540    $(empty)))
541
542$(eval $(call declare-1p-target,$(INSTALLED_RAMDISK_BUILD_PROP_TARGET)))
543