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