Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 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 | |
Jiyong Park | c0bd8c7 | 2020-06-29 10:46:22 +0900 | [diff] [blame^] | 17 | # sysprop.mk defines rules for generating <partition>/[etc/]build.prop files |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 18 | |
| 19 | # ----------------------------------------------------------------- |
| 20 | # property_overrides_split_enabled |
| 21 | property_overrides_split_enabled := |
| 22 | ifeq ($(BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED), true) |
| 23 | property_overrides_split_enabled := true |
| 24 | endif |
| 25 | |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 26 | BUILDINFO_SH := build/make/tools/buildinfo.sh |
Jiyong Park | ae55638 | 2020-05-20 18:33:43 +0900 | [diff] [blame] | 27 | POST_PROCESS_PROPS := $(HOST_OUT_EXECUTABLES)/post_process_props$(HOST_EXECUTABLE_SUFFIX) |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 28 | |
Jiyong Park | 35a83d1 | 2020-05-26 02:01:05 +0900 | [diff] [blame] | 29 | # Emits a set of sysprops common to all partitions to a file. |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 30 | # $(1): Partition name |
| 31 | # $(2): Output file name |
| 32 | define generate-common-build-props |
Jiyong Park | 35a83d1 | 2020-05-26 02:01:05 +0900 | [diff] [blame] | 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 | 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 Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 59 | |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 60 | endef |
| 61 | |
Jiyong Park | c0bd8c7 | 2020-06-29 10:46:22 +0900 | [diff] [blame^] | 62 | # Rule for generating <partition>/[etc/]build.prop file |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 63 | # |
| 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. |
| 71 | define build-properties |
| 72 | ALL_DEFAULT_INSTALLED_MODULES += $(2) |
| 73 | |
Jiyong Park | d721e87 | 2020-06-22 17:30:57 +0900 | [diff] [blame] | 74 | $(eval # Properties can be assigned using `prop ?= value` or `prop = value` syntax.) |
| 75 | $(eval # Eliminate spaces around the ?= and = separators.) |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 76 | $(foreach name,$(strip $(4)),\ |
Jiyong Park | d721e87 | 2020-06-22 17:30:57 +0900 | [diff] [blame] | 77 | $(eval _temp := $$(call collapse-pairs,$$($(name)),?=))\ |
| 78 | $(eval _resolved_$(name) := $$(call collapse-pairs,$$(_temp),=))\ |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 79 | ) |
| 80 | |
Jiyong Park | 0b4fccb | 2020-06-26 17:38:00 +0900 | [diff] [blame] | 81 | $(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 Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 90 | ) |
| 91 | |
Jiyong Park | 35a83d1 | 2020-05-26 02:01:05 +0900 | [diff] [blame] | 92 | $(2): $(POST_PROCESS_PROPS) $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) $(3) |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 93 | $(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 Park | 0b4fccb | 2020-06-26 17:38:00 +0900 | [diff] [blame] | 114 | $(hide) $(POST_PROCESS_PROPS) $$(_option) $$@ $(5) |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 115 | $(hide) echo "# end of file" >> $$@ |
| 116 | endef |
| 117 | |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 118 | # ----------------------------------------------------------------- |
Jiyong Park | bb26c6f | 2020-05-26 03:18:36 +0900 | [diff] [blame] | 119 | # Define fingerprint, thumbprint, and version tags for the current build |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 120 | # |
Jiyong Park | bb26c6f | 2020-05-26 03:18:36 +0900 | [diff] [blame] | 121 | # 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 Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 125 | BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS) |
| 126 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 127 | BUILD_VERSION_TAGS += debug |
| 128 | endif |
| 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. |
| 134 | ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/make/target/product/security/testkey) |
| 135 | BUILD_KEYS := test-keys |
| 136 | else |
| 137 | BUILD_KEYS := dev-keys |
| 138 | endif |
| 139 | BUILD_VERSION_TAGS += $(BUILD_KEYS) |
| 140 | BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS))) |
| 141 | |
Jiyong Park | bb26c6f | 2020-05-26 03:18:36 +0900 | [diff] [blame] | 142 | # BUILD_FINGERPRINT is used used to uniquely identify the combined build and |
| 143 | # product; used by the OTA server. |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 144 | ifeq (,$(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) |
| 151 | endif |
| 152 | # unset it for safety. |
| 153 | BF_BUILD_NUMBER := |
| 154 | |
| 155 | BUILD_FINGERPRINT_FILE := $(PRODUCT_OUT)/build_fingerprint.txt |
| 156 | ifneq (,$(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))") |
| 158 | endif |
| 159 | BUILD_FINGERPRINT_FROM_FILE := $$(cat $(BUILD_FINGERPRINT_FILE)) |
| 160 | # unset it for safety. |
| 161 | BUILD_FINGERPRINT := |
| 162 | |
Jiyong Park | bb26c6f | 2020-05-26 03:18:36 +0900 | [diff] [blame] | 163 | # BUILD_THUMBPRINT is used to uniquely identify the system build; used by the |
| 164 | # OTA server. This purposefully excludes any product-specific variables. |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 165 | ifeq (,$(strip $(BUILD_THUMBPRINT))) |
| 166 | BUILD_THUMBPRINT := $(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER_FROM_FILE):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS) |
| 167 | endif |
| 168 | |
| 169 | BUILD_THUMBPRINT_FILE := $(PRODUCT_OUT)/build_thumbprint.txt |
| 170 | ifneq (,$(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))") |
| 172 | endif |
| 173 | BUILD_THUMBPRINT_FROM_FILE := $$(cat $(BUILD_THUMBPRINT_FILE)) |
| 174 | # unset it for safety. |
| 175 | BUILD_THUMBPRINT := |
| 176 | |
Jiyong Park | bb26c6f | 2020-05-26 03:18:36 +0900 | [diff] [blame] | 177 | # ----------------------------------------------------------------- |
| 178 | # Define human readable strings that describe this build |
| 179 | # |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 180 | |
Jiyong Park | bb26c6f | 2020-05-26 03:18:36 +0900 | [diff] [blame] | 181 | # BUILD_ID: detail info; has the same info as the build fingerprint |
| 182 | BUILD_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 Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 185 | ifeq ($(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 |
| 195 | else |
| 196 | # Non-user builds should show detailed build information |
Jiyong Park | bb26c6f | 2020-05-26 03:18:36 +0900 | [diff] [blame] | 197 | BUILD_DISPLAY_ID := $(BUILD_DESC) |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 198 | endif |
| 199 | |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 200 | # 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). |
| 204 | TARGET_BUILD_FLAVOR := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) |
| 205 | ifneq (, $(filter address, $(SANITIZE_TARGET))) |
| 206 | ifeq (,$(findstring _asan,$(TARGET_BUILD_FLAVOR))) |
| 207 | TARGET_BUILD_FLAVOR := $(TARGET_BUILD_FLAVOR)_asan |
| 208 | endif |
| 209 | endif |
| 210 | |
Jiyong Park | bb26c6f | 2020-05-26 03:18:36 +0900 | [diff] [blame] | 211 | KNOWN_OEM_THUMBPRINT_PROPERTIES := \ |
| 212 | ro.product.brand \ |
| 213 | ro.product.name \ |
| 214 | ro.product.device |
| 215 | OEM_THUMBPRINT_PROPERTIES := $(filter $(KNOWN_OEM_THUMBPRINT_PROPERTIES),\ |
| 216 | $(PRODUCT_OEM_PROPERTIES)) |
| 217 | KNOWN_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". |
| 229 | define get-default-product-locale |
| 230 | $(strip $(subst _,-, $(firstword $(1)))) |
| 231 | endef |
| 232 | |
| 233 | gen_from_buildinfo_sh := $(call intermediates-dir-for,ETC,system_build_prop)/buildinfo.prop |
| 234 | $(gen_from_buildinfo_sh): $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 235 | $(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 Park | bb26c6f | 2020-05-26 03:18:36 +0900 | [diff] [blame] | 240 | PRIVATE_BUILD_DESC="$(BUILD_DESC)" \ |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 241 | 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 Park | bb26c6f | 2020-05-26 03:18:36 +0900 | [diff] [blame] | 265 | bash $(BUILDINFO_SH) > $@ |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 266 | |
Jiyong Park | bb26c6f | 2020-05-26 03:18:36 +0900 | [diff] [blame] | 267 | ifneq ($(PRODUCT_OEM_PROPERTIES),) |
| 268 | import_oem_prop := $(call intermediates-dir-for,ETC,system_build_prop)/oem.prop |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 269 | |
Jiyong Park | bb26c6f | 2020-05-26 03:18:36 +0900 | [diff] [blame] | 270 | $(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)" >> $@;) |
| 276 | else |
| 277 | import_oem_prop := |
| 278 | endif |
| 279 | |
| 280 | ifdef TARGET_SYSTEM_PROP |
| 281 | system_prop_file := $(TARGET_SYSTEM_PROP) |
| 282 | else |
| 283 | system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop) |
| 284 | endif |
| 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 Park | eb49b34 | 2020-05-29 17:50:03 +0900 | [diff] [blame] | 295 | PRODUCT_SYSTEM_PROPERTIES |
| 296 | |
| 297 | # TODO(b/117892318): deprecate this |
| 298 | _prop_vars_ += \ |
Jiyong Park | bb26c6f | 2020-05-26 03:18:36 +0900 | [diff] [blame] | 299 | PRODUCT_SYSTEM_DEFAULT_PROPERTIES |
| 300 | |
| 301 | ifndef property_overrides_split_enabled |
| 302 | _prop_vars_ += \ |
| 303 | ADDITIONAL_VENDOR_PROPERTIES |
| 304 | endif |
| 305 | |
| 306 | _blacklist_names_ := \ |
| 307 | $(PRODUCT_SYSTEM_PROPERTY_BLACKLIST) \ |
| 308 | ro.product.first_api_level |
| 309 | |
| 310 | INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop |
| 311 | |
| 312 | $(eval $(call build-properties,system,$(INSTALLED_BUILD_PROP_TARGET),\ |
| 313 | $(_prop_files_),$(_prop_vars_),\ |
| 314 | $(_blacklist_names_))) |
| 315 | |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 316 | # ----------------------------------------------------------------- |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 317 | # vendor/build.prop |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 318 | # |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 319 | _prop_files_ := $(if $(TARGET_VENDOR_PROP),\ |
| 320 | $(TARGET_VENDOR_PROP),\ |
| 321 | $(wildcard $(TARGET_DEVICE_DIR)/vendor.prop)) |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 322 | |
Jiyong Park | 3a2e95a | 2020-05-25 17:56:09 +0900 | [diff] [blame] | 323 | android_info_prop := $(call intermediates-dir-for,ETC,android_info_prop)/android_info.prop |
| 324 | $(android_info_prop): $(INSTALLED_ANDROID_INFO_TXT_TARGET) |
| 325 | cat $< | grep 'require version-' | sed -e 's/require version-/ro.build.expect./g' > $@ |
| 326 | |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 327 | _prop_files_ += $(android_info_pro) |
Jiyong Park | 3a2e95a | 2020-05-25 17:56:09 +0900 | [diff] [blame] | 328 | |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 329 | ifdef property_overrides_split_enabled |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 330 | # Order matters here. When there are duplicates, the last one wins. |
| 331 | # TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter |
| 332 | _prop_vars_ := \ |
| 333 | ADDITIONAL_VENDOR_PROPERTIES \ |
Jiyong Park | eb49b34 | 2020-05-29 17:50:03 +0900 | [diff] [blame] | 334 | PRODUCT_VENDOR_PROPERTIES |
| 335 | |
| 336 | # TODO(b/117892318): deprecate this |
| 337 | _prop_vars_ += \ |
| 338 | PRODUCT_DEFAULT_PROPERTY_OVERRIDES \ |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 339 | PRODUCT_PROPERTY_OVERRIDES |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 340 | else |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 341 | _prop_vars_ := |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 342 | endif |
| 343 | |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 344 | INSTALLED_VENDOR_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR)/build.prop |
| 345 | $(eval $(call build-properties,\ |
| 346 | vendor,\ |
| 347 | $(INSTALLED_VENDOR_BUILD_PROP_TARGET),\ |
| 348 | $(_prop_files_),\ |
| 349 | $(_prop_vars_),\ |
| 350 | $(PRODUCT_VENDOR_PROPERTY_BLACKLIST))) |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 351 | |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 352 | # ----------------------------------------------------------------- |
Jiyong Park | c0bd8c7 | 2020-06-29 10:46:22 +0900 | [diff] [blame^] | 353 | # product/etc/build.prop |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 354 | # |
| 355 | |
| 356 | _prop_files_ := $(if $(TARGET_PRODUCT_PROP),\ |
| 357 | $(TARGET_PRODUCT_PROP),\ |
| 358 | $(wildcard $(TARGET_DEVICE_DIR)/product.prop)) |
| 359 | |
| 360 | # Order matters here. When there are duplicates, the last one wins. |
| 361 | # TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter |
| 362 | _prop_vars_ := \ |
| 363 | ADDITIONAL_PRODUCT_PROPERTIES \ |
| 364 | PRODUCT_PRODUCT_PROPERTIES |
| 365 | |
Jiyong Park | c0bd8c7 | 2020-06-29 10:46:22 +0900 | [diff] [blame^] | 366 | INSTALLED_PRODUCT_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT)/etc/build.prop |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 367 | $(eval $(call build-properties,\ |
| 368 | product,\ |
| 369 | $(INSTALLED_PRODUCT_BUILD_PROP_TARGET),\ |
| 370 | $(_prop_files_),\ |
| 371 | $(_prop_vars_),\ |
| 372 | $(empty))) |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 373 | |
| 374 | # ---------------------------------------------------------------- |
Jiyong Park | 62117c8 | 2020-06-26 09:56:31 +0900 | [diff] [blame] | 375 | # odm/etc/build.prop |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 376 | # |
| 377 | _prop_files_ := $(if $(TARGET_ODM_PROP),\ |
| 378 | $(TARGET_ODM_PROP),\ |
| 379 | $(wildcard $(TARGET_DEVICE_DIR)/odm.prop)) |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 380 | |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 381 | # Order matters here. When there are duplicates, the last one wins. |
| 382 | # TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter |
| 383 | _prop_vars_ := \ |
| 384 | ADDITIONAL_ODM_PROPERTIES \ |
| 385 | PRODUCT_ODM_PROPERTIES |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 386 | |
Jiyong Park | 62117c8 | 2020-06-26 09:56:31 +0900 | [diff] [blame] | 387 | INSTALLED_ODM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM)/etc/build.prop |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 388 | $(eval $(call build-properties,\ |
| 389 | odm,\ |
| 390 | $(INSTALLED_ODM_BUILD_PROP_TARGET),\ |
| 391 | $(_prop_files),\ |
| 392 | $(_prop_vars_),\ |
| 393 | $(empty))) |
Jiyong Park | e134686 | 2020-05-18 14:31:30 +0900 | [diff] [blame] | 394 | |
| 395 | # ----------------------------------------------------------------- |
Jiyong Park | c0bd8c7 | 2020-06-29 10:46:22 +0900 | [diff] [blame^] | 396 | # system_ext/etc/build.prop |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 397 | # |
| 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 Park | c0bd8c7 | 2020-06-29 10:46:22 +0900 | [diff] [blame^] | 406 | INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET := $(TARGET_OUT_SYSTEM_EXT)/etc/build.prop |
Jiyong Park | e28fa80 | 2020-05-26 00:21:20 +0900 | [diff] [blame] | 407 | $(eval $(call build-properties,\ |
| 408 | system_ext,\ |
| 409 | $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET),\ |
| 410 | $(_prop_files_),\ |
| 411 | $(_prop_vars_),\ |
| 412 | $(empty))) |