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