The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1 | # Put some miscellaneous rules here |
| 2 | |
Ying Wang | 3bbfddd | 2014-03-01 15:32:04 -0800 | [diff] [blame] | 3 | # HACK: clear LOCAL_PATH from including last build target before calling |
| 4 | # intermedites-dir-for |
| 5 | LOCAL_PATH := $(BUILD_SYSTEM) |
| 6 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 7 | # ----------------------------------------------------------------- |
| 8 | # Define rules to copy PRODUCT_COPY_FILES defined by the product. |
Ying Wang | 4b0486b | 2012-09-20 16:35:36 -0700 | [diff] [blame] | 9 | # PRODUCT_COPY_FILES contains words like <source file>:<dest file>[:<owner>]. |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 10 | # <dest file> is relative to $(PRODUCT_OUT), so it should look like, |
| 11 | # e.g., "system/etc/file.xml". |
Jean-Baptiste Queru | 518ce57 | 2010-03-01 16:18:59 -0800 | [diff] [blame] | 12 | # The filter part means "only eval the copy-one-file rule if this |
Ying Wang | 462d26b | 2010-11-02 21:31:47 -0700 | [diff] [blame] | 13 | # src:dest pair is the first one to match the same dest" |
Ying Wang | 6886410 | 2011-09-29 13:23:25 -0700 | [diff] [blame] | 14 | #$(1): the src:dest pair |
Dan Willemsen | 7d957c9 | 2018-04-30 16:01:33 -0700 | [diff] [blame] | 15 | #$(2): the dest |
Ying Wang | 6886410 | 2011-09-29 13:23:25 -0700 | [diff] [blame] | 16 | define check-product-copy-files |
Dan Willemsen | 7d957c9 | 2018-04-30 16:01:33 -0700 | [diff] [blame] | 17 | $(if $(filter-out $(TARGET_COPY_OUT_SYSTEM_OTHER)/%,$(2)), \ |
| 18 | $(if $(filter %.apk, $(2)),$(error \ |
Yifan Hong | 5e57a77 | 2020-01-09 16:15:11 -0800 | [diff] [blame^] | 19 | Prebuilt apk found in PRODUCT_COPY_FILES: $(1), use BUILD_PREBUILT instead!))) \ |
| 20 | $(if $(filter true,$(BUILD_BROKEN_VINTF_PRODUCT_COPY_FILES)),, \ |
| 21 | $(if $(filter $(TARGET_COPY_OUT_SYSTEM)/etc/vintf/% \ |
| 22 | $(TARGET_COPY_OUT_SYSTEM)/manifest.xml \ |
| 23 | $(TARGET_COPY_OUT_SYSTEM)/compatibility_matrix.xml,$(2)), \ |
| 24 | $(error VINTF metadata found in PRODUCT_COPY_FILES: $(1), use vintf_fragments instead!)) \ |
| 25 | $(if $(filter $(TARGET_COPY_OUT_PRODUCT)/etc/vintf/%,$(2)), \ |
| 26 | $(error VINTF metadata found in PRODUCT_COPY_FILES: $(1), \ |
| 27 | use PRODUCT_MANIFEST_FILES / DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE / vintf_compatibility_matrix / vintf_fragments instead!)) \ |
| 28 | $(if $(filter $(TARGET_COPY_OUT_SYSTEM_EXT)/etc/vintf/%,$(2)), \ |
| 29 | $(error VINTF metadata found in PRODUCT_COPY_FILES: $(1), \ |
| 30 | use vintf_compatibility_matrix / vintf_fragments instead!)) \ |
| 31 | $(if $(filter $(TARGET_COPY_OUT_VENDOR)/etc/vintf/% \ |
| 32 | $(TARGET_COPY_OUT_VENDOR)/manifest.xml \ |
| 33 | $(TARGET_COPY_OUT_VENDOR)/compatibility_matrix.xml,$(2)), \ |
| 34 | $(error VINTF metadata found in PRODUCT_COPY_FILES: $(1), \ |
| 35 | use DEVICE_MANIFEST_FILE / DEVICE_MATRIX_FILE / vintf_compatibility_matrix / vintf_fragments instead!)) \ |
| 36 | $(if $(filter $(TARGET_COPY_OUT_ODM)/etc/vintf/% \ |
| 37 | $(TARGET_COPY_OUT_ODM)/etc/manifest%,$(2)), \ |
| 38 | $(error VINTF metadata found in PRODUCT_COPY_FILES: $(1), \ |
| 39 | use ODM_MANIFEST_FILES / vintf_fragments instead!)) \ |
| 40 | ) |
Ying Wang | 6886410 | 2011-09-29 13:23:25 -0700 | [diff] [blame] | 41 | endef |
Ying Wang | 619fccf | 2012-09-05 18:08:29 -0700 | [diff] [blame] | 42 | # filter out the duplicate <source file>:<dest file> pairs. |
| 43 | unique_product_copy_files_pairs := |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 44 | $(foreach cf,$(PRODUCT_COPY_FILES), \ |
Ying Wang | 619fccf | 2012-09-05 18:08:29 -0700 | [diff] [blame] | 45 | $(if $(filter $(unique_product_copy_files_pairs),$(cf)),,\ |
| 46 | $(eval unique_product_copy_files_pairs += $(cf)))) |
| 47 | unique_product_copy_files_destinations := |
Dan Willemsen | 403b98a | 2017-11-15 11:13:23 -0800 | [diff] [blame] | 48 | product_copy_files_ignored := |
Ying Wang | 619fccf | 2012-09-05 18:08:29 -0700 | [diff] [blame] | 49 | $(foreach cf,$(unique_product_copy_files_pairs), \ |
Ying Wang | 462d26b | 2010-11-02 21:31:47 -0700 | [diff] [blame] | 50 | $(eval _src := $(call word-colon,1,$(cf))) \ |
| 51 | $(eval _dest := $(call word-colon,2,$(cf))) \ |
Dan Willemsen | 7d957c9 | 2018-04-30 16:01:33 -0700 | [diff] [blame] | 52 | $(call check-product-copy-files,$(cf),$(_dest)) \ |
Ying Wang | 193010c | 2011-12-16 11:54:25 -0800 | [diff] [blame] | 53 | $(if $(filter $(unique_product_copy_files_destinations),$(_dest)), \ |
Dan Willemsen | 403b98a | 2017-11-15 11:13:23 -0800 | [diff] [blame] | 54 | $(eval product_copy_files_ignored += $(cf)), \ |
Ying Wang | 462d26b | 2010-11-02 21:31:47 -0700 | [diff] [blame] | 55 | $(eval _fulldest := $(call append-path,$(PRODUCT_OUT),$(_dest))) \ |
Ying Wang | 3ceecfa | 2012-05-14 14:39:00 -0700 | [diff] [blame] | 56 | $(if $(filter %.xml,$(_dest)),\ |
| 57 | $(eval $(call copy-xml-file-checked,$(_src),$(_fulldest))),\ |
Nicolas Geoffray | a95fbd1 | 2017-09-19 13:10:31 +0100 | [diff] [blame] | 58 | $(if $(and $(filter %.jar,$(_dest)),$(filter $(basename $(notdir $(_dest))),$(PRODUCT_LOADED_BY_PRIVILEGED_MODULES))),\ |
| 59 | $(eval $(call copy-and-uncompress-dexs,$(_src),$(_fulldest))), \ |
Tom Cherry | fc97764 | 2018-06-13 14:51:05 -0700 | [diff] [blame] | 60 | $(if $(filter init%rc,$(notdir $(_dest)))$(filter %/etc/init,$(dir $(_dest))),\ |
| 61 | $(eval $(call copy-init-script-file-checked,$(_src),$(_fulldest))),\ |
| 62 | $(eval $(call copy-one-file,$(_src),$(_fulldest)))))) \ |
Ying Wang | 7e8d442 | 2011-06-17 17:05:35 -0700 | [diff] [blame] | 63 | $(eval unique_product_copy_files_destinations += $(_dest)))) |
Dan Willemsen | 403b98a | 2017-11-15 11:13:23 -0800 | [diff] [blame] | 64 | |
| 65 | # Dump a list of overriden (and ignored PRODUCT_COPY_FILES entries) |
Dan Willemsen | 7537fd0 | 2018-10-16 23:15:08 -0700 | [diff] [blame] | 66 | pcf_ignored_file := $(PRODUCT_OUT)/product_copy_files_ignored.txt |
| 67 | $(pcf_ignored_file): PRIVATE_IGNORED := $(sort $(product_copy_files_ignored)) |
| 68 | $(pcf_ignored_file): |
| 69 | echo "$(PRIVATE_IGNORED)" | tr " " "\n" >$@ |
Dan Willemsen | 403b98a | 2017-11-15 11:13:23 -0800 | [diff] [blame] | 70 | |
Dan Willemsen | 7537fd0 | 2018-10-16 23:15:08 -0700 | [diff] [blame] | 71 | $(call dist-for-goals,droidcore,$(pcf_ignored_file):logs/$(notdir $(pcf_ignored_file))) |
| 72 | |
| 73 | pcf_ignored_file := |
Dan Willemsen | 403b98a | 2017-11-15 11:13:23 -0800 | [diff] [blame] | 74 | product_copy_files_ignored := |
Ying Wang | 619fccf | 2012-09-05 18:08:29 -0700 | [diff] [blame] | 75 | unique_product_copy_files_pairs := |
Ying Wang | 7e8d442 | 2011-06-17 17:05:35 -0700 | [diff] [blame] | 76 | unique_product_copy_files_destinations := |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 77 | |
| 78 | # ----------------------------------------------------------------- |
Bowgo Tsai | 03b9c8e | 2017-11-17 15:22:37 +0800 | [diff] [blame] | 79 | # Returns the max allowed size for an image suitable for hash verification |
| 80 | # (e.g., boot.img, recovery.img, etc). |
| 81 | # The value 69632 derives from MAX_VBMETA_SIZE + MAX_FOOTER_SIZE in $(AVBTOOL). |
| 82 | # $(1): partition size to flash the image |
| 83 | define get-hash-image-max-size |
| 84 | $(if $(1), \ |
| 85 | $(if $(filter true,$(BOARD_AVB_ENABLE)), \ |
| 86 | $(eval _hash_meta_size := 69632), \ |
| 87 | $(eval _hash_meta_size := 0)) \ |
| 88 | $(1)-$(_hash_meta_size)) |
| 89 | endef |
| 90 | |
| 91 | # ----------------------------------------------------------------- |
Dan Willemsen | 6f60f02 | 2016-02-23 13:40:07 -0800 | [diff] [blame] | 92 | # Define rules to copy headers defined in copy_headers.mk |
| 93 | # If more than one makefile declared a header, print a warning, |
| 94 | # then copy the last one defined. This matches the previous make |
| 95 | # behavior. |
Dan Willemsen | 7f9bd56 | 2018-08-15 14:28:01 -0700 | [diff] [blame] | 96 | has_dup_copy_headers := |
Dan Willemsen | 6f60f02 | 2016-02-23 13:40:07 -0800 | [diff] [blame] | 97 | $(foreach dest,$(ALL_COPIED_HEADERS), \ |
| 98 | $(eval _srcs := $(ALL_COPIED_HEADERS.$(dest).SRC)) \ |
Dan Willemsen | f4249d1 | 2019-02-07 17:34:57 -0800 | [diff] [blame] | 99 | $(eval _src := $(lastword $(_srcs))) \ |
Dan Willemsen | 6f60f02 | 2016-02-23 13:40:07 -0800 | [diff] [blame] | 100 | $(if $(call streq,$(_src),$(_srcs)),, \ |
| 101 | $(warning Duplicate header copy: $(dest)) \ |
Dan Willemsen | f4249d1 | 2019-02-07 17:34:57 -0800 | [diff] [blame] | 102 | $(warning _ Using $(_src)) \ |
| 103 | $(warning __ from $(lastword $(ALL_COPIED_HEADERS.$(dest).MAKEFILE))) \ |
| 104 | $(eval _makefiles := $$(wordlist 1,$(call int_subtract,$(words $(ALL_COPIED_HEADERS.$(dest).MAKEFILE)),1),$$(ALL_COPIED_HEADERS.$$(dest).MAKEFILE))) \ |
| 105 | $(foreach src,$(wordlist 1,$(call int_subtract,$(words $(_srcs)),1),$(_srcs)), \ |
| 106 | $(warning _ Ignoring $(src)) \ |
| 107 | $(warning __ from $(firstword $(_makefiles))) \ |
| 108 | $(eval _makefiles := $$(wordlist 2,9999,$$(_makefiles)))) \ |
| 109 | $(eval has_dup_copy_headers := true)) \ |
Dan Willemsen | 6f60f02 | 2016-02-23 13:40:07 -0800 | [diff] [blame] | 110 | $(eval $(call copy-one-header,$(_src),$(dest)))) |
| 111 | all_copied_headers: $(ALL_COPIED_HEADERS) |
| 112 | |
Dan Willemsen | 7f9bd56 | 2018-08-15 14:28:01 -0700 | [diff] [blame] | 113 | ifdef has_dup_copy_headers |
| 114 | has_dup_copy_headers := |
Dan Willemsen | 1d4a56f | 2019-04-18 09:38:25 -0700 | [diff] [blame] | 115 | $(error duplicate header copies are no longer allowed. For more information about headers, see: https://android.googlesource.com/platform/build/soong/+/master/docs/best_practices.md#headers) |
Dan Willemsen | 7f9bd56 | 2018-08-15 14:28:01 -0700 | [diff] [blame] | 116 | endif |
| 117 | |
Dan Willemsen | 79a0caf | 2019-12-13 18:55:18 -0800 | [diff] [blame] | 118 | $(file >$(PRODUCT_OUT)/.copied_headers_list,$(TARGET_OUT_HEADERS) $(ALL_COPIED_HEADERS)) |
| 119 | |
Dan Willemsen | 6f60f02 | 2016-02-23 13:40:07 -0800 | [diff] [blame] | 120 | # ----------------------------------------------------------------- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 121 | # docs/index.html |
Ying Wang | 3f45b3c | 2012-04-02 18:21:36 -0700 | [diff] [blame] | 122 | ifeq (,$(TARGET_BUILD_APPS)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 123 | gen := $(OUT_DOCS)/index.html |
| 124 | ALL_DOCS += $(gen) |
| 125 | $(gen): frameworks/base/docs/docs-redirect-index.html |
| 126 | @mkdir -p $(dir $@) |
| 127 | @cp -f $< $@ |
Ying Wang | 3f45b3c | 2012-04-02 18:21:36 -0700 | [diff] [blame] | 128 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 129 | |
Dan Albert | 303e603 | 2017-10-04 10:20:20 -0700 | [diff] [blame] | 130 | ndk_doxygen_out := $(OUT_NDK_DOCS) |
| 131 | ndk_headers := $(SOONG_OUT_DIR)/ndk/sysroot/usr/include |
| 132 | ndk_docs_src_dir := frameworks/native/docs |
| 133 | ndk_doxyfile := $(ndk_docs_src_dir)/Doxyfile |
| 134 | ifneq ($(wildcard $(ndk_docs_src_dir)),) |
| 135 | ndk_docs_srcs := $(addprefix $(ndk_docs_src_dir)/,\ |
| 136 | $(call find-files-in-subdirs,$(ndk_docs_src_dir),"*",.)) |
| 137 | $(ndk_doxygen_out)/index.html: $(ndk_docs_srcs) $(SOONG_OUT_DIR)/ndk.timestamp |
| 138 | @mkdir -p $(ndk_doxygen_out) |
| 139 | @echo "Generating NDK docs to $(ndk_doxygen_out)" |
| 140 | @( cat $(ndk_doxyfile); \ |
| 141 | echo "INPUT=$(ndk_headers)"; \ |
| 142 | echo "HTML_OUTPUT=$(ndk_doxygen_out)" \ |
| 143 | ) | doxygen - |
| 144 | |
| 145 | # Note: Not a part of the docs target because we don't have doxygen available. |
| 146 | # You can run this target locally if you have doxygen installed. |
| 147 | ndk-docs: $(ndk_doxygen_out)/index.html |
| 148 | .PHONY: ndk-docs |
| 149 | endif |
| 150 | |
Colin Cross | d60401a | 2019-04-18 14:46:48 -0700 | [diff] [blame] | 151 | $(call dist-for-goals,sdk,$(API_FINGERPRINT)) |
Dan Willemsen | ad6a154 | 2018-12-14 01:04:19 -0800 | [diff] [blame] | 152 | |
| 153 | # ----------------------------------------------------------------- |
Jaekyun Seok | fbc07f9 | 2017-03-03 12:40:21 +0900 | [diff] [blame] | 154 | # property_overrides_split_enabled |
| 155 | property_overrides_split_enabled := |
| 156 | ifeq ($(BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED), true) |
| 157 | property_overrides_split_enabled := true |
Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 158 | endif |
| 159 | |
| 160 | # ----------------------------------------------------------------- |
Jaekyun Seok | c227ce7 | 2018-02-08 07:19:55 +0900 | [diff] [blame] | 161 | # FINAL_VENDOR_DEFAULT_PROPERTIES will be installed in vendor/default.prop if |
| 162 | # property_overrides_split_enabled is true. Otherwise it will be installed in |
| 163 | # ROOT/default.prop. |
| 164 | ifdef BOARD_VNDK_VERSION |
| 165 | ifeq ($(BOARD_VNDK_VERSION),current) |
| 166 | FINAL_VENDOR_DEFAULT_PROPERTIES := ro.vndk.version=$(PLATFORM_VNDK_VERSION) |
| 167 | else |
| 168 | FINAL_VENDOR_DEFAULT_PROPERTIES := ro.vndk.version=$(BOARD_VNDK_VERSION) |
| 169 | endif |
Logan Chien | d73b94c | 2018-05-04 19:33:17 +0800 | [diff] [blame] | 170 | ifdef BOARD_VNDK_RUNTIME_DISABLE |
| 171 | FINAL_VENDOR_DEFAULT_PROPERTIES += ro.vndk.lite=true |
| 172 | endif |
Jaekyun Seok | c227ce7 | 2018-02-08 07:19:55 +0900 | [diff] [blame] | 173 | else |
Logan Chien | d73b94c | 2018-05-04 19:33:17 +0800 | [diff] [blame] | 174 | FINAL_VENDOR_DEFAULT_PROPERTIES := ro.vndk.version=$(PLATFORM_VNDK_VERSION) |
| 175 | FINAL_VENDOR_DEFAULT_PROPERTIES += ro.vndk.lite=true |
Jaekyun Seok | c227ce7 | 2018-02-08 07:19:55 +0900 | [diff] [blame] | 176 | endif |
| 177 | FINAL_VENDOR_DEFAULT_PROPERTIES += \ |
| 178 | $(call collapse-pairs, $(PRODUCT_DEFAULT_PROPERTY_OVERRIDES)) |
Tao Bao | 5f99923 | 2018-09-04 11:42:53 -0700 | [diff] [blame] | 179 | |
Anton Hansson | 30851f2 | 2019-02-21 11:51:26 +0000 | [diff] [blame] | 180 | # Add cpu properties for bionic and ART. |
Haibo Huang | ee0531d | 2018-11-04 09:20:09 -0800 | [diff] [blame] | 181 | FINAL_VENDOR_DEFAULT_PROPERTIES += ro.bionic.arch=$(TARGET_ARCH) |
Anton Hansson | 71b7f7f | 2019-02-21 11:36:37 +0000 | [diff] [blame] | 182 | FINAL_VENDOR_DEFAULT_PROPERTIES += ro.bionic.cpu_variant=$(TARGET_CPU_VARIANT_RUNTIME) |
Haibo Huang | ee0531d | 2018-11-04 09:20:09 -0800 | [diff] [blame] | 183 | FINAL_VENDOR_DEFAULT_PROPERTIES += ro.bionic.2nd_arch=$(TARGET_2ND_ARCH) |
Anton Hansson | 71b7f7f | 2019-02-21 11:36:37 +0000 | [diff] [blame] | 184 | FINAL_VENDOR_DEFAULT_PROPERTIES += ro.bionic.2nd_cpu_variant=$(TARGET_2ND_CPU_VARIANT_RUNTIME) |
Haibo Huang | ee0531d | 2018-11-04 09:20:09 -0800 | [diff] [blame] | 185 | |
Anton Hansson | 30851f2 | 2019-02-21 11:51:26 +0000 | [diff] [blame] | 186 | FINAL_VENDOR_DEFAULT_PROPERTIES += persist.sys.dalvik.vm.lib.2=libart.so |
Anton Hansson | 71b7f7f | 2019-02-21 11:36:37 +0000 | [diff] [blame] | 187 | FINAL_VENDOR_DEFAULT_PROPERTIES += dalvik.vm.isa.$(TARGET_ARCH).variant=$(DEX2OAT_TARGET_CPU_VARIANT_RUNTIME) |
Anton Hansson | 30851f2 | 2019-02-21 11:51:26 +0000 | [diff] [blame] | 188 | ifneq ($(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES),) |
| 189 | FINAL_VENDOR_DEFAULT_PROPERTIES += dalvik.vm.isa.$(TARGET_ARCH).features=$(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) |
| 190 | endif |
| 191 | |
| 192 | ifdef TARGET_2ND_ARCH |
Anton Hansson | 71b7f7f | 2019-02-21 11:36:37 +0000 | [diff] [blame] | 193 | FINAL_VENDOR_DEFAULT_PROPERTIES += dalvik.vm.isa.$(TARGET_2ND_ARCH).variant=$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT_RUNTIME) |
Anton Hansson | 30851f2 | 2019-02-21 11:51:26 +0000 | [diff] [blame] | 194 | ifneq ($($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES),) |
| 195 | FINAL_VENDOR_DEFAULT_PROPERTIES += dalvik.vm.isa.$(TARGET_2ND_ARCH).features=$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) |
| 196 | endif |
| 197 | endif |
| 198 | |
Tao Bao | 5f99923 | 2018-09-04 11:42:53 -0700 | [diff] [blame] | 199 | # Although these variables are prefixed with TARGET_RECOVERY_, they are also needed under charger |
| 200 | # mode (via libminui). |
| 201 | ifdef TARGET_RECOVERY_DEFAULT_ROTATION |
| 202 | FINAL_VENDOR_DEFAULT_PROPERTIES += \ |
| 203 | ro.minui.default_rotation=$(TARGET_RECOVERY_DEFAULT_ROTATION) |
| 204 | endif |
| 205 | ifdef TARGET_RECOVERY_OVERSCAN_PERCENT |
| 206 | FINAL_VENDOR_DEFAULT_PROPERTIES += \ |
| 207 | ro.minui.overscan_percent=$(TARGET_RECOVERY_OVERSCAN_PERCENT) |
| 208 | endif |
| 209 | ifdef TARGET_RECOVERY_PIXEL_FORMAT |
| 210 | FINAL_VENDOR_DEFAULT_PROPERTIES += \ |
| 211 | ro.minui.pixel_format=$(TARGET_RECOVERY_PIXEL_FORMAT) |
| 212 | endif |
Jaekyun Seok | c227ce7 | 2018-02-08 07:19:55 +0900 | [diff] [blame] | 213 | FINAL_VENDOR_DEFAULT_PROPERTIES := $(call uniq-pairs-by-first-component, \ |
| 214 | $(FINAL_VENDOR_DEFAULT_PROPERTIES),=) |
| 215 | |
| 216 | # ----------------------------------------------------------------- |
Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 217 | # prop.default |
Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 218 | |
| 219 | BUILDINFO_SH := build/make/tools/buildinfo.sh |
| 220 | BUILDINFO_COMMON_SH := build/make/tools/buildinfo_common.sh |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 221 | POST_PROCESS_PROPS :=$= build/make/tools/post_process_props.py |
Anton Hansson | ee4c970 | 2018-12-21 15:36:00 +0000 | [diff] [blame] | 222 | |
| 223 | # Generates a set of sysprops common to all partitions to a file. |
Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 224 | # $(1): Partition name |
| 225 | # $(2): Output file name |
| 226 | define generate-common-build-props |
Anton Hansson | ee4c970 | 2018-12-21 15:36:00 +0000 | [diff] [blame] | 227 | PRODUCT_BRAND="$(PRODUCT_BRAND)" \ |
| 228 | PRODUCT_DEVICE="$(TARGET_DEVICE)" \ |
| 229 | PRODUCT_MANUFACTURER="$(PRODUCT_MANUFACTURER)" \ |
| 230 | PRODUCT_MODEL="$(PRODUCT_MODEL)" \ |
| 231 | PRODUCT_NAME="$(TARGET_PRODUCT)" \ |
| 232 | $(call generate-common-build-props-with-product-vars-set,$(1),$(2)) |
| 233 | endef |
| 234 | |
| 235 | # Like the above macro, but requiring the relevant PRODUCT_ environment |
| 236 | # variables to be set when called. |
| 237 | define generate-common-build-props-with-product-vars-set |
Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 238 | BUILD_FINGERPRINT="$(BUILD_FINGERPRINT_FROM_FILE)" \ |
| 239 | BUILD_ID="$(BUILD_ID)" \ |
| 240 | BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \ |
| 241 | BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \ |
| 242 | DATE="$(DATE_FROM_FILE)" \ |
| 243 | PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \ |
| 244 | PLATFORM_VERSION="$(PLATFORM_VERSION)" \ |
Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 245 | TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \ |
Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 246 | bash $(BUILDINFO_COMMON_SH) "$(1)" >> $(2) |
| 247 | endef |
| 248 | |
Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 249 | ifdef property_overrides_split_enabled |
| 250 | INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_OUT)/etc/prop.default |
Hung-ying Tyan | b260f0d | 2017-07-13 17:04:10 +0800 | [diff] [blame] | 251 | INSTALLED_DEFAULT_PROP_OLD_TARGET := $(TARGET_ROOT_OUT)/default.prop |
| 252 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_DEFAULT_PROP_OLD_TARGET) |
| 253 | $(INSTALLED_DEFAULT_PROP_OLD_TARGET): $(INSTALLED_DEFAULT_PROP_TARGET) |
Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 254 | else |
| 255 | # legacy path |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 256 | INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_ROOT_OUT)/default.prop |
Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 257 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 258 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_DEFAULT_PROP_TARGET) |
Jaekyun Seok | 294286d | 2017-01-20 13:17:12 +0900 | [diff] [blame] | 259 | FINAL_DEFAULT_PROPERTIES := \ |
Jaekyun Seok | b31b9ba | 2017-11-03 15:18:55 +0900 | [diff] [blame] | 260 | $(call collapse-pairs, $(ADDITIONAL_DEFAULT_PROPERTIES)) \ |
| 261 | $(call collapse-pairs, $(PRODUCT_SYSTEM_DEFAULT_PROPERTIES)) |
Jaekyun Seok | fbc07f9 | 2017-03-03 12:40:21 +0900 | [diff] [blame] | 262 | ifndef property_overrides_split_enabled |
Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 263 | FINAL_DEFAULT_PROPERTIES += \ |
Jaekyun Seok | c227ce7 | 2018-02-08 07:19:55 +0900 | [diff] [blame] | 264 | $(call collapse-pairs, $(FINAL_VENDOR_DEFAULT_PROPERTIES)) |
Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 265 | endif |
Jaekyun Seok | 294286d | 2017-01-20 13:17:12 +0900 | [diff] [blame] | 266 | FINAL_DEFAULT_PROPERTIES := $(call uniq-pairs-by-first-component, \ |
| 267 | $(FINAL_DEFAULT_PROPERTIES),=) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 268 | |
Andres Morales | b8876e1 | 2015-05-06 20:44:22 -0700 | [diff] [blame] | 269 | intermediate_system_build_prop := $(call intermediates-dir-for,ETC,system_build_prop)/build.prop |
| 270 | |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 271 | $(INSTALLED_DEFAULT_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) $(intermediate_system_build_prop) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 272 | @echo Target buildinfo: $@ |
| 273 | @mkdir -p $(dir $@) |
Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 274 | @rm -f $@ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 275 | $(hide) echo "#" > $@; \ |
| 276 | echo "# ADDITIONAL_DEFAULT_PROPERTIES" >> $@; \ |
| 277 | echo "#" >> $@; |
Jaekyun Seok | 294286d | 2017-01-20 13:17:12 +0900 | [diff] [blame] | 278 | $(hide) $(foreach line,$(FINAL_DEFAULT_PROPERTIES), \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 279 | echo "$(line)" >> $@;) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 280 | $(hide) $(POST_PROCESS_PROPS) $@ |
Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 281 | ifdef property_overrides_split_enabled |
| 282 | $(hide) mkdir -p $(TARGET_ROOT_OUT) |
Hung-ying Tyan | b260f0d | 2017-07-13 17:04:10 +0800 | [diff] [blame] | 283 | $(hide) ln -sf system/etc/prop.default $(INSTALLED_DEFAULT_PROP_OLD_TARGET) |
Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 284 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 285 | |
| 286 | # ----------------------------------------------------------------- |
Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 287 | # vendor default.prop |
| 288 | INSTALLED_VENDOR_DEFAULT_PROP_TARGET := |
Jaekyun Seok | fbc07f9 | 2017-03-03 12:40:21 +0900 | [diff] [blame] | 289 | ifdef property_overrides_split_enabled |
Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 290 | INSTALLED_VENDOR_DEFAULT_PROP_TARGET := $(TARGET_OUT_VENDOR)/default.prop |
| 291 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_VENDOR_DEFAULT_PROP_TARGET) |
| 292 | |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 293 | $(INSTALLED_VENDOR_DEFAULT_PROP_TARGET): $(INSTALLED_DEFAULT_PROP_TARGET) $(POST_PROCESS_PROPS) |
Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 294 | @echo Target buildinfo: $@ |
| 295 | @mkdir -p $(dir $@) |
| 296 | $(hide) echo "#" > $@; \ |
| 297 | echo "# ADDITIONAL VENDOR DEFAULT PROPERTIES" >> $@; \ |
| 298 | echo "#" >> $@; |
| 299 | $(hide) $(foreach line,$(FINAL_VENDOR_DEFAULT_PROPERTIES), \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 300 | echo "$(line)" >> $@;) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 301 | $(hide) $(POST_PROCESS_PROPS) $@ |
Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 302 | |
Jaekyun Seok | fbc07f9 | 2017-03-03 12:40:21 +0900 | [diff] [blame] | 303 | endif # property_overrides_split_enabled |
Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 304 | |
| 305 | # ----------------------------------------------------------------- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 306 | # build.prop |
| 307 | INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop |
| 308 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_BUILD_PROP_TARGET) |
Jaekyun Seok | 294286d | 2017-01-20 13:17:12 +0900 | [diff] [blame] | 309 | FINAL_BUILD_PROPERTIES := \ |
Ying Wang | 7e8d442 | 2011-06-17 17:05:35 -0700 | [diff] [blame] | 310 | $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES)) |
Jaekyun Seok | 294286d | 2017-01-20 13:17:12 +0900 | [diff] [blame] | 311 | FINAL_BUILD_PROPERTIES := $(call uniq-pairs-by-first-component, \ |
| 312 | $(FINAL_BUILD_PROPERTIES),=) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 313 | |
| 314 | # A list of arbitrary tags describing the build configuration. |
| 315 | # Force ":=" so we can use += |
| 316 | BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS) |
| 317 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 318 | BUILD_VERSION_TAGS += debug |
| 319 | endif |
Doug Zongker | 49c6a2b | 2011-10-05 12:41:56 -0700 | [diff] [blame] | 320 | # The "test-keys" tag marks builds signed with the old test keys, |
| 321 | # which are available in the SDK. "dev-keys" marks builds signed with |
| 322 | # non-default dev keys (usually private keys from a vendor directory). |
| 323 | # Both of these tags will be removed and replaced with "release-keys" |
| 324 | # when the target-files is signed in a post-build step. |
Dan Willemsen | 0ab1be6 | 2019-04-09 21:35:37 -0700 | [diff] [blame] | 325 | ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/make/target/product/security/testkey) |
Doug Zongker | a8608a7 | 2013-07-23 11:51:04 -0700 | [diff] [blame] | 326 | BUILD_KEYS := test-keys |
Doug Zongker | 49c6a2b | 2011-10-05 12:41:56 -0700 | [diff] [blame] | 327 | else |
Doug Zongker | a8608a7 | 2013-07-23 11:51:04 -0700 | [diff] [blame] | 328 | BUILD_KEYS := dev-keys |
Doug Zongker | 49c6a2b | 2011-10-05 12:41:56 -0700 | [diff] [blame] | 329 | endif |
Doug Zongker | a8608a7 | 2013-07-23 11:51:04 -0700 | [diff] [blame] | 330 | BUILD_VERSION_TAGS += $(BUILD_KEYS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 331 | BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS))) |
| 332 | |
| 333 | # A human-readable string that descibes this build in detail. |
Colin Cross | f37b455 | 2015-07-16 17:15:19 -0700 | [diff] [blame] | 334 | build_desc := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) $(PLATFORM_VERSION) $(BUILD_ID) $(BUILD_NUMBER_FROM_FILE) $(BUILD_VERSION_TAGS) |
Andres Morales | b8876e1 | 2015-05-06 20:44:22 -0700 | [diff] [blame] | 335 | $(intermediate_system_build_prop): PRIVATE_BUILD_DESC := $(build_desc) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 336 | |
Jeff Sharkey | 26e1a28 | 2014-03-21 16:20:05 -0700 | [diff] [blame] | 337 | # The string used to uniquely identify the combined build and product; used by the OTA server. |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 338 | ifeq (,$(strip $(BUILD_FINGERPRINT))) |
Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 339 | ifeq ($(strip $(HAS_BUILD_NUMBER)),false) |
Dan Willemsen | 63e48db | 2019-01-02 12:27:43 -0800 | [diff] [blame] | 340 | BF_BUILD_NUMBER := $(BUILD_USERNAME)$$($(DATE_FROM_FILE) +%m%d%H%M) |
Ying Wang | 50367cc | 2014-06-12 18:42:53 -0700 | [diff] [blame] | 341 | else |
Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 342 | BF_BUILD_NUMBER := $(file <$(BUILD_NUMBER_FILE)) |
Ying Wang | 50367cc | 2014-06-12 18:42:53 -0700 | [diff] [blame] | 343 | endif |
| 344 | BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 345 | endif |
Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 346 | # unset it for safety. |
| 347 | BF_BUILD_NUMBER := |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 348 | |
Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 349 | BUILD_FINGERPRINT_FILE := $(PRODUCT_OUT)/build_fingerprint.txt |
| 350 | ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_FINGERPRINT) >$(BUILD_FINGERPRINT_FILE) && grep " " $(BUILD_FINGERPRINT_FILE))) |
| 351 | $(error BUILD_FINGERPRINT cannot contain spaces: "$(file <$(BUILD_FINGERPRINT_FILE))") |
| 352 | endif |
| 353 | BUILD_FINGERPRINT_FROM_FILE := $$(cat $(BUILD_FINGERPRINT_FILE)) |
| 354 | # unset it for safety. |
| 355 | BUILD_FINGERPRINT := |
Colin Cross | f37b455 | 2015-07-16 17:15:19 -0700 | [diff] [blame] | 356 | |
Jeff Sharkey | 26e1a28 | 2014-03-21 16:20:05 -0700 | [diff] [blame] | 357 | # The string used to uniquely identify the system build; used by the OTA server. |
| 358 | # This purposefully excludes any product-specific variables. |
| 359 | ifeq (,$(strip $(BUILD_THUMBPRINT))) |
Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 360 | BUILD_THUMBPRINT := $(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER_FROM_FILE):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS) |
Jeff Sharkey | 26e1a28 | 2014-03-21 16:20:05 -0700 | [diff] [blame] | 361 | endif |
Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 362 | |
| 363 | BUILD_THUMBPRINT_FILE := $(PRODUCT_OUT)/build_thumbprint.txt |
| 364 | ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_THUMBPRINT) >$(BUILD_THUMBPRINT_FILE) && grep " " $(BUILD_THUMBPRINT_FILE))) |
| 365 | $(error BUILD_THUMBPRINT cannot contain spaces: "$(file <$(BUILD_THUMBPRINT_FILE))") |
Jeff Sharkey | 26e1a28 | 2014-03-21 16:20:05 -0700 | [diff] [blame] | 366 | endif |
Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 367 | BUILD_THUMBPRINT_FROM_FILE := $$(cat $(BUILD_THUMBPRINT_FILE)) |
| 368 | # unset it for safety. |
| 369 | BUILD_THUMBPRINT := |
Jeff Sharkey | 26e1a28 | 2014-03-21 16:20:05 -0700 | [diff] [blame] | 370 | |
Ying Wang | e24e17a | 2014-10-07 18:42:11 -0700 | [diff] [blame] | 371 | KNOWN_OEM_THUMBPRINT_PROPERTIES := \ |
| 372 | ro.product.brand \ |
| 373 | ro.product.name \ |
| 374 | ro.product.device |
| 375 | OEM_THUMBPRINT_PROPERTIES := $(filter $(KNOWN_OEM_THUMBPRINT_PROPERTIES),\ |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 376 | $(PRODUCT_OEM_PROPERTIES)) |
Ying Wang | e24e17a | 2014-10-07 18:42:11 -0700 | [diff] [blame] | 377 | |
Sriram Raman | 7b64124 | 2009-03-24 22:40:59 -0700 | [diff] [blame] | 378 | # Display parameters shown under Settings -> About Phone |
| 379 | ifeq ($(TARGET_BUILD_VARIANT),user) |
| 380 | # User builds should show: |
| 381 | # release build number or branch.buld_number non-release builds |
| 382 | |
| 383 | # Dev. branches should have DISPLAY_BUILD_NUMBER set |
Colin Cross | 63fe36a | 2017-02-21 17:23:02 -0800 | [diff] [blame] | 384 | ifeq (true,$(DISPLAY_BUILD_NUMBER)) |
Colin Cross | f37b455 | 2015-07-16 17:15:19 -0700 | [diff] [blame] | 385 | BUILD_DISPLAY_ID := $(BUILD_ID).$(BUILD_NUMBER_FROM_FILE) $(BUILD_KEYS) |
Sriram Raman | 7b64124 | 2009-03-24 22:40:59 -0700 | [diff] [blame] | 386 | else |
Doug Zongker | a8608a7 | 2013-07-23 11:51:04 -0700 | [diff] [blame] | 387 | BUILD_DISPLAY_ID := $(BUILD_ID) $(BUILD_KEYS) |
Sriram Raman | 7b64124 | 2009-03-24 22:40:59 -0700 | [diff] [blame] | 388 | endif |
| 389 | else |
| 390 | # Non-user builds should show detailed build information |
| 391 | BUILD_DISPLAY_ID := $(build_desc) |
| 392 | endif |
| 393 | |
Narayan Kamath | baf3eb9 | 2015-01-15 18:16:24 +0000 | [diff] [blame] | 394 | # Accepts a whitespace separated list of product locales such as |
| 395 | # (en_US en_AU en_GB...) and returns the first locale in the list with |
| 396 | # underscores replaced with hyphens. In the example above, this will |
| 397 | # return "en-US". |
| 398 | define get-default-product-locale |
| 399 | $(strip $(subst _,-, $(firstword $(1)))) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 400 | endef |
| 401 | |
Vishwath Mohan | 9ebc278 | 2017-05-09 09:54:49 -0700 | [diff] [blame] | 402 | # TARGET_BUILD_FLAVOR and ro.build.flavor are used only by the test |
| 403 | # harness to distinguish builds. Only add _asan for a sanitized build |
| 404 | # if it isn't already a part of the flavor (via a dedicated lunch |
| 405 | # config for example). |
Ying Wang | 21ec03d | 2015-10-28 18:45:03 -0700 | [diff] [blame] | 406 | TARGET_BUILD_FLAVOR := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) |
Ivan Lozano | 0f71db3 | 2017-08-14 07:57:37 -0700 | [diff] [blame] | 407 | ifneq (, $(filter address, $(SANITIZE_TARGET))) |
Vishwath Mohan | 9ebc278 | 2017-05-09 09:54:49 -0700 | [diff] [blame] | 408 | ifeq (,$(findstring _asan,$(TARGET_BUILD_FLAVOR))) |
Ying Wang | 21ec03d | 2015-10-28 18:45:03 -0700 | [diff] [blame] | 409 | TARGET_BUILD_FLAVOR := $(TARGET_BUILD_FLAVOR)_asan |
| 410 | endif |
Vishwath Mohan | 9ebc278 | 2017-05-09 09:54:49 -0700 | [diff] [blame] | 411 | endif |
Ying Wang | 21ec03d | 2015-10-28 18:45:03 -0700 | [diff] [blame] | 412 | |
Andrew Boie | fa61ff0 | 2012-09-28 09:33:45 -0700 | [diff] [blame] | 413 | ifdef TARGET_SYSTEM_PROP |
| 414 | system_prop_file := $(TARGET_SYSTEM_PROP) |
| 415 | else |
| 416 | system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop) |
| 417 | endif |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 418 | $(intermediate_system_build_prop): $(BUILDINFO_SH) $(BUILDINFO_COMMON_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(BUILD_SYSTEM)/version_defaults.mk $(system_prop_file) $(INSTALLED_ANDROID_INFO_TXT_TARGET) $(API_FINGERPRINT) $(POST_PROCESS_PROPS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 419 | @echo Target buildinfo: $@ |
| 420 | @mkdir -p $(dir $@) |
Jeff Sharkey | 26d22f7 | 2014-03-18 17:20:10 -0700 | [diff] [blame] | 421 | $(hide) echo > $@ |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 422 | ifneq ($(PRODUCT_OEM_PROPERTIES),) |
Jeff Sharkey | 26d22f7 | 2014-03-18 17:20:10 -0700 | [diff] [blame] | 423 | $(hide) echo "#" >> $@; \ |
| 424 | echo "# PRODUCT_OEM_PROPERTIES" >> $@; \ |
Jeff Sharkey | 26e1a28 | 2014-03-21 16:20:05 -0700 | [diff] [blame] | 425 | echo "#" >> $@; |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 426 | $(hide) $(foreach prop,$(PRODUCT_OEM_PROPERTIES), \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 427 | echo "import /oem/oem.prop $(prop)" >> $@;) |
Jeff Sharkey | 26d22f7 | 2014-03-18 17:20:10 -0700 | [diff] [blame] | 428 | endif |
Anton Hansson | ee4c970 | 2018-12-21 15:36:00 +0000 | [diff] [blame] | 429 | $(hide) PRODUCT_BRAND="$(PRODUCT_SYSTEM_BRAND)" \ |
| 430 | PRODUCT_MANUFACTURER="$(PRODUCT_SYSTEM_MANUFACTURER)" \ |
| 431 | PRODUCT_MODEL="$(PRODUCT_SYSTEM_MODEL)" \ |
| 432 | PRODUCT_NAME="$(PRODUCT_SYSTEM_NAME)" \ |
| 433 | PRODUCT_DEVICE="$(PRODUCT_SYSTEM_DEVICE)" \ |
| 434 | $(call generate-common-build-props-with-product-vars-set,system,$@) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 435 | $(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 436 | TARGET_BUILD_FLAVOR="$(TARGET_BUILD_FLAVOR)" \ |
| 437 | TARGET_DEVICE="$(TARGET_DEVICE)" \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 438 | PRODUCT_DEFAULT_LOCALE="$(call get-default-product-locale,$(PRODUCT_LOCALES))" \ |
| 439 | PRODUCT_DEFAULT_WIFI_CHANNELS="$(PRODUCT_DEFAULT_WIFI_CHANNELS)" \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 440 | PRIVATE_BUILD_DESC="$(PRIVATE_BUILD_DESC)" \ |
| 441 | BUILD_ID="$(BUILD_ID)" \ |
| 442 | BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \ |
| 443 | DATE="$(DATE_FROM_FILE)" \ |
Dan Willemsen | 63e48db | 2019-01-02 12:27:43 -0800 | [diff] [blame] | 444 | BUILD_USERNAME="$(BUILD_USERNAME)" \ |
| 445 | BUILD_HOSTNAME="$(BUILD_HOSTNAME)" \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 446 | BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \ |
| 447 | BOARD_BUILD_SYSTEM_ROOT_IMAGE="$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)" \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 448 | PLATFORM_VERSION="$(PLATFORM_VERSION)" \ |
| 449 | PLATFORM_SECURITY_PATCH="$(PLATFORM_SECURITY_PATCH)" \ |
| 450 | PLATFORM_BASE_OS="$(PLATFORM_BASE_OS)" \ |
| 451 | PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \ |
| 452 | PLATFORM_PREVIEW_SDK_VERSION="$(PLATFORM_PREVIEW_SDK_VERSION)" \ |
Colin Cross | d60401a | 2019-04-18 14:46:48 -0700 | [diff] [blame] | 453 | PLATFORM_PREVIEW_SDK_FINGERPRINT="$$(cat $(API_FINGERPRINT))" \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 454 | PLATFORM_VERSION_CODENAME="$(PLATFORM_VERSION_CODENAME)" \ |
| 455 | PLATFORM_VERSION_ALL_CODENAMES="$(PLATFORM_VERSION_ALL_CODENAMES)" \ |
| 456 | PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION="$(PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION)" \ |
| 457 | BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 458 | $(if $(OEM_THUMBPRINT_PROPERTIES),BUILD_THUMBPRINT="$(BUILD_THUMBPRINT_FROM_FILE)") \ |
| 459 | TARGET_CPU_ABI_LIST="$(TARGET_CPU_ABI_LIST)" \ |
| 460 | TARGET_CPU_ABI_LIST_32_BIT="$(TARGET_CPU_ABI_LIST_32_BIT)" \ |
| 461 | TARGET_CPU_ABI_LIST_64_BIT="$(TARGET_CPU_ABI_LIST_64_BIT)" \ |
| 462 | TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \ |
| 463 | TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \ |
Jeff Sharkey | 26d22f7 | 2014-03-18 17:20:10 -0700 | [diff] [blame] | 464 | bash $(BUILDINFO_SH) >> $@ |
Johan Redestig | 674a27d | 2012-04-12 17:00:58 +0200 | [diff] [blame] | 465 | $(hide) $(foreach file,$(system_prop_file), \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 466 | if [ -f "$(file)" ]; then \ |
| 467 | echo Target buildinfo from: "$(file)"; \ |
| 468 | echo "" >> $@; \ |
| 469 | echo "#" >> $@; \ |
| 470 | echo "# from $(file)" >> $@; \ |
| 471 | echo "#" >> $@; \ |
| 472 | cat $(file) >> $@; \ |
| 473 | echo "# end of $(file)" >> $@; \ |
| 474 | fi;) |
Jaekyun Seok | 294286d | 2017-01-20 13:17:12 +0900 | [diff] [blame] | 475 | $(if $(FINAL_BUILD_PROPERTIES), \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 476 | $(hide) echo >> $@; \ |
| 477 | echo "#" >> $@; \ |
| 478 | echo "# ADDITIONAL_BUILD_PROPERTIES" >> $@; \ |
| 479 | echo "#" >> $@; ) |
Jaekyun Seok | 294286d | 2017-01-20 13:17:12 +0900 | [diff] [blame] | 480 | $(hide) $(foreach line,$(FINAL_BUILD_PROPERTIES), \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 481 | echo "$(line)" >> $@;) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 482 | $(hide) $(POST_PROCESS_PROPS) $@ $(PRODUCT_SYSTEM_PROPERTY_BLACKLIST) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 483 | |
| 484 | build_desc := |
| 485 | |
Andres Morales | b8876e1 | 2015-05-06 20:44:22 -0700 | [diff] [blame] | 486 | INSTALLED_RECOVERYIMAGE_TARGET := |
Chris Gross | a784ef1 | 2019-04-22 11:09:57 -0700 | [diff] [blame] | 487 | ifdef BUILDING_RECOVERY_IMAGE |
| 488 | ifneq ($(BOARD_USES_RECOVERY_AS_BOOT),true) |
| 489 | INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img |
| 490 | endif |
Andres Morales | b8876e1 | 2015-05-06 20:44:22 -0700 | [diff] [blame] | 491 | endif |
| 492 | |
Jooyung Han | 72b65ab | 2019-05-23 19:48:13 +0900 | [diff] [blame] | 493 | $(INSTALLED_BUILD_PROP_TARGET): $(intermediate_system_build_prop) |
Andres Morales | b8876e1 | 2015-05-06 20:44:22 -0700 | [diff] [blame] | 494 | @echo "Target build info: $@" |
Steven Moreland | ec08265 | 2017-10-22 02:11:47 -0700 | [diff] [blame] | 495 | $(hide) grep -v 'ro.product.first_api_level' $(intermediate_system_build_prop) > $@ |
Andres Morales | b8876e1 | 2015-05-06 20:44:22 -0700 | [diff] [blame] | 496 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 497 | # ----------------------------------------------------------------- |
Daniel Rosenberg | 40b61ca | 2014-07-21 17:21:20 -0700 | [diff] [blame] | 498 | # vendor build.prop |
| 499 | # |
Alex Naidis | 47e24e9 | 2016-01-10 14:18:54 +0000 | [diff] [blame] | 500 | # For verifying that the vendor build is what we think it is |
Daniel Rosenberg | 40b61ca | 2014-07-21 17:21:20 -0700 | [diff] [blame] | 501 | INSTALLED_VENDOR_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR)/build.prop |
| 502 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_VENDOR_BUILD_PROP_TARGET) |
Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 503 | |
Jaekyun Seok | fbc07f9 | 2017-03-03 12:40:21 +0900 | [diff] [blame] | 504 | ifdef property_overrides_split_enabled |
Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 505 | FINAL_VENDOR_BUILD_PROPERTIES += \ |
| 506 | $(call collapse-pairs, $(PRODUCT_PROPERTY_OVERRIDES)) |
| 507 | FINAL_VENDOR_BUILD_PROPERTIES := $(call uniq-pairs-by-first-component, \ |
| 508 | $(FINAL_VENDOR_BUILD_PROPERTIES),=) |
Jaekyun Seok | fbc07f9 | 2017-03-03 12:40:21 +0900 | [diff] [blame] | 509 | endif # property_overrides_split_enabled |
Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 510 | |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 511 | $(INSTALLED_VENDOR_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) $(intermediate_system_build_prop) |
Daniel Rosenberg | 40b61ca | 2014-07-21 17:21:20 -0700 | [diff] [blame] | 512 | @echo Target vendor buildinfo: $@ |
| 513 | @mkdir -p $(dir $@) |
| 514 | $(hide) echo > $@ |
Hridya Valsaraju | 1fd498d | 2019-05-07 10:28:49 -0700 | [diff] [blame] | 515 | ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true) |
| 516 | $(hide) echo ro.boot.dynamic_partitions=true >> $@ |
| 517 | endif |
| 518 | ifeq ($(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS),true) |
| 519 | $(hide) echo ro.boot.dynamic_partitions_retrofit=true >> $@ |
| 520 | endif |
Sandeep Patil | 127f501 | 2017-10-23 19:47:43 -0700 | [diff] [blame] | 521 | $(hide) grep 'ro.product.first_api_level' $(intermediate_system_build_prop) >> $@ || true |
Max Bires | a174998 | 2018-03-28 15:48:13 -0700 | [diff] [blame] | 522 | $(hide) echo ro.vendor.build.security_patch="$(VENDOR_SECURITY_PATCH)">>$@ |
Isaac Chen | 8d11feb | 2018-01-31 14:27:37 +0800 | [diff] [blame] | 523 | $(hide) echo ro.vendor.product.cpu.abilist="$(TARGET_CPU_ABI_LIST)">>$@ |
| 524 | $(hide) echo ro.vendor.product.cpu.abilist32="$(TARGET_CPU_ABI_LIST_32_BIT)">>$@ |
| 525 | $(hide) echo ro.vendor.product.cpu.abilist64="$(TARGET_CPU_ABI_LIST_64_BIT)">>$@ |
Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 526 | $(hide) echo ro.product.board="$(TARGET_BOOTLOADER_BOARD_NAME)">>$@ |
| 527 | $(hide) echo ro.board.platform="$(TARGET_BOARD_PLATFORM)">>$@ |
Stan Iliev | 144d26a | 2018-12-14 13:18:05 -0500 | [diff] [blame] | 528 | $(hide) echo ro.hwui.use_vulkan="$(TARGET_USES_VULKAN)">>$@ |
Anton Hansson | 45a40da | 2019-01-18 14:06:34 +0000 | [diff] [blame] | 529 | ifdef TARGET_SCREEN_DENSITY |
| 530 | $(hide) echo ro.sf.lcd_density="$(TARGET_SCREEN_DENSITY)">>$@ |
| 531 | endif |
Tao Bao | 67932ab | 2019-04-19 00:09:16 -0700 | [diff] [blame] | 532 | ifeq ($(AB_OTA_UPDATER),true) |
| 533 | $(hide) echo ro.build.ab_update=true >> $@ |
| 534 | endif |
Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 535 | $(hide) $(call generate-common-build-props,vendor,$@) |
Anton Hansson | 15794ca | 2019-04-08 17:47:35 +0100 | [diff] [blame] | 536 | $(hide) echo "#" >> $@; \ |
| 537 | echo "# BOOTIMAGE_BUILD_PROPERTIES" >> $@; \ |
| 538 | echo "#" >> $@; |
Anton Hansson | f299889 | 2019-04-29 15:39:10 +0100 | [diff] [blame] | 539 | $(hide) echo ro.bootimage.build.date=`$(DATE_FROM_FILE)`>>$@ |
| 540 | $(hide) echo ro.bootimage.build.date.utc=`$(DATE_FROM_FILE) +%s`>>$@ |
| 541 | $(hide) echo ro.bootimage.build.fingerprint="$(BUILD_FINGERPRINT_FROM_FILE)">>$@ |
Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 542 | $(hide) echo "#" >> $@; \ |
| 543 | echo "# ADDITIONAL VENDOR BUILD PROPERTIES" >> $@; \ |
| 544 | echo "#" >> $@; |
Anton Hansson | c65ebaf | 2019-04-09 16:21:51 +0100 | [diff] [blame] | 545 | $(hide) cat $(INSTALLED_ANDROID_INFO_TXT_TARGET) | grep 'require version-' | sed -e 's/require version-/ro.build.expect./g' >> $@ |
| 546 | ifdef property_overrides_split_enabled |
Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 547 | $(hide) $(foreach line,$(FINAL_VENDOR_BUILD_PROPERTIES), \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 548 | echo "$(line)" >> $@;) |
Jaekyun Seok | fbc07f9 | 2017-03-03 12:40:21 +0900 | [diff] [blame] | 549 | endif # property_overrides_split_enabled |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 550 | $(hide) $(POST_PROCESS_PROPS) $@ $(PRODUCT_VENDOR_PROPERTY_BLACKLIST) |
Daniel Rosenberg | 40b61ca | 2014-07-21 17:21:20 -0700 | [diff] [blame] | 551 | |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 552 | # ----------------------------------------------------------------- |
| 553 | # product build.prop |
| 554 | INSTALLED_PRODUCT_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT)/build.prop |
| 555 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_PRODUCT_BUILD_PROP_TARGET) |
| 556 | |
Anton Hansson | e9ee80e | 2018-11-22 15:27:35 +0000 | [diff] [blame] | 557 | ifdef TARGET_PRODUCT_PROP |
| 558 | product_prop_files := $(TARGET_PRODUCT_PROP) |
| 559 | else |
| 560 | product_prop_files := $(wildcard $(TARGET_DEVICE_DIR)/product.prop) |
| 561 | endif |
| 562 | |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 563 | FINAL_PRODUCT_PROPERTIES += \ |
Yifan Hong | af9e7f0 | 2018-07-27 13:11:50 -0700 | [diff] [blame] | 564 | $(call collapse-pairs, $(PRODUCT_PRODUCT_PROPERTIES) $(ADDITIONAL_PRODUCT_PROPERTIES)) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 565 | FINAL_PRODUCT_PROPERTIES := $(call uniq-pairs-by-first-component, \ |
| 566 | $(FINAL_PRODUCT_PROPERTIES),=) |
| 567 | |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 568 | $(INSTALLED_PRODUCT_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) $(product_prop_files) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 569 | @echo Target product buildinfo: $@ |
| 570 | @mkdir -p $(dir $@) |
| 571 | $(hide) echo > $@ |
| 572 | ifdef BOARD_USES_PRODUCTIMAGE |
Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 573 | $(hide) $(call generate-common-build-props,product,$@) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 574 | endif # BOARD_USES_PRODUCTIMAGE |
Anton Hansson | e9ee80e | 2018-11-22 15:27:35 +0000 | [diff] [blame] | 575 | $(hide) $(foreach file,$(product_prop_files), \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 576 | if [ -f "$(file)" ]; then \ |
| 577 | echo Target product properties from: "$(file)"; \ |
| 578 | echo "" >> $@; \ |
| 579 | echo "#" >> $@; \ |
| 580 | echo "# from $(file)" >> $@; \ |
| 581 | echo "#" >> $@; \ |
| 582 | cat $(file) >> $@; \ |
| 583 | echo "# end of $(file)" >> $@; \ |
| 584 | fi;) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 585 | $(hide) echo "#" >> $@; \ |
| 586 | echo "# ADDITIONAL PRODUCT PROPERTIES" >> $@; \ |
Anton Hansson | 5ac408b | 2018-11-05 17:29:28 +0000 | [diff] [blame] | 587 | echo "#" >> $@; \ |
Anton Hansson | e9ee80e | 2018-11-22 15:27:35 +0000 | [diff] [blame] | 588 | echo "ro.build.characteristics=$(TARGET_AAPT_CHARACTERISTICS)" >> $@; |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 589 | $(hide) $(foreach line,$(FINAL_PRODUCT_PROPERTIES), \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 590 | echo "$(line)" >> $@;) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 591 | $(hide) $(POST_PROCESS_PROPS) $@ |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 592 | |
Andres Morales | 9c820f8 | 2015-01-13 15:30:34 -0800 | [diff] [blame] | 593 | # ---------------------------------------------------------------- |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 594 | # odm build.prop |
Bowgo Tsai | 71a4d5c | 2019-05-17 23:21:48 +0800 | [diff] [blame] | 595 | INSTALLED_ODM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM)/etc/build.prop |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 596 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_ODM_BUILD_PROP_TARGET) |
| 597 | |
| 598 | FINAL_ODM_BUILD_PROPERTIES += \ |
| 599 | $(call collapse-pairs, $(PRODUCT_ODM_PROPERTIES)) |
| 600 | FINAL_ODM_BUILD_PROPERTIES := $(call uniq-pairs-by-first-component, \ |
| 601 | $(FINAL_ODM_BUILD_PROPERTIES),=) |
| 602 | |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 603 | $(INSTALLED_ODM_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 604 | @echo Target odm buildinfo: $@ |
| 605 | @mkdir -p $(dir $@) |
| 606 | $(hide) echo > $@ |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 607 | $(hide) echo ro.odm.product.cpu.abilist="$(TARGET_CPU_ABI_LIST)">>$@ |
| 608 | $(hide) echo ro.odm.product.cpu.abilist32="$(TARGET_CPU_ABI_LIST_32_BIT)">>$@ |
| 609 | $(hide) echo ro.odm.product.cpu.abilist64="$(TARGET_CPU_ABI_LIST_64_BIT)">>$@ |
Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 610 | $(hide) $(call generate-common-build-props,odm,$@) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 611 | $(hide) echo "#" >> $@; \ |
| 612 | echo "# ADDITIONAL ODM BUILD PROPERTIES" >> $@; \ |
| 613 | echo "#" >> $@; |
| 614 | $(hide) $(foreach line,$(FINAL_ODM_BUILD_PROPERTIES), \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 615 | echo "$(line)" >> $@;) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 616 | $(hide) $(POST_PROCESS_PROPS) $@ |
Andres Morales | 9c820f8 | 2015-01-13 15:30:34 -0800 | [diff] [blame] | 617 | |
Daniel Rosenberg | 40b61ca | 2014-07-21 17:21:20 -0700 | [diff] [blame] | 618 | # ----------------------------------------------------------------- |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 619 | # system_ext build.prop |
| 620 | INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET := $(TARGET_OUT_SYSTEM_EXT)/build.prop |
| 621 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 622 | |
Bowgo Tsai | 06533fe | 2019-09-02 18:17:02 +0800 | [diff] [blame] | 623 | ifdef TARGET_SYSTEM_EXT_PROP |
| 624 | system_ext_prop_files := $(TARGET_SYSTEM_EXT_PROP) |
| 625 | else |
| 626 | system_ext_prop_files := $(wildcard $(TARGET_DEVICE_DIR)/system_ext.prop) |
| 627 | endif |
| 628 | |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 629 | FINAL_SYSTEM_EXT_PROPERTIES += \ |
| 630 | $(call collapse-pairs, $(PRODUCT_SYSTEM_EXT_PROPERTIES)) |
| 631 | FINAL_SYSTEM_EXT_PROPERTIES := $(call uniq-pairs-by-first-component, \ |
| 632 | $(FINAL_SYSTEM_EXT_PROPERTIES),=) |
| 633 | |
Bowgo Tsai | 06533fe | 2019-09-02 18:17:02 +0800 | [diff] [blame] | 634 | $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) $(system_ext_prop_files) |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 635 | @echo Target system_ext buildinfo: $@ |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 636 | @mkdir -p $(dir $@) |
| 637 | $(hide) echo > $@ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 638 | $(hide) $(call generate-common-build-props,system_ext,$@) |
Bowgo Tsai | 06533fe | 2019-09-02 18:17:02 +0800 | [diff] [blame] | 639 | $(hide) $(foreach file,$(system_ext_prop_files), \ |
| 640 | if [ -f "$(file)" ]; then \ |
| 641 | echo Target system_ext properties from: "$(file)"; \ |
| 642 | echo "" >> $@; \ |
| 643 | echo "#" >> $@; \ |
| 644 | echo "# from $(file)" >> $@; \ |
| 645 | echo "#" >> $@; \ |
| 646 | cat $(file) >> $@; \ |
| 647 | echo "# end of $(file)" >> $@; \ |
| 648 | fi;) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 649 | $(hide) echo "#" >> $@; \ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 650 | echo "# ADDITIONAL SYSTEM_EXT BUILD PROPERTIES" >> $@; \ |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 651 | echo "#" >> $@; |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 652 | $(hide) $(foreach line,$(FINAL_SYSTEM_EXT_PROPERTIES), \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 653 | echo "$(line)" >> $@;) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 654 | $(hide) $(POST_PROCESS_PROPS) $@ |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 655 | |
| 656 | # ---------------------------------------------------------------- |
| 657 | |
| 658 | # ----------------------------------------------------------------- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 659 | # sdk-build.prop |
| 660 | # |
| 661 | # There are certain things in build.prop that we don't want to |
| 662 | # ship with the sdk; remove them. |
| 663 | |
| 664 | # This must be a list of entire property keys followed by |
| 665 | # "=" characters, without any internal spaces. |
| 666 | sdk_build_prop_remove := \ |
| 667 | ro.build.user= \ |
| 668 | ro.build.host= \ |
| 669 | ro.product.brand= \ |
| 670 | ro.product.manufacturer= \ |
| 671 | ro.product.device= |
| 672 | # TODO: Remove this soon-to-be obsolete property |
| 673 | sdk_build_prop_remove += ro.build.product= |
| 674 | INSTALLED_SDK_BUILD_PROP_TARGET := $(PRODUCT_OUT)/sdk/sdk-build.prop |
| 675 | $(INSTALLED_SDK_BUILD_PROP_TARGET): $(INSTALLED_BUILD_PROP_TARGET) |
| 676 | @echo SDK buildinfo: $@ |
| 677 | @mkdir -p $(dir $@) |
| 678 | $(hide) grep -v "$(subst $(space),\|,$(strip \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 679 | $(sdk_build_prop_remove)))" $< > $@.tmp |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 680 | $(hide) for x in $(sdk_build_prop_remove); do \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 681 | echo "$$x"generic >> $@.tmp; done |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 682 | $(hide) mv $@.tmp $@ |
| 683 | |
| 684 | # ----------------------------------------------------------------- |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 685 | # kernel modules |
| 686 | |
| 687 | # Depmod requires a well-formed kernel version so 0.0 is used as a placeholder. |
| 688 | DEPMOD_STAGING_SUBDIR :=$= lib/modules/0.0 |
| 689 | |
| 690 | # $(1): modules list |
| 691 | # $(2): output dir |
| 692 | # $(3): mount point |
| 693 | # $(4): staging dir |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 694 | # $(5): module load list |
| 695 | # $(6): module load list filename |
Steve Muckle | 810a0ba | 2019-11-13 13:29:02 -0800 | [diff] [blame] | 696 | # $(7): module archive |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 697 | # Returns the a list of src:dest pairs to install the modules using copy-many-files. |
| 698 | define build-image-kernel-modules |
| 699 | $(foreach module,$(1),$(module):$(2)/lib/modules/$(notdir $(module))) \ |
Steve Muckle | 810a0ba | 2019-11-13 13:29:02 -0800 | [diff] [blame] | 700 | $(eval $(call build-image-kernel-modules-depmod,$(1),$(3),$(4),$(5),$(6),$(7),$(2))) \ |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 701 | $(4)/$(DEPMOD_STAGING_SUBDIR)/modules.dep:$(2)/lib/modules/modules.dep \ |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 702 | $(4)/$(DEPMOD_STAGING_SUBDIR)/modules.alias:$(2)/lib/modules/modules.alias \ |
Steve Muckle | 0f7bb1b | 2019-07-11 17:42:13 -0700 | [diff] [blame] | 703 | $(4)/$(DEPMOD_STAGING_SUBDIR)/modules.softdep:$(2)/lib/modules/modules.softdep \ |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 704 | $(4)/$(DEPMOD_STAGING_SUBDIR)/$(6):$(2)/lib/modules/$(6) |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 705 | endef |
| 706 | |
| 707 | # $(1): modules list |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 708 | # $(2): mount point |
| 709 | # $(3): staging dir |
| 710 | # $(4): module load list |
| 711 | # $(5): module load list filename |
Steve Muckle | 810a0ba | 2019-11-13 13:29:02 -0800 | [diff] [blame] | 712 | # $(6): module archive |
| 713 | # $(7): output dir |
| 714 | # TODO(b/144844424): If a module archive is being used, this step (which |
| 715 | # generates obj/PACKAGING/.../modules.dep) also unzips the module archive into |
| 716 | # the output directory. This should be moved to a module with a |
| 717 | # LOCAL_POST_INSTALL_CMD so that if modules.dep is removed from the output dir, |
| 718 | # the archive modules are restored along with modules.dep. |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 719 | define build-image-kernel-modules-depmod |
Steve Muckle | 0f7bb1b | 2019-07-11 17:42:13 -0700 | [diff] [blame] | 720 | $(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep: .KATI_IMPLICIT_OUTPUTS := $(3)/$(DEPMOD_STAGING_SUBDIR)/modules.alias $(3)/$(DEPMOD_STAGING_SUBDIR)/modules.softdep $(3)/$(DEPMOD_STAGING_SUBDIR)/$(5) |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 721 | $(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep: $(DEPMOD) |
| 722 | $(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep: PRIVATE_MODULES := $(1) |
| 723 | $(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep: PRIVATE_MOUNT_POINT := $(2) |
| 724 | $(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep: PRIVATE_MODULE_DIR := $(3)/$(DEPMOD_STAGING_SUBDIR)/$(2)/lib/modules |
| 725 | $(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep: PRIVATE_STAGING_DIR := $(3) |
| 726 | $(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep: PRIVATE_LOAD_MODULES := $(4) |
| 727 | $(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep: PRIVATE_LOAD_FILE := $(3)/$(DEPMOD_STAGING_SUBDIR)/$(5) |
Steve Muckle | 810a0ba | 2019-11-13 13:29:02 -0800 | [diff] [blame] | 728 | $(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep: PRIVATE_MODULE_ARCHIVE := $(6) |
| 729 | $(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep: PRIVATE_OUTPUT_DIR := $(7) |
| 730 | $(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep: $(1) $(6) |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 731 | @echo depmod $$(PRIVATE_STAGING_DIR) |
| 732 | rm -rf $$(PRIVATE_STAGING_DIR) |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 733 | mkdir -p $$(PRIVATE_MODULE_DIR) |
Steve Muckle | 810a0ba | 2019-11-13 13:29:02 -0800 | [diff] [blame] | 734 | $(if $(6),\ |
| 735 | unzip -qo -d $$(PRIVATE_MODULE_DIR) $$(PRIVATE_MODULE_ARCHIVE); \ |
| 736 | mkdir -p $$(PRIVATE_OUTPUT_DIR)/lib; \ |
| 737 | rm -rf $$(PRIVATE_OUTPUT_DIR)/lib/modules; \ |
| 738 | cp -r $$(PRIVATE_MODULE_DIR) $$(PRIVATE_OUTPUT_DIR)/lib/; \ |
| 739 | find $$(PRIVATE_MODULE_DIR) -type f -name *.ko | xargs basename -a > $$(PRIVATE_LOAD_FILE); \ |
| 740 | ) |
| 741 | $(if $(1),\ |
| 742 | cp $$(PRIVATE_MODULES) $$(PRIVATE_MODULE_DIR)/; \ |
| 743 | for MODULE in $$(PRIVATE_LOAD_MODULES); do \ |
| 744 | basename $$$$MODULE >> $$(PRIVATE_LOAD_FILE); \ |
| 745 | done; \ |
| 746 | ) |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 747 | $(DEPMOD) -b $$(PRIVATE_STAGING_DIR) 0.0 |
| 748 | # Turn paths in modules.dep into absolute paths |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 749 | sed -i.tmp -e 's|\([^: ]*lib/modules/[^: ]*\)|/\1|g' $$(PRIVATE_STAGING_DIR)/$$(DEPMOD_STAGING_SUBDIR)/modules.dep |
| 750 | touch $$(PRIVATE_LOAD_FILE) |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 751 | endef |
| 752 | |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 753 | # $(1): staging dir |
| 754 | # $(2): module load list |
| 755 | # $(3): module load list filename |
| 756 | # $(4): output dir |
| 757 | define module-load-list-copy-paths |
| 758 | $(eval $(call build-image-module-load-list,$(1),$(2),$(3))) \ |
| 759 | $(1)/$(DEPMOD_STAGING_SUBDIR)/$(3):$(4)/lib/modules/$(3) |
| 760 | endef |
| 761 | |
| 762 | # $(1): staging dir |
| 763 | # $(2): module load list |
| 764 | # $(3): module load list filename |
| 765 | define build-image-module-load-list |
| 766 | $(1)/$(DEPMOD_STAGING_SUBDIR)/$(3): PRIVATE_STAGING_DIR := $(1) |
| 767 | $(1)/$(DEPMOD_STAGING_SUBDIR)/$(3): PRIVATE_LOAD_MODULES := $(2) |
| 768 | $(1)/$(DEPMOD_STAGING_SUBDIR)/$(3): PRIVATE_LOAD_FILENAME := $(3) |
| 769 | $(1)/$(DEPMOD_STAGING_SUBDIR)/$(3): $(2) |
| 770 | rm -f $$@ |
| 771 | (for MODULE in $$(PRIVATE_LOAD_MODULES); do basename $$$$MODULE >> $$@; done) |
| 772 | endef |
| 773 | |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 774 | ifneq ($(BUILDING_VENDOR_BOOT_IMAGE),true) |
| 775 | # If there is no vendor boot partition, store vendor ramdisk kernel modules in the |
| 776 | # boot ramdisk. |
Steve Muckle | 69280d2 | 2019-07-11 12:23:38 -0700 | [diff] [blame] | 777 | BOARD_GENERIC_RAMDISK_KERNEL_MODULES += $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES) |
Steve Muckle | 69280d2 | 2019-07-11 12:23:38 -0700 | [diff] [blame] | 778 | BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD += $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD) |
| 779 | endif |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 780 | |
| 781 | ifeq ($(BOARD_RECOVERY_KERNEL_MODULES_LOAD),) |
| 782 | BOARD_RECOVERY_KERNEL_MODULES_LOAD := $(BOARD_RECOVERY_KERNEL_MODULES) |
| 783 | endif |
Steve Muckle | 69280d2 | 2019-07-11 12:23:38 -0700 | [diff] [blame] | 784 | ifeq ($(BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD),) |
| 785 | BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD := $(BOARD_GENERIC_RAMDISK_KERNEL_MODULES) |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 786 | endif |
| 787 | |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 788 | ifneq ($(strip $(BOARD_GENERIC_RAMDISK_KERNEL_MODULES)),) |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 789 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT), true) |
Steve Muckle | 69280d2 | 2019-07-11 12:23:38 -0700 | [diff] [blame] | 790 | BOARD_RECOVERY_KERNEL_MODULES += $(BOARD_GENERIC_RAMDISK_KERNEL_MODULES) |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 791 | endif |
| 792 | endif |
| 793 | |
Steve Muckle | 810a0ba | 2019-11-13 13:29:02 -0800 | [diff] [blame] | 794 | ifneq ($(strip $(BOARD_RECOVERY_KERNEL_MODULES))$(strip $(BOARD_RECOVERY_KERNEL_MODULES_ARCHIVE)),) |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 795 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT), true) |
Steve Muckle | 69280d2 | 2019-07-11 12:23:38 -0700 | [diff] [blame] | 796 | ifdef BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD |
| 797 | ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(call module-load-list-copy-paths,$(call intermediates-dir-for,PACKAGING,ramdisk_modules),$(BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD),modules.load,$(TARGET_RECOVERY_ROOT_OUT))) |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 798 | endif |
| 799 | endif |
Steve Muckle | 810a0ba | 2019-11-13 13:29:02 -0800 | [diff] [blame] | 800 | ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(call build-image-kernel-modules,$(BOARD_RECOVERY_KERNEL_MODULES),$(TARGET_RECOVERY_ROOT_OUT),,$(call intermediates-dir-for,PACKAGING,depmod_recovery),$(BOARD_RECOVERY_KERNEL_MODULES_LOAD),modules.load.recovery,$(BOARD_RECOVERY_KERNEL_MODULES_ARCHIVE))) |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 801 | endif |
| 802 | |
Steve Muckle | 810a0ba | 2019-11-13 13:29:02 -0800 | [diff] [blame] | 803 | ifneq ($(strip $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES))$(strip $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_ARCHIVE)),) |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 804 | ifeq ($(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD),) |
| 805 | BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES) |
| 806 | endif |
Steve Muckle | 810a0ba | 2019-11-13 13:29:02 -0800 | [diff] [blame] | 807 | ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(call build-image-kernel-modules,$(BOARD_VENDOR_RAMDISK_KERNEL_MODULES),$(TARGET_VENDOR_RAMDISK_OUT),,$(call intermediates-dir-for,PACKAGING,depmod_vendor_ramdisk),$(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD),modules.load,$(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_ARCHIVE))) |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 808 | endif |
| 809 | |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 810 | ifneq ($(BOARD_USES_RECOVERY_AS_BOOT), true) |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 811 | ifneq ($(strip $(BOARD_GENERIC_RAMDISK_KERNEL_MODULES)),) |
Steve Muckle | 810a0ba | 2019-11-13 13:29:02 -0800 | [diff] [blame] | 812 | ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(call build-image-kernel-modules,$(BOARD_GENERIC_RAMDISK_KERNEL_MODULES),$(TARGET_RAMDISK_OUT),,$(call intermediates-dir-for,PACKAGING,depmod_ramdisk),$(BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD),modules.load,)) |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 813 | endif |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 814 | endif |
| 815 | |
Steve Muckle | 810a0ba | 2019-11-13 13:29:02 -0800 | [diff] [blame] | 816 | ifneq ($(strip $(BOARD_VENDOR_KERNEL_MODULES)$(strip $(BOARD_VENDOR_KERNEL_MODULES_ARCHIVE))),) |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 817 | ifeq ($(BOARD_VENDOR_KERNEL_MODULES_LOAD),) |
| 818 | BOARD_VENDOR_KERNEL_MODULES_LOAD := $(BOARD_VENDOR_KERNEL_MODULES) |
| 819 | endif |
Steve Muckle | 810a0ba | 2019-11-13 13:29:02 -0800 | [diff] [blame] | 820 | ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(call build-image-kernel-modules,$(BOARD_VENDOR_KERNEL_MODULES),$(TARGET_OUT_VENDOR),vendor,$(call intermediates-dir-for,PACKAGING,depmod_vendor),$(BOARD_VENDOR_KERNEL_MODULES_LOAD),modules.load,$(BOARD_VENDOR_KERNEL_MODULES_ARCHIVE))) |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 821 | endif |
| 822 | |
Steve Muckle | 810a0ba | 2019-11-13 13:29:02 -0800 | [diff] [blame] | 823 | ifneq ($(strip $(BOARD_ODM_KERNEL_MODULES))$(strip $(BOARD_ODM_KERNEL_MODULES_ARCHIVE)),) |
Steve Muckle | 474e4d0 | 2019-06-19 12:56:48 -0700 | [diff] [blame] | 824 | ifeq ($(BOARD_RECOVERY_KERNEL_MODULES_LOAD),) |
| 825 | BOARD_ODM_KERNEL_MODULES_LOAD := $(BOARD_ODM_KERNEL_MODULES) |
| 826 | endif |
Steve Muckle | 810a0ba | 2019-11-13 13:29:02 -0800 | [diff] [blame] | 827 | ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(call build-image-kernel-modules,$(BOARD_ODM_KERNEL_MODULES),$(TARGET_OUT_ODM),odm,$(call intermediates-dir-for,PACKAGING,depmod_odm),$(BOARD_ODM_KERNEL_MODULES_LOAD),modules.load,$(BOARD_ODM_KERNEL_MODULES_ARCHIVE))) |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 828 | endif |
| 829 | |
| 830 | # ----------------------------------------------------------------- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 831 | # Cert-to-package mapping. Used by the post-build signing tools. |
Ying Wang | d9a88d5 | 2012-10-26 09:21:28 -0700 | [diff] [blame] | 832 | # Use a macro to add newline to each echo command |
Narayan Kamath | 6a4bd69 | 2017-08-14 10:53:50 +0100 | [diff] [blame] | 833 | define _apkcerts_write_line |
| 834 | $(hide) echo -n 'name="$(1).apk" certificate="$2" private_key="$3"' >> $5 |
| 835 | $(if $(4), $(hide) echo -n ' compressed="$4"' >> $5) |
| 836 | $(hide) echo '' >> $5 |
Ying Wang | d9a88d5 | 2012-10-26 09:21:28 -0700 | [diff] [blame] | 837 | |
| 838 | endef |
| 839 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 840 | name := $(TARGET_PRODUCT) |
| 841 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 842 | name := $(name)_debug |
| 843 | endif |
| 844 | name := $(name)-apkcerts-$(FILE_NAME_TAG) |
| 845 | intermediates := \ |
| 846 | $(call intermediates-dir-for,PACKAGING,apkcerts) |
| 847 | APKCERTS_FILE := $(intermediates)/$(name).txt |
Ying Wang | 15e487a | 2011-02-15 10:56:18 -0800 | [diff] [blame] | 848 | # We don't need to really build all the modules. |
| 849 | # TODO: rebuild APKCERTS_FILE if any app change its cert. |
Ying Wang | efb2168 | 2010-07-23 16:42:13 -0700 | [diff] [blame] | 850 | $(APKCERTS_FILE): |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 851 | @echo APK certs list: $@ |
| 852 | @mkdir -p $(dir $@) |
| 853 | @rm -f $@ |
Chris Gross | fabf50a | 2019-05-02 12:42:09 -0700 | [diff] [blame] | 854 | $(foreach p,$(sort $(PACKAGES)),\ |
Ying Wang | d9a88d5 | 2012-10-26 09:21:28 -0700 | [diff] [blame] | 855 | $(if $(PACKAGES.$(p).EXTERNAL_KEY),\ |
Narayan Kamath | 6a4bd69 | 2017-08-14 10:53:50 +0100 | [diff] [blame] | 856 | $(call _apkcerts_write_line,$(p),"EXTERNAL","",$(PACKAGES.$(p).COMPRESSED),$@),\ |
| 857 | $(call _apkcerts_write_line,$(p),$(PACKAGES.$(p).CERTIFICATE),$(PACKAGES.$(p).PRIVATE_KEY),$(PACKAGES.$(p).COMPRESSED),$@))) |
Ying Wang | d9a88d5 | 2012-10-26 09:21:28 -0700 | [diff] [blame] | 858 | # In case value of PACKAGES is empty. |
Ying Wang | f272cd6 | 2011-09-26 12:05:06 -0700 | [diff] [blame] | 859 | $(hide) touch $@ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 860 | |
| 861 | .PHONY: apkcerts-list |
| 862 | apkcerts-list: $(APKCERTS_FILE) |
| 863 | |
Ying Wang | 15e487a | 2011-02-15 10:56:18 -0800 | [diff] [blame] | 864 | ifneq (,$(TARGET_BUILD_APPS)) |
| 865 | $(call dist-for-goals, apps_only, $(APKCERTS_FILE):apkcerts.txt) |
Jiyong Park | bcc8d8a | 2019-02-18 15:21:19 +0900 | [diff] [blame] | 866 | $(call dist-for-goals, apps_only, $(SOONG_APEX_KEYS_FILE):apexkeys.txt) |
Ying Wang | 15e487a | 2011-02-15 10:56:18 -0800 | [diff] [blame] | 867 | endif |
Ying Wang | efb2168 | 2010-07-23 16:42:13 -0700 | [diff] [blame] | 868 | |
Jiyong Park | bcc8d8a | 2019-02-18 15:21:19 +0900 | [diff] [blame] | 869 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 870 | # ----------------------------------------------------------------- |
Dan Willemsen | 3bf15e7 | 2016-07-25 16:03:53 -0700 | [diff] [blame] | 871 | # build system stats |
| 872 | BUILD_SYSTEM_STATS := $(PRODUCT_OUT)/build_system_stats.txt |
| 873 | $(BUILD_SYSTEM_STATS): |
| 874 | @rm -f $@ |
| 875 | @$(foreach s,$(STATS.MODULE_TYPE),echo "modules_type_make,$(s),$(words $(STATS.MODULE_TYPE.$(s)))" >>$@;) |
| 876 | @$(foreach s,$(STATS.SOONG_MODULE_TYPE),echo "modules_type_soong,$(s),$(STATS.SOONG_MODULE_TYPE.$(s))" >>$@;) |
| 877 | $(call dist-for-goals,droidcore,$(BUILD_SYSTEM_STATS)) |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 878 | |
Dan Willemsen | 3bf15e7 | 2016-07-25 16:03:53 -0700 | [diff] [blame] | 879 | # ----------------------------------------------------------------- |
Bowgo Tsai | e4544b1 | 2019-02-27 10:15:51 +0800 | [diff] [blame] | 880 | # build /product/etc/security/avb/system_other.avbpubkey if needed |
| 881 | ifdef BUILDING_SYSTEM_OTHER_IMAGE |
Bowgo Tsai | 8802b71 | 2019-03-21 14:24:31 +0800 | [diff] [blame] | 882 | ifeq ($(BOARD_AVB_ENABLE),true) |
Bowgo Tsai | e4544b1 | 2019-02-27 10:15:51 +0800 | [diff] [blame] | 883 | INSTALLED_PRODUCT_SYSTEM_OTHER_AVBKEY_TARGET := $(TARGET_OUT_PRODUCT_ETC)/security/avb/system_other.avbpubkey |
| 884 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_PRODUCT_SYSTEM_OTHER_AVBKEY_TARGET) |
Bowgo Tsai | 8802b71 | 2019-03-21 14:24:31 +0800 | [diff] [blame] | 885 | endif # BOARD_AVB_ENABLE |
Bowgo Tsai | e4544b1 | 2019-02-27 10:15:51 +0800 | [diff] [blame] | 886 | endif # BUILDING_SYSTEM_OTHER_IMAGE |
| 887 | |
| 888 | # ----------------------------------------------------------------- |
Dan Willemsen | fc92fb2 | 2016-08-26 13:27:13 -0700 | [diff] [blame] | 889 | # Modules ready to be converted to Soong, ordered by how many |
| 890 | # modules depend on them. |
| 891 | SOONG_CONV := $(sort $(SOONG_CONV)) |
| 892 | SOONG_CONV_DATA := $(call intermediates-dir-for,PACKAGING,soong_conversion)/soong_conv_data |
| 893 | $(SOONG_CONV_DATA): |
| 894 | @rm -f $@ |
Colin Cross | 3277ba3 | 2017-12-06 14:37:06 -0800 | [diff] [blame] | 895 | @$(foreach s,$(SOONG_CONV),echo "$(s),$(SOONG_CONV.$(s).TYPE),$(sort $(SOONG_CONV.$(s).PROBLEMS)),$(sort $(filter-out $(SOONG_ALREADY_CONV),$(SOONG_CONV.$(s).DEPS)))" >>$@;) |
Dan Willemsen | fc92fb2 | 2016-08-26 13:27:13 -0700 | [diff] [blame] | 896 | |
Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 897 | SOONG_TO_CONVERT_SCRIPT := build/make/tools/soong_to_convert.py |
Dan Willemsen | fc92fb2 | 2016-08-26 13:27:13 -0700 | [diff] [blame] | 898 | SOONG_TO_CONVERT := $(PRODUCT_OUT)/soong_to_convert.txt |
| 899 | $(SOONG_TO_CONVERT): $(SOONG_CONV_DATA) $(SOONG_TO_CONVERT_SCRIPT) |
| 900 | @rm -f $@ |
| 901 | $(hide) $(SOONG_TO_CONVERT_SCRIPT) $< >$@ |
| 902 | $(call dist-for-goals,droidcore,$(SOONG_TO_CONVERT)) |
| 903 | |
| 904 | # ----------------------------------------------------------------- |
Chih-Hung Hsieh | 1876acd | 2017-11-06 10:47:24 -0800 | [diff] [blame] | 905 | # Modules use -Wno-error, or added default -Wall -Werror |
| 906 | WALL_WERROR := $(PRODUCT_OUT)/wall_werror.txt |
| 907 | $(WALL_WERROR): |
| 908 | @rm -f $@ |
| 909 | echo "# Modules using -Wno-error" >> $@ |
| 910 | for m in $(sort $(SOONG_MODULES_USING_WNO_ERROR) $(MODULES_USING_WNO_ERROR)); do echo $$m >> $@; done |
Chih-Hung Hsieh | 1876acd | 2017-11-06 10:47:24 -0800 | [diff] [blame] | 911 | echo "# Modules added default -Wall" >> $@ |
| 912 | for m in $(sort $(SOONG_MODULES_ADDED_WALL) $(MODULES_ADDED_WALL)); do echo $$m >> $@; done |
| 913 | |
| 914 | $(call dist-for-goals,droidcore,$(WALL_WERROR)) |
| 915 | |
| 916 | # ----------------------------------------------------------------- |
Jesse Pai | d004692 | 2019-09-13 17:02:32 -0700 | [diff] [blame] | 917 | # C/C++ flag information for modules |
| 918 | $(call dist-for-goals,droidcore,$(SOONG_MODULES_CFLAG_ARTIFACTS)) |
| 919 | |
| 920 | # ----------------------------------------------------------------- |
Pirama Arumuga Nainar | ae95956 | 2018-01-29 09:22:24 -0800 | [diff] [blame] | 921 | # Modules missing profile files |
| 922 | PGO_PROFILE_MISSING := $(PRODUCT_OUT)/pgo_profile_file_missing.txt |
| 923 | $(PGO_PROFILE_MISSING): |
| 924 | @rm -f $@ |
| 925 | echo "# Modules missing PGO profile files" >> $@ |
| 926 | for m in $(SOONG_MODULES_MISSING_PGO_PROFILE_FILE); do echo $$m >> $@; done |
| 927 | |
| 928 | $(call dist-for-goals,droidcore,$(PGO_PROFILE_MISSING)) |
| 929 | |
| 930 | # ----------------------------------------------------------------- |
Ying Wang | 3c21fe5 | 2011-10-04 10:50:08 -0700 | [diff] [blame] | 931 | # The dev key is used to sign this package, and as the key required |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 932 | # for future OTA packages installed by this system. Actual product |
| 933 | # deliverables will be re-signed by hand. We expect this file to |
| 934 | # exist with the suffixes ".x509.pem" and ".pk8". |
Colin Cross | 21122f9 | 2018-09-14 21:51:11 -0700 | [diff] [blame] | 935 | DEFAULT_KEY_CERT_PAIR := $(strip $(DEFAULT_SYSTEM_DEV_CERTIFICATE)) |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 936 | |
| 937 | |
Jeff Brown | e33ba4c | 2011-07-11 22:11:46 -0700 | [diff] [blame] | 938 | # Rules that need to be present for the all targets, even |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 939 | # if they don't do anything. |
| 940 | .PHONY: systemimage |
| 941 | systemimage: |
| 942 | |
Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 943 | # ----------------------------------------------------------------- |
| 944 | |
| 945 | .PHONY: event-log-tags |
| 946 | |
Joe Onorato | b751053 | 2010-07-14 10:22:54 -0700 | [diff] [blame] | 947 | # Produce an event logs tag file for everything we know about, in order |
| 948 | # to properly allocate numbers. Then produce a file that's filtered |
| 949 | # for what's going to be installed. |
| 950 | |
| 951 | all_event_log_tags_file := $(TARGET_OUT_COMMON_INTERMEDIATES)/all-event-log-tags.txt |
| 952 | |
Colin Cross | dc8f8e4 | 2012-04-12 13:25:54 -0700 | [diff] [blame] | 953 | event_log_tags_file := $(TARGET_OUT)/etc/event-log-tags |
| 954 | |
Joe Onorato | b751053 | 2010-07-14 10:22:54 -0700 | [diff] [blame] | 955 | # Include tags from all packages that we know about |
| 956 | all_event_log_tags_src := \ |
| 957 | $(sort $(foreach m, $(ALL_MODULES), $(ALL_MODULES.$(m).EVENT_LOG_TAGS))) |
| 958 | |
Colin Cross | dc8f8e4 | 2012-04-12 13:25:54 -0700 | [diff] [blame] | 959 | # PDK builds will already have a full list of tags that needs to get merged |
| 960 | # in with the ones from source |
| 961 | pdk_fusion_log_tags_file := $(patsubst $(PRODUCT_OUT)/%,$(_pdk_fusion_intermediates)/%,$(filter $(event_log_tags_file),$(ALL_PDK_FUSION_FILES))) |
| 962 | |
| 963 | $(all_event_log_tags_file): PRIVATE_SRC_FILES := $(all_event_log_tags_src) $(pdk_fusion_log_tags_file) |
Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 964 | $(all_event_log_tags_file): $(all_event_log_tags_src) $(pdk_fusion_log_tags_file) $(MERGETAGS) build/make/tools/event_log_tags.py |
Joe Onorato | b751053 | 2010-07-14 10:22:54 -0700 | [diff] [blame] | 965 | $(hide) mkdir -p $(dir $@) |
Shinichiro Hamaji | d3ce14c | 2016-03-29 03:29:21 +0900 | [diff] [blame] | 966 | $(hide) $(MERGETAGS) -o $@ $(PRIVATE_SRC_FILES) |
Joe Onorato | b751053 | 2010-07-14 10:22:54 -0700 | [diff] [blame] | 967 | |
Doug Zongker | a34fa95 | 2011-02-23 12:17:29 -0800 | [diff] [blame] | 968 | # Include tags from all packages included in this product, plus all |
| 969 | # tags that are part of the system (ie, not in a vendor/ or device/ |
| 970 | # directory). |
Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 971 | event_log_tags_src := \ |
| 972 | $(sort $(foreach m,\ |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 973 | $(PRODUCT_PACKAGES) \ |
Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 974 | $(call module-names-for-tag-list,user), \ |
Doug Zongker | a34fa95 | 2011-02-23 12:17:29 -0800 | [diff] [blame] | 975 | $(ALL_MODULES.$(m).EVENT_LOG_TAGS)) \ |
| 976 | $(filter-out vendor/% device/% out/%,$(all_event_log_tags_src))) |
Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 977 | |
Colin Cross | dc8f8e4 | 2012-04-12 13:25:54 -0700 | [diff] [blame] | 978 | $(event_log_tags_file): PRIVATE_SRC_FILES := $(event_log_tags_src) $(pdk_fusion_log_tags_file) |
Joe Onorato | b751053 | 2010-07-14 10:22:54 -0700 | [diff] [blame] | 979 | $(event_log_tags_file): PRIVATE_MERGED_FILE := $(all_event_log_tags_file) |
Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 980 | $(event_log_tags_file): $(event_log_tags_src) $(all_event_log_tags_file) $(pdk_fusion_log_tags_file) $(MERGETAGS) build/make/tools/event_log_tags.py |
Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 981 | $(hide) mkdir -p $(dir $@) |
Shinichiro Hamaji | d3ce14c | 2016-03-29 03:29:21 +0900 | [diff] [blame] | 982 | $(hide) $(MERGETAGS) -o $@ -m $(PRIVATE_MERGED_FILE) $(PRIVATE_SRC_FILES) |
Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 983 | |
| 984 | event-log-tags: $(event_log_tags_file) |
| 985 | |
| 986 | ALL_DEFAULT_INSTALLED_MODULES += $(event_log_tags_file) |
| 987 | |
Joe Onorato | b751053 | 2010-07-14 10:22:54 -0700 | [diff] [blame] | 988 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 989 | # ################################################################# |
| 990 | # Targets for boot/OS images |
| 991 | # ################################################################# |
Ying Wang | c634974 | 2014-01-13 16:14:20 -0800 | [diff] [blame] | 992 | ifneq ($(strip $(TARGET_NO_BOOTLOADER)),true) |
| 993 | INSTALLED_BOOTLOADER_MODULE := $(PRODUCT_OUT)/bootloader |
| 994 | ifeq ($(strip $(TARGET_BOOTLOADER_IS_2ND)),true) |
| 995 | INSTALLED_2NDBOOTLOADER_TARGET := $(PRODUCT_OUT)/2ndbootloader |
| 996 | else |
| 997 | INSTALLED_2NDBOOTLOADER_TARGET := |
| 998 | endif |
| 999 | else |
| 1000 | INSTALLED_BOOTLOADER_MODULE := |
| 1001 | INSTALLED_2NDBOOTLOADER_TARGET := |
| 1002 | endif # TARGET_NO_BOOTLOADER |
| 1003 | ifneq ($(strip $(TARGET_NO_KERNEL)),true) |
| 1004 | INSTALLED_KERNEL_TARGET := $(PRODUCT_OUT)/kernel |
| 1005 | else |
| 1006 | INSTALLED_KERNEL_TARGET := |
| 1007 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1008 | |
| 1009 | # ----------------------------------------------------------------- |
Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1010 | # the root dir |
| 1011 | INTERNAL_ROOT_FILES := $(filter $(TARGET_ROOT_OUT)/%, \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1012 | $(ALL_GENERATED_SOURCES) \ |
| 1013 | $(ALL_DEFAULT_INSTALLED_MODULES)) |
| 1014 | |
Luis Hector Chavez | ff48993 | 2018-07-03 15:41:40 -0700 | [diff] [blame] | 1015 | INSTALLED_FILES_FILE_ROOT := $(PRODUCT_OUT)/installed-files-root.txt |
| 1016 | INSTALLED_FILES_JSON_ROOT := $(INSTALLED_FILES_FILE_ROOT:.txt=.json) |
| 1017 | $(INSTALLED_FILES_FILE_ROOT): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_ROOT) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 1018 | $(INSTALLED_FILES_FILE_ROOT) : $(INTERNAL_ROOT_FILES) $(FILESLIST) $(FILESLIST_UTIL) |
Luis Hector Chavez | ff48993 | 2018-07-03 15:41:40 -0700 | [diff] [blame] | 1019 | @echo Installed file list: $@ |
| 1020 | @mkdir -p $(dir $@) |
| 1021 | @rm -f $@ |
| 1022 | $(hide) $(FILESLIST) $(TARGET_ROOT_OUT) > $(@:.txt=.json) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 1023 | $(hide) $(FILESLIST_UTIL) -c $(@:.txt=.json) > $@ |
Luis Hector Chavez | ff48993 | 2018-07-03 15:41:40 -0700 | [diff] [blame] | 1024 | |
| 1025 | $(call dist-for-goals, sdk win_sdk sdk_addon, $(INSTALLED_FILES_FILE_ROOT)) |
| 1026 | |
Hridya Valsaraju | 9683b2f | 2019-01-22 18:08:59 -0800 | [diff] [blame] | 1027 | #------------------------------------------------------------------ |
| 1028 | # dtb |
Hridya Valsaraju | 59eaef0 | 2019-05-20 11:10:24 -0700 | [diff] [blame] | 1029 | ifdef BOARD_INCLUDE_DTB_IN_BOOTIMG |
Hridya Valsaraju | 9683b2f | 2019-01-22 18:08:59 -0800 | [diff] [blame] | 1030 | INSTALLED_DTBIMAGE_TARGET := $(PRODUCT_OUT)/dtb.img |
Hridya Valsaraju | 59eaef0 | 2019-05-20 11:10:24 -0700 | [diff] [blame] | 1031 | ifdef BOARD_PREBUILT_DTBIMAGE_DIR |
Hridya Valsaraju | c63a744 | 2019-02-07 11:38:18 -0800 | [diff] [blame] | 1032 | $(INSTALLED_DTBIMAGE_TARGET) : $(sort $(wildcard $(BOARD_PREBUILT_DTBIMAGE_DIR)/*.dtb)) |
Hridya Valsaraju | 9683b2f | 2019-01-22 18:08:59 -0800 | [diff] [blame] | 1033 | cat $^ > $@ |
| 1034 | endif |
Hridya Valsaraju | 59eaef0 | 2019-05-20 11:10:24 -0700 | [diff] [blame] | 1035 | endif |
Hridya Valsaraju | 9683b2f | 2019-01-22 18:08:59 -0800 | [diff] [blame] | 1036 | |
Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1037 | # ----------------------------------------------------------------- |
| 1038 | # the ramdisk |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 1039 | ifdef BUILDING_RAMDISK_IMAGE |
Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1040 | INTERNAL_RAMDISK_FILES := $(filter $(TARGET_RAMDISK_OUT)/%, \ |
| 1041 | $(ALL_GENERATED_SOURCES) \ |
| 1042 | $(ALL_DEFAULT_INSTALLED_MODULES)) |
| 1043 | |
| 1044 | INSTALLED_FILES_FILE_RAMDISK := $(PRODUCT_OUT)/installed-files-ramdisk.txt |
| 1045 | INSTALLED_FILES_JSON_RAMDISK := $(INSTALLED_FILES_FILE_RAMDISK:.txt=.json) |
| 1046 | $(INSTALLED_FILES_FILE_RAMDISK): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_RAMDISK) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 1047 | $(INSTALLED_FILES_FILE_RAMDISK) : $(INTERNAL_RAMDISK_FILES) $(FILESLIST) $(FILESLIST_UTIL) |
Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1048 | @echo Installed file list: $@ |
SzuWei Lin | 29770fa | 2019-03-28 11:46:48 +0800 | [diff] [blame] | 1049 | @mkdir -p $(TARGET_RAMDISK_OUT) |
Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1050 | @mkdir -p $(dir $@) |
| 1051 | @rm -f $@ |
| 1052 | $(hide) $(FILESLIST) $(TARGET_RAMDISK_OUT) > $(@:.txt=.json) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 1053 | $(hide) $(FILESLIST_UTIL) -c $(@:.txt=.json) > $@ |
Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1054 | |
| 1055 | $(call dist-for-goals, sdk win_sdk sdk_addon, $(INSTALLED_FILES_FILE_RAMDISK)) |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 1056 | BUILT_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.img |
| 1057 | |
| 1058 | # We just build this directly to the install location. |
| 1059 | INSTALLED_RAMDISK_TARGET := $(BUILT_RAMDISK_TARGET) |
Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1060 | $(INSTALLED_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_RAMDISK_FILES) $(INSTALLED_FILES_FILE_RAMDISK) | $(MINIGZIP) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1061 | $(call pretty,"Target ram disk: $@") |
Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1062 | $(hide) $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RAMDISK_OUT) | $(MINIGZIP) > $@ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1063 | |
Ying Wang | ad7fd29 | 2013-08-08 16:34:29 -0700 | [diff] [blame] | 1064 | .PHONY: ramdisk-nodeps |
| 1065 | ramdisk-nodeps: $(MKBOOTFS) | $(MINIGZIP) |
| 1066 | @echo "make $@: ignoring dependencies" |
Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1067 | $(hide) $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RAMDISK_OUT) | $(MINIGZIP) > $(INSTALLED_RAMDISK_TARGET) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1068 | |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 1069 | endif # BUILDING_RAMDISK_IMAGE |
| 1070 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1071 | # ----------------------------------------------------------------- |
| 1072 | # the boot image, which is a collection of other images. |
Chris Gross | a784ef1 | 2019-04-22 11:09:57 -0700 | [diff] [blame] | 1073 | |
| 1074 | # This is defined here since we may be building recovery as boot |
| 1075 | # below and only want to define this once |
| 1076 | BUILT_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img |
| 1077 | |
| 1078 | ifneq ($(strip $(TARGET_NO_KERNEL)),true) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1079 | INTERNAL_BOOTIMAGE_ARGS := \ |
| 1080 | $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \ |
Rom Lemarchand | f9c9266 | 2015-04-08 15:11:47 -0700 | [diff] [blame] | 1081 | --kernel $(INSTALLED_KERNEL_TARGET) |
| 1082 | |
| 1083 | ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) |
| 1084 | INTERNAL_BOOTIMAGE_ARGS += --ramdisk $(INSTALLED_RAMDISK_TARGET) |
| 1085 | endif |
| 1086 | |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 1087 | ifndef BUILDING_VENDOR_BOOT_IMAGE |
| 1088 | ifdef BOARD_INCLUDE_DTB_IN_BOOTIMG |
| 1089 | INTERNAL_BOOTIMAGE_ARGS += --dtb $(INSTALLED_DTBIMAGE_TARGET) |
| 1090 | endif |
| 1091 | endif |
| 1092 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1093 | INTERNAL_BOOTIMAGE_FILES := $(filter-out --%,$(INTERNAL_BOOTIMAGE_ARGS)) |
| 1094 | |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1095 | ifeq ($(PRODUCT_SUPPORTS_VERITY),true) |
Badhri Jagan Sridharan | f380da3 | 2016-05-27 09:49:49 -0700 | [diff] [blame] | 1096 | ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1097 | VERITY_KEYID := veritykeyid=id:`openssl x509 -in $(PRODUCT_VERITY_SIGNING_KEY).x509.pem -text \ |
Badhri Jagan Sridharan | f380da3 | 2016-05-27 09:49:49 -0700 | [diff] [blame] | 1098 | | grep keyid | sed 's/://g' | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]' | sed 's/keyid//g'` |
| 1099 | endif |
| 1100 | endif |
| 1101 | |
Anton Hansson | 72e36f0 | 2019-02-26 17:36:30 +0000 | [diff] [blame] | 1102 | INTERNAL_KERNEL_CMDLINE := $(strip $(INTERNAL_KERNEL_CMDLINE) buildvariant=$(TARGET_BUILD_VARIANT) $(VERITY_KEYID)) |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 1103 | |
| 1104 | ifndef BUILDING_VENDOR_BOOT_IMAGE |
| 1105 | ifdef BOARD_KERNEL_BASE |
| 1106 | INTERNAL_BOOTIMAGE_ARGS += --base $(BOARD_KERNEL_BASE) |
| 1107 | endif |
| 1108 | ifdef BOARD_KERNEL_PAGESIZE |
| 1109 | INTERNAL_BOOTIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE) |
| 1110 | endif |
Dan Willemsen | c1f17ff | 2016-10-05 16:57:27 -0700 | [diff] [blame] | 1111 | ifdef INTERNAL_KERNEL_CMDLINE |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 1112 | INTERNAL_BOOTIMAGE_ARGS += --cmdline "$(INTERNAL_KERNEL_CMDLINE)" |
| 1113 | endif |
| 1114 | else |
| 1115 | # building vendor boot image, dtb/base/pagesize go there |
| 1116 | ifdef GENERIC_KERNEL_CMDLINE |
| 1117 | INTERNAL_BOOTIMAGE_ARGS += --cmdline "$(GENERIC_KERNEL_CMDLINE)" |
| 1118 | endif |
Badhri Jagan Sridharan | f380da3 | 2016-05-27 09:49:49 -0700 | [diff] [blame] | 1119 | endif |
Badhri Jagan Sridharan | f380da3 | 2016-05-27 09:49:49 -0700 | [diff] [blame] | 1120 | |
Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 1121 | INTERNAL_MKBOOTIMG_VERSION_ARGS := \ |
| 1122 | --os_version $(PLATFORM_VERSION) \ |
| 1123 | --os_patch_level $(PLATFORM_SECURITY_PATCH) |
| 1124 | |
Chris Gross | a784ef1 | 2019-04-22 11:09:57 -0700 | [diff] [blame] | 1125 | # Define these only if we are building boot |
| 1126 | ifdef BUILDING_BOOT_IMAGE |
| 1127 | INSTALLED_BOOTIMAGE_TARGET := $(BUILT_BOOTIMAGE_TARGET) |
| 1128 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1129 | ifeq ($(TARGET_BOOTIMAGE_USE_EXT2),true) |
JP Abgrall | 7bb75e4 | 2015-02-11 15:04:59 -0800 | [diff] [blame] | 1130 | $(error TARGET_BOOTIMAGE_USE_EXT2 is not supported anymore) |
David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 1131 | |
| 1132 | else ifeq (true,$(BOARD_AVB_ENABLE)) # TARGET_BOOTIMAGE_USE_EXT2 != true |
| 1133 | |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 1134 | $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(AVBTOOL) $(INTERNAL_BOOTIMAGE_FILES) $(BOARD_AVB_BOOT_KEY_PATH) |
David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 1135 | $(call pretty,"Target boot image: $@") |
| 1136 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ |
Bowgo Tsai | 03b9c8e | 2017-11-17 15:22:37 +0800 | [diff] [blame] | 1137 | $(hide) $(call assert-max-image-size,$@,$(call get-hash-image-max-size,$(BOARD_BOOTIMAGE_PARTITION_SIZE))) |
David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 1138 | $(hide) $(AVBTOOL) add_hash_footer \ |
| 1139 | --image $@ \ |
| 1140 | --partition_size $(BOARD_BOOTIMAGE_PARTITION_SIZE) \ |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 1141 | --partition_name boot $(INTERNAL_AVB_BOOT_SIGNING_ARGS) \ |
David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 1142 | $(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS) |
| 1143 | |
| 1144 | .PHONY: bootimage-nodeps |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 1145 | bootimage-nodeps: $(MKBOOTIMG) $(AVBTOOL) $(BOARD_AVB_BOOT_KEY_PATH) |
David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 1146 | @echo "make $@: ignoring dependencies" |
| 1147 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(INSTALLED_BOOTIMAGE_TARGET) |
Bowgo Tsai | 03b9c8e | 2017-11-17 15:22:37 +0800 | [diff] [blame] | 1148 | $(hide) $(call assert-max-image-size,$(INSTALLED_BOOTIMAGE_TARGET),$(call get-hash-image-max-size,$(BOARD_BOOTIMAGE_PARTITION_SIZE))) |
David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 1149 | $(hide) $(AVBTOOL) add_hash_footer \ |
Bowgo Tsai | 03b9c8e | 2017-11-17 15:22:37 +0800 | [diff] [blame] | 1150 | --image $(INSTALLED_BOOTIMAGE_TARGET) \ |
David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 1151 | --partition_size $(BOARD_BOOTIMAGE_PARTITION_SIZE) \ |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 1152 | --partition_name boot $(INTERNAL_AVB_BOOT_SIGNING_ARGS) \ |
David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 1153 | $(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS) |
| 1154 | |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1155 | else ifeq (true,$(PRODUCT_SUPPORTS_BOOT_SIGNER)) # BOARD_AVB_ENABLE != true |
Geremy Condra | 740b663 | 2014-07-08 20:07:41 -0700 | [diff] [blame] | 1156 | |
| 1157 | $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(BOOT_SIGNER) |
| 1158 | $(call pretty,"Target boot image: $@") |
Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 1159 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1160 | $(BOOT_SIGNER) /boot $@ $(PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCT_VERITY_SIGNING_KEY).x509.pem $@ |
Geremy Condra | 740b663 | 2014-07-08 20:07:41 -0700 | [diff] [blame] | 1161 | $(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE)) |
| 1162 | |
| 1163 | .PHONY: bootimage-nodeps |
| 1164 | bootimage-nodeps: $(MKBOOTIMG) $(BOOT_SIGNER) |
| 1165 | @echo "make $@: ignoring dependencies" |
Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 1166 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(INSTALLED_BOOTIMAGE_TARGET) |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1167 | $(BOOT_SIGNER) /boot $(INSTALLED_BOOTIMAGE_TARGET) $(PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCT_VERITY_SIGNING_KEY).x509.pem $(INSTALLED_BOOTIMAGE_TARGET) |
Geremy Condra | 740b663 | 2014-07-08 20:07:41 -0700 | [diff] [blame] | 1168 | $(hide) $(call assert-max-image-size,$(INSTALLED_BOOTIMAGE_TARGET),$(BOARD_BOOTIMAGE_PARTITION_SIZE)) |
| 1169 | |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1170 | else ifeq (true,$(PRODUCT_SUPPORTS_VBOOT)) # PRODUCT_SUPPORTS_BOOT_SIGNER != true |
David Riley | 17be3d3 | 2015-03-03 08:54:11 -0800 | [diff] [blame] | 1171 | |
Tao Bao | 4b57741 | 2017-02-22 22:54:39 -0800 | [diff] [blame] | 1172 | $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(VBOOT_SIGNER) $(FUTILITY) |
David Riley | 17be3d3 | 2015-03-03 08:54:11 -0800 | [diff] [blame] | 1173 | $(call pretty,"Target boot image: $@") |
Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 1174 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@.unsigned |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1175 | $(VBOOT_SIGNER) $(FUTILITY) $@.unsigned $(PRODUCT_VBOOT_SIGNING_KEY).vbpubk $(PRODUCT_VBOOT_SIGNING_KEY).vbprivk $(PRODUCT_VBOOT_SIGNING_SUBKEY).vbprivk $@.keyblock $@ |
David Riley | 17be3d3 | 2015-03-03 08:54:11 -0800 | [diff] [blame] | 1176 | $(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE)) |
| 1177 | |
| 1178 | .PHONY: bootimage-nodeps |
Tao Bao | 4b57741 | 2017-02-22 22:54:39 -0800 | [diff] [blame] | 1179 | bootimage-nodeps: $(MKBOOTIMG) $(VBOOT_SIGNER) $(FUTILITY) |
David Riley | 17be3d3 | 2015-03-03 08:54:11 -0800 | [diff] [blame] | 1180 | @echo "make $@: ignoring dependencies" |
Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 1181 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(INSTALLED_BOOTIMAGE_TARGET).unsigned |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1182 | $(VBOOT_SIGNER) $(FUTILITY) $(INSTALLED_BOOTIMAGE_TARGET).unsigned $(PRODUCT_VBOOT_SIGNING_KEY).vbpubk $(PRODUCT_VBOOT_SIGNING_KEY).vbprivk $(PRODUCT_VBOOT_SIGNING_SUBKEY).vbprivk $(INSTALLED_BOOTIMAGE_TARGET).keyblock $(INSTALLED_BOOTIMAGE_TARGET) |
David Riley | 17be3d3 | 2015-03-03 08:54:11 -0800 | [diff] [blame] | 1183 | $(hide) $(call assert-max-image-size,$(INSTALLED_BOOTIMAGE_TARGET),$(BOARD_BOOTIMAGE_PARTITION_SIZE)) |
| 1184 | |
| 1185 | else # PRODUCT_SUPPORTS_VBOOT != true |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1186 | |
| 1187 | $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) |
| 1188 | $(call pretty,"Target boot image: $@") |
Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 1189 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ |
JP Abgrall | 0ed7cec | 2014-06-16 14:19:36 -0700 | [diff] [blame] | 1190 | $(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE)) |
Ying Wang | ad7fd29 | 2013-08-08 16:34:29 -0700 | [diff] [blame] | 1191 | |
| 1192 | .PHONY: bootimage-nodeps |
| 1193 | bootimage-nodeps: $(MKBOOTIMG) |
| 1194 | @echo "make $@: ignoring dependencies" |
Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 1195 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(INSTALLED_BOOTIMAGE_TARGET) |
JP Abgrall | 0ed7cec | 2014-06-16 14:19:36 -0700 | [diff] [blame] | 1196 | $(hide) $(call assert-max-image-size,$(INSTALLED_BOOTIMAGE_TARGET),$(BOARD_BOOTIMAGE_PARTITION_SIZE)) |
Ying Wang | ad7fd29 | 2013-08-08 16:34:29 -0700 | [diff] [blame] | 1197 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1198 | endif # TARGET_BOOTIMAGE_USE_EXT2 |
Chris Gross | a784ef1 | 2019-04-22 11:09:57 -0700 | [diff] [blame] | 1199 | endif # BUILDING_BOOT_IMAGE |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1200 | |
Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 1201 | else # TARGET_NO_KERNEL == "true" |
Michael Schwartz | 0dc6f21 | 2017-07-18 10:05:13 -0700 | [diff] [blame] | 1202 | ifdef BOARD_PREBUILT_BOOTIMAGE |
| 1203 | ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) |
| 1204 | # Remove when b/63676296 is resolved. |
| 1205 | $(error Prebuilt bootimage is only supported for AB targets) |
| 1206 | endif |
Kiyoung Kim | 62e2231 | 2019-06-20 14:27:45 +0900 | [diff] [blame] | 1207 | INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img |
Michael Schwartz | 0dc6f21 | 2017-07-18 10:05:13 -0700 | [diff] [blame] | 1208 | $(eval $(call copy-one-file,$(BOARD_PREBUILT_BOOTIMAGE),$(INSTALLED_BOOTIMAGE_TARGET))) |
Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 1209 | else # BOARD_PREBUILT_BOOTIMAGE not defined |
Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 1210 | INSTALLED_BOOTIMAGE_TARGET := |
| 1211 | endif # BOARD_PREBUILT_BOOTIMAGE |
| 1212 | endif # TARGET_NO_KERNEL |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1213 | |
| 1214 | # ----------------------------------------------------------------- |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 1215 | # vendor boot image |
| 1216 | ifeq ($(BUILDING_VENDOR_BOOT_IMAGE),true) |
| 1217 | |
| 1218 | ifeq ($(PRODUCT_SUPPORTS_VERITY),true) |
| 1219 | $(error vboot 1.0 does not support vendor_boot partition) |
| 1220 | endif |
| 1221 | |
| 1222 | INTERNAL_VENDOR_RAMDISK_FILES := $(filter $(TARGET_VENDOR_RAMDISK_OUT)/%, \ |
| 1223 | $(ALL_GENERATED_SOURCES) \ |
| 1224 | $(ALL_DEFAULT_INSTALLED_MODULES)) |
| 1225 | |
| 1226 | INTERNAL_VENDOR_RAMDISK_TARGET := $(call intermediates-dir-for,PACKAGING,vendor-boot)/vendor-ramdisk.cpio.gz |
| 1227 | $(INTERNAL_VENDOR_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_VENDOR_RAMDISK_FILES) | $(MINIGZIP) |
| 1228 | $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_VENDOR_RAMDISK_OUT) | $(MINIGZIP) > $@ |
| 1229 | |
| 1230 | ifdef BOARD_INCLUDE_DTB_IN_BOOTIMG |
| 1231 | INTERNAL_VENDOR_BOOTIMAGE_ARGS += --dtb $(INSTALLED_DTBIMAGE_TARGET) |
| 1232 | endif |
| 1233 | ifdef BOARD_KERNEL_BASE |
| 1234 | INTERNAL_VENDOR_BOOTIMAGE_ARGS += --base $(BOARD_KERNEL_BASE) |
| 1235 | endif |
| 1236 | ifdef BOARD_KERNEL_PAGESIZE |
| 1237 | INTERNAL_VENDOR_BOOTIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE) |
| 1238 | endif |
| 1239 | ifdef INTERNAL_KERNEL_CMDLINE |
| 1240 | INTERNAL_VENDOR_BOOTIMAGE_ARGS += --vendor_cmdline "$(INTERNAL_KERNEL_CMDLINE)" |
| 1241 | endif |
| 1242 | |
| 1243 | INSTALLED_VENDOR_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/vendor_boot.img |
| 1244 | $(INSTALLED_VENDOR_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_VENDOR_RAMDISK_TARGET) $(INSTALLED_DTBIMAGE_TARGET) |
| 1245 | ifeq ($(BOARD_AVB_ENABLE),true) |
| 1246 | $(INSTALLED_VENDOR_BOOTIMAGE_TARGET): $(AVBTOOL) $(BOARD_AVB_VENDOR_BOOTIMAGE_KEY_PATH) |
| 1247 | $(call pretty,"Target vendor_boot image: $@") |
| 1248 | $(MKBOOTIMG) $(INTERNAL_VENDOR_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --vendor_ramdisk $(INTERNAL_VENDOR_RAMDISK_TARGET) --vendor_boot $@ |
| 1249 | $(call assert-max-image-size,$@,$(BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE)) |
| 1250 | $(AVBTOOL) add_hash_footer \ |
| 1251 | --image $@ \ |
| 1252 | --partition_size $(BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE) \ |
| 1253 | --partition_name vendor_boot $(INTERNAL_AVB_VENDOR_BOOT_SIGNING_ARGS) \ |
| 1254 | $(BOARD_AVB_VENDOR_BOOT_ADD_HASH_FOOTER_ARGS) |
| 1255 | else |
| 1256 | $(INSTALLED_VENDOR_BOOTIMAGE_TARGET): |
| 1257 | $(call pretty,"Target vendor_boot image: $@") |
| 1258 | $(MKBOOTIMG) $(INTERNAL_VENDOR_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --vendor_ramdisk $(INTERNAL_VENDOR_RAMDISK_TARGET) --vendor_boot $@ |
| 1259 | $(call assert-max-image-size,$@,$(BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE)) |
| 1260 | endif |
| 1261 | endif # BUILDING_VENDOR_BOOT_IMAGE |
| 1262 | |
| 1263 | # ----------------------------------------------------------------- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1264 | # NOTICE files |
| 1265 | # |
Steve Block | d14d3b4 | 2012-03-01 11:34:41 +0000 | [diff] [blame] | 1266 | # We are required to publish the licenses for all code under BSD, GPL and |
| 1267 | # Apache licenses (and possibly other more exotic ones as well). We err on the |
| 1268 | # side of caution, so the licenses for other third-party code are included here |
| 1269 | # too. |
| 1270 | # |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1271 | # This needs to be before the systemimage rules, because it adds to |
| 1272 | # ALL_DEFAULT_INSTALLED_MODULES, which those use to pick which files |
| 1273 | # go into the systemimage. |
| 1274 | |
Steve Block | 495e585 | 2012-02-29 19:18:08 +0000 | [diff] [blame] | 1275 | .PHONY: notice_files |
| 1276 | |
Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1277 | # Create the rule to combine the files into text and html/xml forms |
Chris Gross | aad39b3 | 2019-06-13 09:43:26 -0700 | [diff] [blame] | 1278 | # $(1) - xml_excluded_system_product_odm|xml_excluded_vendor_product_odm |
| 1279 | # xml_product|xml_odm|xml_system_ext|xml_system|html |
Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1280 | # $(2) - Plain text output file |
| 1281 | # $(3) - HTML/XML output file |
| 1282 | # $(4) - File title |
Jaewoong Jung | e6f57e0 | 2019-06-16 21:48:42 -0700 | [diff] [blame] | 1283 | # $(5) - Directory to use. Notice files are all $(5)/src. Other |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1284 | # directories in there will be used for scratch |
Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1285 | # $(6) - Dependencies for the output files |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1286 | # |
| 1287 | # The algorithm here is that we go collect a hash for each of the notice |
| 1288 | # files and write the names of the files that match that hash. Then |
| 1289 | # to generate the real files, we go print out all of the files and their |
| 1290 | # hashes. |
| 1291 | # |
| 1292 | # These rules are fairly complex, so they depend on this makefile so if |
| 1293 | # it changes, they'll run again. |
| 1294 | # |
| 1295 | # TODO: We could clean this up so that we just record the locations of the |
| 1296 | # original notice files instead of making rules to copy them somwehere. |
| 1297 | # Then we could traverse that without quite as much bash drama. |
| 1298 | define combine-notice-files |
Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1299 | $(2) $(3): PRIVATE_MESSAGE := $(4) |
| 1300 | $(2) $(3): PRIVATE_DIR := $(5) |
| 1301 | $(2) : $(3) |
Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 1302 | $(3) : $(6) $(BUILD_SYSTEM)/Makefile build/make/tools/generate-notice-files.py |
| 1303 | build/make/tools/generate-notice-files.py --text-output $(2) \ |
Chris Gross | aad39b3 | 2019-06-13 09:43:26 -0700 | [diff] [blame] | 1304 | $(if $(filter $(1),xml_excluded_vendor_product_odm),-e vendor -e product -e system_ext -e odm --xml-output, \ |
| 1305 | $(if $(filter $(1),xml_excluded_system_product_odm),-e system -e product -e system_ext -e odm --xml-output, \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 1306 | $(if $(filter $(1),xml_product),-i product --xml-output, \ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1307 | $(if $(filter $(1),xml_system_ext),-i system_ext --xml-output, \ |
Chris Gross | aad39b3 | 2019-06-13 09:43:26 -0700 | [diff] [blame] | 1308 | $(if $(filter $(1),xml_system),-i system --xml-output, \ |
| 1309 | $(if $(filter $(1),xml_odm),-i odm --xml-output, \ |
| 1310 | --html-output)))))) $(3) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 1311 | -t $$(PRIVATE_MESSAGE) -s $$(PRIVATE_DIR)/src |
Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1312 | notice_files: $(2) $(3) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1313 | endef |
| 1314 | |
Anton Hansson | bfbaa98 | 2018-11-12 23:29:13 +0000 | [diff] [blame] | 1315 | # Notice file logic isn't relevant for TARGET_BUILD_APPS |
| 1316 | ifndef TARGET_BUILD_APPS |
| 1317 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1318 | # TODO These intermediate NOTICE.txt/NOTICE.html files should go into |
| 1319 | # TARGET_OUT_NOTICE_FILES now that the notice files are gathered from |
| 1320 | # the src subdirectory. |
Steve Block | 495e585 | 2012-02-29 19:18:08 +0000 | [diff] [blame] | 1321 | target_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE.txt |
Steve Block | 495e585 | 2012-02-29 19:18:08 +0000 | [diff] [blame] | 1322 | tools_notice_file_txt := $(HOST_OUT_INTERMEDIATES)/NOTICE.txt |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1323 | tools_notice_file_html := $(HOST_OUT_INTERMEDIATES)/NOTICE.html |
Anton Hansson | bfbaa98 | 2018-11-12 23:29:13 +0000 | [diff] [blame] | 1324 | kernel_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/kernel.txt |
| 1325 | winpthreads_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/winpthreads.txt |
| 1326 | pdk_fusion_notice_files := $(filter $(TARGET_OUT_NOTICE_FILES)/%, $(ALL_PDK_FUSION_FILES)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1327 | |
Steven Moreland | ae69e57 | 2017-12-15 14:49:55 -0800 | [diff] [blame] | 1328 | # TODO(b/69865032): Make PRODUCT_NOTICE_SPLIT the default behavior. |
Anton Hansson | bfbaa98 | 2018-11-12 23:29:13 +0000 | [diff] [blame] | 1329 | ifneq ($(PRODUCT_NOTICE_SPLIT),true) |
| 1330 | target_notice_file_html := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html |
| 1331 | target_notice_file_html_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html.gz |
| 1332 | installed_notice_html_or_xml_gz := $(TARGET_OUT)/etc/NOTICE.html.gz |
| 1333 | $(eval $(call combine-notice-files, html, \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 1334 | $(target_notice_file_txt), \ |
| 1335 | $(target_notice_file_html), \ |
| 1336 | "Notices for files contained in the filesystem images in this directory:", \ |
| 1337 | $(TARGET_OUT_NOTICE_FILES), \ |
| 1338 | $(ALL_DEFAULT_INSTALLED_MODULES) $(kernel_notice_file) $(pdk_fusion_notice_files))) |
Anton Hansson | bfbaa98 | 2018-11-12 23:29:13 +0000 | [diff] [blame] | 1339 | $(target_notice_file_html_gz): $(target_notice_file_html) | $(MINIGZIP) |
| 1340 | $(hide) $(MINIGZIP) -9 < $< > $@ |
| 1341 | $(installed_notice_html_or_xml_gz): $(target_notice_file_html_gz) |
| 1342 | $(copy-file-to-target) |
| 1343 | else |
| 1344 | target_notice_file_xml := $(TARGET_OUT_INTERMEDIATES)/NOTICE.xml |
| 1345 | target_notice_file_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE.xml.gz |
Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1346 | installed_notice_html_or_xml_gz := $(TARGET_OUT)/etc/NOTICE.xml.gz |
| 1347 | |
| 1348 | target_vendor_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE_VENDOR.txt |
| 1349 | target_vendor_notice_file_xml := $(TARGET_OUT_INTERMEDIATES)/NOTICE_VENDOR.xml |
| 1350 | target_vendor_notice_file_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE_VENDOR.xml.gz |
| 1351 | installed_vendor_notice_xml_gz := $(TARGET_OUT_VENDOR)/etc/NOTICE.xml.gz |
Dario Freni | adc972d | 2018-07-09 18:38:38 +0100 | [diff] [blame] | 1352 | |
| 1353 | target_product_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT.txt |
| 1354 | target_product_notice_file_xml := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT.xml |
| 1355 | target_product_notice_file_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT.xml.gz |
| 1356 | installed_product_notice_xml_gz := $(TARGET_OUT_PRODUCT)/etc/NOTICE.xml.gz |
Dario Freni | cbca113 | 2018-08-28 18:04:03 +0100 | [diff] [blame] | 1357 | |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1358 | target_system_ext_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE_SYSTEM_EXT.txt |
| 1359 | target_system_ext_notice_file_xml := $(TARGET_OUT_INTERMEDIATES)/NOTICE_SYSTEM_EXT.xml |
| 1360 | target_system_ext_notice_file_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE_SYSTEM_EXT.xml.gz |
| 1361 | installed_system_ext_notice_xml_gz := $(TARGET_OUT_SYSTEM_EXT)/etc/NOTICE.xml.gz |
Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1362 | |
Chris Gross | 15d9655 | 2019-07-16 14:38:43 -0700 | [diff] [blame] | 1363 | target_odm_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE_ODM.txt |
| 1364 | target_odm_notice_file_xml := $(TARGET_OUT_INTERMEDIATES)/NOTICE_ODM.xml |
| 1365 | target_odm_notice_file_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE_ODM.xml.gz |
| 1366 | installed_odm_notice_xml_gz := $(TARGET_OUT_ODM)/etc/NOTICE.xml.gz |
| 1367 | |
Anton Hansson | 6ad6f6c | 2018-11-12 23:33:47 +0000 | [diff] [blame] | 1368 | # Notice files are copied to TARGET_OUT_NOTICE_FILES as a side-effect of their module |
| 1369 | # being built. A notice xml file must depend on all modules that could potentially |
| 1370 | # install a license file relevant to it. |
| 1371 | license_modules := $(ALL_DEFAULT_INSTALLED_MODULES) $(kernel_notice_file) $(pdk_fusion_notice_files) |
| 1372 | # Phonys/fakes don't have notice files (though their deps might) |
| 1373 | license_modules := $(filter-out $(TARGET_OUT_FAKE)/%,$(license_modules)) |
Jooyung Han | 4416b00 | 2019-05-29 18:28:22 +0900 | [diff] [blame] | 1374 | # testcases are not relevant to the system image. |
| 1375 | license_modules := $(filter-out $(TARGET_OUT_TESTCASES)/%,$(license_modules)) |
Chris Gross | aad39b3 | 2019-06-13 09:43:26 -0700 | [diff] [blame] | 1376 | license_modules_system := $(filter $(TARGET_OUT)/%,$(license_modules)) |
Anton Hansson | 6ad6f6c | 2018-11-12 23:33:47 +0000 | [diff] [blame] | 1377 | license_modules_vendor := $(filter $(TARGET_OUT_VENDOR)/%,$(license_modules)) |
| 1378 | license_modules_product := $(filter $(TARGET_OUT_PRODUCT)/%,$(license_modules)) |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1379 | license_modules_system_ext := $(filter $(TARGET_OUT_SYSTEM_EXT)/%,$(license_modules)) |
Chris Gross | 15d9655 | 2019-07-16 14:38:43 -0700 | [diff] [blame] | 1380 | license_modules_odm := $(filter $(TARGET_OUT_ODM)/%,$(license_modules)) |
Chris Gross | aad39b3 | 2019-06-13 09:43:26 -0700 | [diff] [blame] | 1381 | license_modules_agg := $(license_modules_system) \ |
| 1382 | $(license_modules_vendor) \ |
Chris Gross | 15d9655 | 2019-07-16 14:38:43 -0700 | [diff] [blame] | 1383 | $(license_modules_product) \ |
| 1384 | $(license_modules_system_ext) \ |
| 1385 | $(license_modules_odm) |
Chris Gross | e5d4a9e | 2019-07-30 15:46:35 -0700 | [diff] [blame] | 1386 | license_modules_rest := $(filter-out $(license_modules_agg),$(license_modules)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1387 | |
Chris Gross | aad39b3 | 2019-06-13 09:43:26 -0700 | [diff] [blame] | 1388 | # If we are building in a configuration that includes a prebuilt vendor.img, we can't |
| 1389 | # update its notice file, so include those notices in the system partition instead |
| 1390 | ifdef BOARD_PREBUILT_VENDORIMAGE |
Chris Gross | e5d4a9e | 2019-07-30 15:46:35 -0700 | [diff] [blame] | 1391 | license_modules_system += $(license_modules_rest) |
Chris Gross | aad39b3 | 2019-06-13 09:43:26 -0700 | [diff] [blame] | 1392 | system_xml_directories := xml_excluded_vendor_product_odm |
| 1393 | system_notice_file_message := "Notices for files contained in all filesystem images except vendor/system_ext/product/odm in this directory:" |
Chris Gross | e5d4a9e | 2019-07-30 15:46:35 -0700 | [diff] [blame] | 1394 | else |
| 1395 | license_modules_vendor += $(license_modules_rest) |
| 1396 | system_xml_directories := xml_system |
| 1397 | system_notice_file_message := "Notices for files contained in the system filesystem image in this directory:" |
Chris Gross | aad39b3 | 2019-06-13 09:43:26 -0700 | [diff] [blame] | 1398 | endif |
| 1399 | |
| 1400 | $(eval $(call combine-notice-files, $(system_xml_directories), \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 1401 | $(target_notice_file_txt), \ |
| 1402 | $(target_notice_file_xml), \ |
Chris Gross | aad39b3 | 2019-06-13 09:43:26 -0700 | [diff] [blame] | 1403 | $(system_notice_file_message), \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 1404 | $(TARGET_OUT_NOTICE_FILES), \ |
Chris Gross | aad39b3 | 2019-06-13 09:43:26 -0700 | [diff] [blame] | 1405 | $(license_modules_system))) |
| 1406 | $(eval $(call combine-notice-files, xml_excluded_system_product_odm, \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 1407 | $(target_vendor_notice_file_txt), \ |
| 1408 | $(target_vendor_notice_file_xml), \ |
Chris Gross | aad39b3 | 2019-06-13 09:43:26 -0700 | [diff] [blame] | 1409 | "Notices for files contained in all filesystem images except system/system_ext/product/odm in this directory:", \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 1410 | $(TARGET_OUT_NOTICE_FILES), \ |
| 1411 | $(license_modules_vendor))) |
Dario Freni | adc972d | 2018-07-09 18:38:38 +0100 | [diff] [blame] | 1412 | $(eval $(call combine-notice-files, xml_product, \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 1413 | $(target_product_notice_file_txt), \ |
| 1414 | $(target_product_notice_file_xml), \ |
| 1415 | "Notices for files contained in the product filesystem image in this directory:", \ |
| 1416 | $(TARGET_OUT_NOTICE_FILES), \ |
| 1417 | $(license_modules_product))) |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1418 | $(eval $(call combine-notice-files, xml_system_ext, \ |
| 1419 | $(target_system_ext_notice_file_txt), \ |
| 1420 | $(target_system_ext_notice_file_xml), \ |
| 1421 | "Notices for files contained in the system_ext filesystem image in this directory:", \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 1422 | $(TARGET_OUT_NOTICE_FILES), \ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1423 | $(license_modules_system_ext))) |
Chris Gross | 15d9655 | 2019-07-16 14:38:43 -0700 | [diff] [blame] | 1424 | $(eval $(call combine-notice-files, xml_odm, \ |
| 1425 | $(target_odm_notice_file_txt), \ |
| 1426 | $(target_odm_notice_file_xml), \ |
| 1427 | "Notices for files contained in the odm filesystem image in this directory:", \ |
| 1428 | $(TARGET_OUT_NOTICE_FILES), \ |
| 1429 | $(license_modules_odm))) |
Anton Hansson | bfbaa98 | 2018-11-12 23:29:13 +0000 | [diff] [blame] | 1430 | |
| 1431 | $(target_notice_file_xml_gz): $(target_notice_file_xml) | $(MINIGZIP) |
| 1432 | $(hide) $(MINIGZIP) -9 < $< > $@ |
| 1433 | $(target_vendor_notice_file_xml_gz): $(target_vendor_notice_file_xml) | $(MINIGZIP) |
| 1434 | $(hide) $(MINIGZIP) -9 < $< > $@ |
| 1435 | $(target_product_notice_file_xml_gz): $(target_product_notice_file_xml) | $(MINIGZIP) |
| 1436 | $(hide) $(MINIGZIP) -9 < $< > $@ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1437 | $(target_system_ext_notice_file_xml_gz): $(target_system_ext_notice_file_xml) | $(MINIGZIP) |
Anton Hansson | bfbaa98 | 2018-11-12 23:29:13 +0000 | [diff] [blame] | 1438 | $(hide) $(MINIGZIP) -9 < $< > $@ |
Chris Gross | 15d9655 | 2019-07-16 14:38:43 -0700 | [diff] [blame] | 1439 | $(target_odm_notice_file_xml_gz): $(target_odm_notice_file_xml) | $(MINIGZIP) |
| 1440 | $(hide) $(MINIGZIP) -9 < $< > $@ |
Anton Hansson | bfbaa98 | 2018-11-12 23:29:13 +0000 | [diff] [blame] | 1441 | $(installed_notice_html_or_xml_gz): $(target_notice_file_xml_gz) |
| 1442 | $(copy-file-to-target) |
| 1443 | $(installed_vendor_notice_xml_gz): $(target_vendor_notice_file_xml_gz) |
| 1444 | $(copy-file-to-target) |
| 1445 | $(installed_product_notice_xml_gz): $(target_product_notice_file_xml_gz) |
| 1446 | $(copy-file-to-target) |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1447 | $(installed_system_ext_notice_xml_gz): $(target_system_ext_notice_file_xml_gz) |
Anton Hansson | bfbaa98 | 2018-11-12 23:29:13 +0000 | [diff] [blame] | 1448 | $(copy-file-to-target) |
Chris Gross | 15d9655 | 2019-07-16 14:38:43 -0700 | [diff] [blame] | 1449 | $(installed_odm_notice_xml_gz): $(target_odm_notice_file_xml_gz) |
| 1450 | $(copy-file-to-target) |
Anton Hansson | bfbaa98 | 2018-11-12 23:29:13 +0000 | [diff] [blame] | 1451 | |
Dan Willemsen | 5c3fc2a | 2019-07-29 23:45:19 -0700 | [diff] [blame] | 1452 | ALL_DEFAULT_INSTALLED_MODULES += $(installed_notice_html_or_xml_gz) |
| 1453 | ALL_DEFAULT_INSTALLED_MODULES += $(installed_vendor_notice_xml_gz) |
| 1454 | ALL_DEFAULT_INSTALLED_MODULES += $(installed_product_notice_xml_gz) |
| 1455 | ALL_DEFAULT_INSTALLED_MODULES += $(installed_system_ext_notice_xml_gz) |
| 1456 | ALL_DEFAULT_INSTALLED_MODULES += $(installed_odm_notice_xml_gz) |
Anton Hansson | bfbaa98 | 2018-11-12 23:29:13 +0000 | [diff] [blame] | 1457 | endif # PRODUCT_NOTICE_SPLIT |
| 1458 | |
Dan Willemsen | 5c3fc2a | 2019-07-29 23:45:19 -0700 | [diff] [blame] | 1459 | ALL_DEFAULT_INSTALLED_MODULES += $(installed_notice_html_or_xml_gz) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1460 | |
Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1461 | $(eval $(call combine-notice-files, html, \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 1462 | $(tools_notice_file_txt), \ |
| 1463 | $(tools_notice_file_html), \ |
| 1464 | "Notices for files contained in the tools directory:", \ |
| 1465 | $(HOST_OUT_NOTICE_FILES), \ |
| 1466 | $(ALL_DEFAULT_INSTALLED_MODULES) \ |
| 1467 | $(winpthreads_notice_file))) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1468 | |
Ying Wang | 62c81f8 | 2013-08-22 20:02:03 -0700 | [diff] [blame] | 1469 | endif # TARGET_BUILD_APPS |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1470 | |
| 1471 | # The kernel isn't really a module, so to get its module file in there, we |
| 1472 | # make the target NOTICE files depend on this particular file too, which will |
| 1473 | # then be in the right directory for the find in combine-notice-files to work. |
Dan Willemsen | 288bedf | 2019-05-28 15:36:47 -0700 | [diff] [blame] | 1474 | $(eval $(call copy-one-file,$(BUILD_SYSTEM)/LINUX_KERNEL_COPYING,$(kernel_notice_file))) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1475 | |
Dan Willemsen | 288bedf | 2019-05-28 15:36:47 -0700 | [diff] [blame] | 1476 | $(eval $(call copy-one-file,$(BUILD_SYSTEM)/WINPTHREADS_COPYING,$(winpthreads_notice_file))) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1477 | |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 1478 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1479 | # ################################################################# |
| 1480 | # Targets for user images |
| 1481 | # ################################################################# |
| 1482 | |
Ying Wang | 933abf1 | 2010-06-16 14:31:34 -0700 | [diff] [blame] | 1483 | INTERNAL_USERIMAGES_EXT_VARIANT := |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1484 | ifeq ($(TARGET_USERIMAGES_USE_EXT2),true) |
Colin Cross | 0a7b2c5 | 2010-05-07 02:23:59 -0700 | [diff] [blame] | 1485 | INTERNAL_USERIMAGES_EXT_VARIANT := ext2 |
| 1486 | else |
| 1487 | ifeq ($(TARGET_USERIMAGES_USE_EXT3),true) |
Colin Cross | 0a7b2c5 | 2010-05-07 02:23:59 -0700 | [diff] [blame] | 1488 | INTERNAL_USERIMAGES_EXT_VARIANT := ext3 |
| 1489 | else |
| 1490 | ifeq ($(TARGET_USERIMAGES_USE_EXT4),true) |
Colin Cross | 0a7b2c5 | 2010-05-07 02:23:59 -0700 | [diff] [blame] | 1491 | INTERNAL_USERIMAGES_EXT_VARIANT := ext4 |
| 1492 | endif |
| 1493 | endif |
| 1494 | endif |
| 1495 | |
JP Abgrall | 6ea5bd6 | 2014-10-22 20:01:22 -0700 | [diff] [blame] | 1496 | # These options tell the recovery updater/installer how to mount the partitions writebale. |
| 1497 | # <fstype>=<fstype_opts>[|<fstype_opts>]... |
| 1498 | # fstype_opts := <opt>[,<opt>]... |
| 1499 | # opt := <name>[=<value>] |
JP Abgrall | 775b1ab | 2014-10-23 16:27:03 -0700 | [diff] [blame] | 1500 | # The following worked on Nexus devices with Kernel 3.1, 3.4, 3.10 |
| 1501 | DEFAULT_TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS := ext4=max_batch_time=0,commit=1,data=ordered,barrier=1,errors=panic,nodelalloc |
JP Abgrall | 6ea5bd6 | 2014-10-22 20:01:22 -0700 | [diff] [blame] | 1502 | |
Ying Wang | 542903a | 2010-11-17 15:40:38 -0800 | [diff] [blame] | 1503 | ifneq (true,$(TARGET_USERIMAGES_SPARSE_EXT_DISABLED)) |
| 1504 | INTERNAL_USERIMAGES_SPARSE_EXT_FLAG := -s |
| 1505 | endif |
Todd Poynor | b2a555e | 2015-12-15 18:00:14 -0800 | [diff] [blame] | 1506 | ifneq (true,$(TARGET_USERIMAGES_SPARSE_SQUASHFS_DISABLED)) |
| 1507 | INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG := -s |
| 1508 | endif |
Alistair Delva | 91238cc | 2019-10-16 10:53:41 -0700 | [diff] [blame] | 1509 | ifneq (true,$(TARGET_USERIMAGES_SPARSE_F2FS_DISABLED)) |
| 1510 | INTERNAL_USERIMAGES_SPARSE_F2FS_FLAG := -S |
| 1511 | endif |
Tao Bao | dba635a | 2019-06-24 10:39:54 -0700 | [diff] [blame] | 1512 | |
| 1513 | INTERNAL_USERIMAGES_DEPS := \ |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 1514 | $(BUILD_IMAGE) \ |
Tao Bao | dba635a | 2019-06-24 10:39:54 -0700 | [diff] [blame] | 1515 | $(MKE2FS_CONF) \ |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 1516 | $(MKEXTUSERIMG) |
Tao Bao | dba635a | 2019-06-24 10:39:54 -0700 | [diff] [blame] | 1517 | |
| 1518 | ifeq ($(TARGET_USERIMAGES_USE_F2FS),true) |
| 1519 | INTERNAL_USERIMAGES_DEPS += $(MKF2FSUSERIMG) |
Mohamad Ayyash | 6894695 | 2015-03-03 12:30:37 -0800 | [diff] [blame] | 1520 | endif |
| 1521 | |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1522 | ifneq ($(filter $(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE) $(BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE) $(BOARD_ODMIMAGE_FILE_SYSTEM_TYPE) $(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE) $(BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE),squashfs),) |
Tao Bao | dba635a | 2019-06-24 10:39:54 -0700 | [diff] [blame] | 1523 | INTERNAL_USERIMAGES_DEPS += $(MKSQUASHFSUSERIMG) |
| 1524 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1525 | |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1526 | ifeq (true,$(PRODUCT_SUPPORTS_VERITY)) |
Tao Bao | b4ec6d7 | 2018-03-15 23:21:28 -0700 | [diff] [blame] | 1527 | INTERNAL_USERIMAGES_DEPS += $(BUILD_VERITY_METADATA) $(BUILD_VERITY_TREE) $(APPEND2SIMG) $(VERITY_SIGNER) |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1528 | ifeq (true,$(PRODUCT_SUPPORTS_VERITY_FEC)) |
Sami Tolvanen | f99b531 | 2015-05-20 07:30:57 +0100 | [diff] [blame] | 1529 | INTERNAL_USERIMAGES_DEPS += $(FEC) |
| 1530 | endif |
Geremy Condra | fd6f751 | 2013-06-16 17:26:08 -0700 | [diff] [blame] | 1531 | endif |
| 1532 | |
Tao Bao | dba635a | 2019-06-24 10:39:54 -0700 | [diff] [blame] | 1533 | ifeq ($(BOARD_AVB_ENABLE),true) |
| 1534 | INTERNAL_USERIMAGES_DEPS += $(AVBTOOL) |
| 1535 | endif |
| 1536 | |
| 1537 | # Get a colon-separated list of search paths. |
| 1538 | INTERNAL_USERIMAGES_BINARY_PATHS := $(subst $(space),:,$(sort $(dir $(INTERNAL_USERIMAGES_DEPS)))) |
| 1539 | |
Alex Klyubin | 092c902 | 2017-03-13 13:28:34 -0700 | [diff] [blame] | 1540 | SELINUX_FC := $(call intermediates-dir-for,ETC,file_contexts.bin)/file_contexts.bin |
Ying Wang | fdbd9cb | 2012-11-21 10:47:00 -0800 | [diff] [blame] | 1541 | INTERNAL_USERIMAGES_DEPS += $(SELINUX_FC) |
| 1542 | |
Yifan Hong | c5c0124 | 2018-11-09 10:27:23 -0800 | [diff] [blame] | 1543 | ifeq (true,$(PRODUCT_USE_DYNAMIC_PARTITIONS)) |
Yifan Hong | bbcba1e | 2018-06-18 16:32:35 -0700 | [diff] [blame] | 1544 | |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1545 | ifeq ($(PRODUCT_SUPPORTS_VERITY),true) |
Yifan Hong | bbcba1e | 2018-06-18 16:32:35 -0700 | [diff] [blame] | 1546 | $(error vboot 1.0 doesn't support logical partition) |
| 1547 | endif |
| 1548 | |
Yifan Hong | c5c0124 | 2018-11-09 10:27:23 -0800 | [diff] [blame] | 1549 | endif # PRODUCT_USE_DYNAMIC_PARTITIONS |
Yifan Hong | bbcba1e | 2018-06-18 16:32:35 -0700 | [diff] [blame] | 1550 | |
Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 1551 | # $(1): the path of the output dictionary file |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1552 | # $(2): a subset of "system vendor cache userdata product system_ext oem odm" |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1553 | # $(3): additional "key=value" pairs to append to the dictionary file. |
| 1554 | define generate-image-prop-dictionary |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1555 | $(if $(filter $(2),system),\ |
| 1556 | $(if $(BOARD_SYSTEMIMAGE_PARTITION_SIZE),$(hide) echo "system_size=$(BOARD_SYSTEMIMAGE_PARTITION_SIZE)" >> $(1)) |
Bowgo Tsai | 867ab66 | 2019-01-29 13:30:18 +0800 | [diff] [blame] | 1557 | $(if $(INTERNAL_SYSTEM_OTHER_PARTITION_SIZE),$(hide) echo "system_other_size=$(INTERNAL_SYSTEM_OTHER_PARTITION_SIZE)" >> $(1)) |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1558 | $(if $(BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "system_fs_type=$(BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) |
| 1559 | $(if $(BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT),$(hide) echo "system_extfs_inode_count=$(BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT)" >> $(1)) |
| 1560 | $(if $(BOARD_SYSTEMIMAGE_EXTFS_RSV_PCT),$(hide) echo "system_extfs_rsv_pct=$(BOARD_SYSTEMIMAGE_EXTFS_RSV_PCT)" >> $(1)) |
| 1561 | $(if $(BOARD_SYSTEMIMAGE_JOURNAL_SIZE),$(hide) echo "system_journal_size=$(BOARD_SYSTEMIMAGE_JOURNAL_SIZE)" >> $(1)) |
| 1562 | $(if $(BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "system_squashfs_compressor=$(BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR)" >> $(1)) |
| 1563 | $(if $(BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR_OPT),$(hide) echo "system_squashfs_compressor_opt=$(BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR_OPT)" >> $(1)) |
| 1564 | $(if $(BOARD_SYSTEMIMAGE_SQUASHFS_BLOCK_SIZE),$(hide) echo "system_squashfs_block_size=$(BOARD_SYSTEMIMAGE_SQUASHFS_BLOCK_SIZE)" >> $(1)) |
| 1565 | $(if $(BOARD_SYSTEMIMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "system_squashfs_disable_4k_align=$(BOARD_SYSTEMIMAGE_SQUASHFS_DISABLE_4K_ALIGN)" >> $(1)) |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1566 | $(if $(PRODUCT_SYSTEM_BASE_FS_PATH),$(hide) echo "system_base_fs_file=$(PRODUCT_SYSTEM_BASE_FS_PATH)" >> $(1)) |
| 1567 | $(if $(PRODUCT_SYSTEM_HEADROOM),$(hide) echo "system_headroom=$(PRODUCT_SYSTEM_HEADROOM)" >> $(1)) |
Yifan Hong | bbcba1e | 2018-06-18 16:32:35 -0700 | [diff] [blame] | 1568 | $(if $(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "system_reserved_size=$(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE)" >> $(1)) |
Daniel Norman | 72c626f | 2019-05-13 15:58:14 -0700 | [diff] [blame] | 1569 | $(hide) echo "system_selinux_fc=$(SELINUX_FC)" >> $(1) |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1570 | ) |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1571 | $(if $(filter $(2),userdata),\ |
| 1572 | $(if $(BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "userdata_fs_type=$(BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) |
| 1573 | $(if $(BOARD_USERDATAIMAGE_PARTITION_SIZE),$(hide) echo "userdata_size=$(BOARD_USERDATAIMAGE_PARTITION_SIZE)" >> $(1)) |
Daniel Norman | 72c626f | 2019-05-13 15:58:14 -0700 | [diff] [blame] | 1574 | $(hide) echo "userdata_selinux_fc=$(SELINUX_FC)" >> $(1) |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1575 | ) |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1576 | $(if $(filter $(2),cache),\ |
| 1577 | $(if $(BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "cache_fs_type=$(BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) |
| 1578 | $(if $(BOARD_CACHEIMAGE_PARTITION_SIZE),$(hide) echo "cache_size=$(BOARD_CACHEIMAGE_PARTITION_SIZE)" >> $(1)) |
Daniel Norman | 72c626f | 2019-05-13 15:58:14 -0700 | [diff] [blame] | 1579 | $(hide) echo "cache_selinux_fc=$(SELINUX_FC)" >> $(1) |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1580 | ) |
| 1581 | $(if $(filter $(2),vendor),\ |
| 1582 | $(if $(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "vendor_fs_type=$(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) |
| 1583 | $(if $(BOARD_VENDORIMAGE_EXTFS_INODE_COUNT),$(hide) echo "vendor_extfs_inode_count=$(BOARD_VENDORIMAGE_EXTFS_INODE_COUNT)" >> $(1)) |
| 1584 | $(if $(BOARD_VENDORIMAGE_EXTFS_RSV_PCT),$(hide) echo "vendor_extfs_rsv_pct=$(BOARD_VENDORIMAGE_EXTFS_RSV_PCT)" >> $(1)) |
| 1585 | $(if $(BOARD_VENDORIMAGE_PARTITION_SIZE),$(hide) echo "vendor_size=$(BOARD_VENDORIMAGE_PARTITION_SIZE)" >> $(1)) |
| 1586 | $(if $(BOARD_VENDORIMAGE_JOURNAL_SIZE),$(hide) echo "vendor_journal_size=$(BOARD_VENDORIMAGE_JOURNAL_SIZE)" >> $(1)) |
| 1587 | $(if $(BOARD_VENDORIMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "vendor_squashfs_compressor=$(BOARD_VENDORIMAGE_SQUASHFS_COMPRESSOR)" >> $(1)) |
| 1588 | $(if $(BOARD_VENDORIMAGE_SQUASHFS_COMPRESSOR_OPT),$(hide) echo "vendor_squashfs_compressor_opt=$(BOARD_VENDORIMAGE_SQUASHFS_COMPRESSOR_OPT)" >> $(1)) |
| 1589 | $(if $(BOARD_VENDORIMAGE_SQUASHFS_BLOCK_SIZE),$(hide) echo "vendor_squashfs_block_size=$(BOARD_VENDORIMAGE_SQUASHFS_BLOCK_SIZE)" >> $(1)) |
| 1590 | $(if $(BOARD_VENDORIMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "vendor_squashfs_disable_4k_align=$(BOARD_VENDORIMAGE_SQUASHFS_DISABLE_4K_ALIGN)" >> $(1)) |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1591 | $(if $(PRODUCT_VENDOR_BASE_FS_PATH),$(hide) echo "vendor_base_fs_file=$(PRODUCT_VENDOR_BASE_FS_PATH)" >> $(1)) |
Yifan Hong | 749062d | 2018-06-19 16:23:16 -0700 | [diff] [blame] | 1592 | $(if $(BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "vendor_reserved_size=$(BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE)" >> $(1)) |
Daniel Norman | 72c626f | 2019-05-13 15:58:14 -0700 | [diff] [blame] | 1593 | $(hide) echo "vendor_selinux_fc=$(SELINUX_FC)" >> $(1) |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1594 | ) |
| 1595 | $(if $(filter $(2),product),\ |
| 1596 | $(if $(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "product_fs_type=$(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) |
| 1597 | $(if $(BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT),$(hide) echo "product_extfs_inode_count=$(BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT)" >> $(1)) |
| 1598 | $(if $(BOARD_PRODUCTIMAGE_EXTFS_RSV_PCT),$(hide) echo "product_extfs_rsv_pct=$(BOARD_PRODUCTIMAGE_EXTFS_RSV_PCT)" >> $(1)) |
| 1599 | $(if $(BOARD_PRODUCTIMAGE_PARTITION_SIZE),$(hide) echo "product_size=$(BOARD_PRODUCTIMAGE_PARTITION_SIZE)" >> $(1)) |
| 1600 | $(if $(BOARD_PRODUCTIMAGE_JOURNAL_SIZE),$(hide) echo "product_journal_size=$(BOARD_PRODUCTIMAGE_JOURNAL_SIZE)" >> $(1)) |
| 1601 | $(if $(BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "product_squashfs_compressor=$(BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR)" >> $(1)) |
| 1602 | $(if $(BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR_OPT),$(hide) echo "product_squashfs_compressor_opt=$(BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR_OPT)" >> $(1)) |
| 1603 | $(if $(BOARD_PRODUCTIMAGE_SQUASHFS_BLOCK_SIZE),$(hide) echo "product_squashfs_block_size=$(BOARD_PRODUCTIMAGE_SQUASHFS_BLOCK_SIZE)" >> $(1)) |
| 1604 | $(if $(BOARD_PRODUCTIMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "product_squashfs_disable_4k_align=$(BOARD_PRODUCTIMAGE_SQUASHFS_DISABLE_4K_ALIGN)" >> $(1)) |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1605 | $(if $(PRODUCT_PRODUCT_BASE_FS_PATH),$(hide) echo "product_base_fs_file=$(PRODUCT_PRODUCT_BASE_FS_PATH)" >> $(1)) |
Yifan Hong | 56a6c3b | 2018-07-20 15:19:34 -0700 | [diff] [blame] | 1606 | $(if $(BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "product_reserved_size=$(BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE)" >> $(1)) |
Daniel Norman | 72c626f | 2019-05-13 15:58:14 -0700 | [diff] [blame] | 1607 | $(hide) echo "product_selinux_fc=$(SELINUX_FC)" >> $(1) |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1608 | ) |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1609 | $(if $(filter $(2),system_ext),\ |
| 1610 | $(if $(BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "system_ext_fs_type=$(BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) |
| 1611 | $(if $(BOARD_SYSTEM_EXTIMAGE_EXTFS_INODE_COUNT),$(hide) echo "system_ext_extfs_inode_count=$(BOARD_SYSTEM_EXTIMAGE_EXTFS_INODE_COUNT)" >> $(1)) |
| 1612 | $(if $(BOARD_SYSTEM_EXTIMAGE_EXTFS_RSV_PCT),$(hide) echo "system_ext_extfs_rsv_pct=$(BOARD_SYSTEM_EXTIMAGE_EXTFS_RSV_PCT)" >> $(1)) |
| 1613 | $(if $(BOARD_SYSTEM_EXTIMAGE_PARTITION_SIZE),$(hide) echo "system_ext_size=$(BOARD_SYSTEM_EXTIMAGE_PARTITION_SIZE)" >> $(1)) |
| 1614 | $(if $(BOARD_SYSTEM_EXTIMAGE_JOURNAL_SIZE),$(hide) echo "system_ext_journal_size=$(BOARD_SYSTEM_EXTIMAGE_JOURNAL_SIZE)" >> $(1)) |
| 1615 | $(if $(BOARD_SYSTEM_EXTIMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "system_ext_squashfs_compressor=$(BOARD_SYSTEM_EXTIMAGE_SQUASHFS_COMPRESSOR)" >> $(1)) |
| 1616 | $(if $(BOARD_SYSTEM_EXTIMAGE_SQUASHFS_COMPRESSOR_OPT),$(hide) echo "system_ext_squashfs_compressor_opt=$(BOARD_SYSTEM_EXTIMAGE_SQUASHFS_COMPRESSOR_OPT)" >> $(1)) |
| 1617 | $(if $(BOARD_SYSTEM_EXTIMAGE_SQUASHFS_BLOCK_SIZE),$(hide) echo "system_ext_squashfs_block_size=$(BOARD_SYSTEM_EXTIMAGE_SQUASHFS_BLOCK_SIZE)" >> $(1)) |
| 1618 | $(if $(BOARD_SYSTEM_EXTIMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "system_ext_squashfs_disable_4k_align=$(BOARD_SYSTEM_EXTIMAGE_SQUASHFS_DISABLE_4K_ALIGN)" >> $(1)) |
| 1619 | $(if $(BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "system_ext_reserved_size=$(BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE)" >> $(1)) |
| 1620 | $(hide) echo "system_ext_selinux_fc=$(SELINUX_FC)" >> $(1) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 1621 | ) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 1622 | $(if $(filter $(2),odm),\ |
| 1623 | $(if $(BOARD_ODMIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "odm_fs_type=$(BOARD_ODMIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) |
| 1624 | $(if $(BOARD_ODMIMAGE_EXTFS_INODE_COUNT),$(hide) echo "odm_extfs_inode_count=$(BOARD_ODMIMAGE_EXTFS_INODE_COUNT)" >> $(1)) |
| 1625 | $(if $(BOARD_ODMIMAGE_EXTFS_RSV_PCT),$(hide) echo "odm_extfs_rsv_pct=$(BOARD_ODMIMAGE_EXTFS_RSV_PCT)" >> $(1)) |
| 1626 | $(if $(BOARD_ODMIMAGE_PARTITION_SIZE),$(hide) echo "odm_size=$(BOARD_ODMIMAGE_PARTITION_SIZE)" >> $(1)) |
| 1627 | $(if $(BOARD_ODMIMAGE_JOURNAL_SIZE),$(hide) echo "odm_journal_size=$(BOARD_ODMIMAGE_JOURNAL_SIZE)" >> $(1)) |
| 1628 | $(if $(BOARD_ODMIMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "odm_squashfs_compressor=$(BOARD_ODMIMAGE_SQUASHFS_COMPRESSOR)" >> $(1)) |
| 1629 | $(if $(BOARD_ODMIMAGE_SQUASHFS_COMPRESSOR_OPT),$(hide) echo "odm_squashfs_compressor_opt=$(BOARD_ODMIMAGE_SQUASHFS_COMPRESSOR_OPT)" >> $(1)) |
| 1630 | $(if $(BOARD_ODMIMAGE_SQUASHFS_BLOCK_SIZE),$(hide) echo "odm_squashfs_block_size=$(BOARD_ODMIMAGE_SQUASHFS_BLOCK_SIZE)" >> $(1)) |
| 1631 | $(if $(BOARD_ODMIMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "odm_squashfs_disable_4k_align=$(BOARD_ODMIMAGE_SQUASHFS_DISABLE_4K_ALIGN)" >> $(1)) |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1632 | $(if $(PRODUCT_ODM_BASE_FS_PATH),$(hide) echo "odm_base_fs_file=$(PRODUCT_ODM_BASE_FS_PATH)" >> $(1)) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 1633 | $(if $(BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "odm_reserved_size=$(BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE)" >> $(1)) |
Daniel Norman | 72c626f | 2019-05-13 15:58:14 -0700 | [diff] [blame] | 1634 | $(hide) echo "odm_selinux_fc=$(SELINUX_FC)" >> $(1) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 1635 | ) |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1636 | $(if $(filter $(2),oem),\ |
| 1637 | $(if $(BOARD_OEMIMAGE_PARTITION_SIZE),$(hide) echo "oem_size=$(BOARD_OEMIMAGE_PARTITION_SIZE)" >> $(1)) |
| 1638 | $(if $(BOARD_OEMIMAGE_JOURNAL_SIZE),$(hide) echo "oem_journal_size=$(BOARD_OEMIMAGE_JOURNAL_SIZE)" >> $(1)) |
| 1639 | $(if $(BOARD_OEMIMAGE_EXTFS_INODE_COUNT),$(hide) echo "oem_extfs_inode_count=$(BOARD_OEMIMAGE_EXTFS_INODE_COUNT)" >> $(1)) |
| 1640 | $(if $(BOARD_OEMIMAGE_EXTFS_RSV_PCT),$(hide) echo "oem_extfs_rsv_pct=$(BOARD_OEMIMAGE_EXTFS_RSV_PCT)" >> $(1)) |
Daniel Norman | 72c626f | 2019-05-13 15:58:14 -0700 | [diff] [blame] | 1641 | $(hide) echo "oem_selinux_fc=$(SELINUX_FC)" >> $(1) |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1642 | ) |
Tao Bao | 3602eca | 2018-07-10 10:53:55 -0700 | [diff] [blame] | 1643 | $(hide) echo "ext_mkuserimg=$(notdir $(MKEXTUSERIMG))" >> $(1) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 1644 | |
Tao Bao | 3602eca | 2018-07-10 10:53:55 -0700 | [diff] [blame] | 1645 | $(if $(INTERNAL_USERIMAGES_EXT_VARIANT),$(hide) echo "fs_type=$(INTERNAL_USERIMAGES_EXT_VARIANT)" >> $(1)) |
Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 1646 | $(if $(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG),$(hide) echo "extfs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG)" >> $(1)) |
Todd Poynor | b2a555e | 2015-12-15 18:00:14 -0800 | [diff] [blame] | 1647 | $(if $(INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG),$(hide) echo "squashfs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG)" >> $(1)) |
Alistair Delva | 91238cc | 2019-10-16 10:53:41 -0700 | [diff] [blame] | 1648 | $(if $(INTERNAL_USERIMAGES_SPARSE_F2FS_FLAG),$(hide) echo "f2fs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_F2FS_FLAG)" >> $(1)) |
Tao Bao | 3602eca | 2018-07-10 10:53:55 -0700 | [diff] [blame] | 1649 | $(if $(BOARD_EXT4_SHARE_DUP_BLOCKS),$(hide) echo "ext4_share_dup_blocks=$(BOARD_EXT4_SHARE_DUP_BLOCKS)" >> $(1)) |
| 1650 | $(if $(BOARD_FLASH_LOGICAL_BLOCK_SIZE), $(hide) echo "flash_logical_block_size=$(BOARD_FLASH_LOGICAL_BLOCK_SIZE)" >> $(1)) |
| 1651 | $(if $(BOARD_FLASH_ERASE_BLOCK_SIZE), $(hide) echo "flash_erase_block_size=$(BOARD_FLASH_ERASE_BLOCK_SIZE)" >> $(1)) |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1652 | $(if $(PRODUCT_SUPPORTS_BOOT_SIGNER),$(hide) echo "boot_signer=$(PRODUCT_SUPPORTS_BOOT_SIGNER)" >> $(1)) |
| 1653 | $(if $(PRODUCT_SUPPORTS_VERITY),$(hide) echo "verity=$(PRODUCT_SUPPORTS_VERITY)" >> $(1)) |
| 1654 | $(if $(PRODUCT_SUPPORTS_VERITY),$(hide) echo "verity_key=$(PRODUCT_VERITY_SIGNING_KEY)" >> $(1)) |
| 1655 | $(if $(PRODUCT_SUPPORTS_VERITY),$(hide) echo "verity_signer_cmd=$(notdir $(VERITY_SIGNER))" >> $(1)) |
| 1656 | $(if $(PRODUCT_SUPPORTS_VERITY_FEC),$(hide) echo "verity_fec=$(PRODUCT_SUPPORTS_VERITY_FEC)" >> $(1)) |
Bowgo Tsai | 6ceeb1a | 2017-10-11 16:21:48 +0800 | [diff] [blame] | 1657 | $(if $(filter eng, $(TARGET_BUILD_VARIANT)),$(hide) echo "verity_disable=true" >> $(1)) |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1658 | $(if $(PRODUCT_SYSTEM_VERITY_PARTITION),$(hide) echo "system_verity_block_device=$(PRODUCT_SYSTEM_VERITY_PARTITION)" >> $(1)) |
| 1659 | $(if $(PRODUCT_VENDOR_VERITY_PARTITION),$(hide) echo "vendor_verity_block_device=$(PRODUCT_VENDOR_VERITY_PARTITION)" >> $(1)) |
| 1660 | $(if $(PRODUCT_PRODUCT_VERITY_PARTITION),$(hide) echo "product_verity_block_device=$(PRODUCT_PRODUCT_VERITY_PARTITION)" >> $(1)) |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1661 | $(if $(PRODUCT_SYSTEM_EXT_VERITY_PARTITION),$(hide) echo "system_ext_verity_block_device=$(PRODUCT_SYSTEM_EXT_VERITY_PARTITION)" >> $(1)) |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 1662 | $(if $(PRODUCT_SUPPORTS_VBOOT),$(hide) echo "vboot=$(PRODUCT_SUPPORTS_VBOOT)" >> $(1)) |
| 1663 | $(if $(PRODUCT_SUPPORTS_VBOOT),$(hide) echo "vboot_key=$(PRODUCT_VBOOT_SIGNING_KEY)" >> $(1)) |
| 1664 | $(if $(PRODUCT_SUPPORTS_VBOOT),$(hide) echo "vboot_subkey=$(PRODUCT_VBOOT_SIGNING_SUBKEY)" >> $(1)) |
| 1665 | $(if $(PRODUCT_SUPPORTS_VBOOT),$(hide) echo "futility=$(notdir $(FUTILITY))" >> $(1)) |
| 1666 | $(if $(PRODUCT_SUPPORTS_VBOOT),$(hide) echo "vboot_signer_cmd=$(VBOOT_SIGNER)" >> $(1)) |
Tao Bao | 3cba374 | 2017-05-16 16:27:25 -0700 | [diff] [blame] | 1667 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_avbtool=$(notdir $(AVBTOOL))" >> $(1)) |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 1668 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_system_hashtree_enable=$(BOARD_AVB_ENABLE)" >> $(1)) |
| 1669 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_system_add_hashtree_footer_args=$(BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS)" >> $(1)) |
| 1670 | $(if $(BOARD_AVB_ENABLE),\ |
| 1671 | $(if $(BOARD_AVB_SYSTEM_KEY_PATH),\ |
| 1672 | $(hide) echo "avb_system_key_path=$(BOARD_AVB_SYSTEM_KEY_PATH)" >> $(1) |
| 1673 | $(hide) echo "avb_system_algorithm=$(BOARD_AVB_SYSTEM_ALGORITHM)" >> $(1) |
| 1674 | $(hide) echo "avb_system_rollback_index_location=$(BOARD_AVB_SYSTEM_ROLLBACK_INDEX_LOCATION)" >> $(1))) |
Bowgo Tsai | 1e04bf7 | 2019-01-23 22:19:19 +0800 | [diff] [blame] | 1675 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_system_other_hashtree_enable=$(BOARD_AVB_ENABLE)" >> $(1)) |
| 1676 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_system_other_add_hashtree_footer_args=$(BOARD_AVB_SYSTEM_OTHER_ADD_HASHTREE_FOOTER_ARGS)" >> $(1)) |
| 1677 | $(if $(BOARD_AVB_ENABLE),\ |
| 1678 | $(if $(BOARD_AVB_SYSTEM_OTHER_KEY_PATH),\ |
| 1679 | $(hide) echo "avb_system_other_key_path=$(BOARD_AVB_SYSTEM_OTHER_KEY_PATH)" >> $(1) |
Bowgo Tsai | e4544b1 | 2019-02-27 10:15:51 +0800 | [diff] [blame] | 1680 | $(hide) echo "avb_system_other_algorithm=$(BOARD_AVB_SYSTEM_OTHER_ALGORITHM)" >> $(1))) |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 1681 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_vendor_hashtree_enable=$(BOARD_AVB_ENABLE)" >> $(1)) |
| 1682 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_vendor_add_hashtree_footer_args=$(BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS)" >> $(1)) |
| 1683 | $(if $(BOARD_AVB_ENABLE),\ |
| 1684 | $(if $(BOARD_AVB_VENDOR_KEY_PATH),\ |
| 1685 | $(hide) echo "avb_vendor_key_path=$(BOARD_AVB_VENDOR_KEY_PATH)" >> $(1) |
| 1686 | $(hide) echo "avb_vendor_algorithm=$(BOARD_AVB_VENDOR_ALGORITHM)" >> $(1) |
| 1687 | $(hide) echo "avb_vendor_rollback_index_location=$(BOARD_AVB_VENDOR_ROLLBACK_INDEX_LOCATION)" >> $(1))) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 1688 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_product_hashtree_enable=$(BOARD_AVB_ENABLE)" >> $(1)) |
| 1689 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_product_add_hashtree_footer_args=$(BOARD_AVB_PRODUCT_ADD_HASHTREE_FOOTER_ARGS)" >> $(1)) |
| 1690 | $(if $(BOARD_AVB_ENABLE),\ |
| 1691 | $(if $(BOARD_AVB_PRODUCT_KEY_PATH),\ |
| 1692 | $(hide) echo "avb_product_key_path=$(BOARD_AVB_PRODUCT_KEY_PATH)" >> $(1) |
| 1693 | $(hide) echo "avb_product_algorithm=$(BOARD_AVB_PRODUCT_ALGORITHM)" >> $(1) |
| 1694 | $(hide) echo "avb_product_rollback_index_location=$(BOARD_AVB_PRODUCT_ROLLBACK_INDEX_LOCATION)" >> $(1))) |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1695 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_system_ext_hashtree_enable=$(BOARD_AVB_ENABLE)" >> $(1)) |
Tao Bao | 1ebda8d | 2018-08-01 17:21:14 -0700 | [diff] [blame] | 1696 | $(if $(BOARD_AVB_ENABLE),\ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1697 | $(hide) echo "avb_system_ext_add_hashtree_footer_args=$(BOARD_AVB_SYSTEM_EXT_ADD_HASHTREE_FOOTER_ARGS)" >> $(1)) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 1698 | $(if $(BOARD_AVB_ENABLE),\ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1699 | $(if $(BOARD_AVB_SYSTEM_EXT_KEY_PATH),\ |
| 1700 | $(hide) echo "avb_system_ext_key_path=$(BOARD_AVB_SYSTEM_EXT_KEY_PATH)" >> $(1) |
| 1701 | $(hide) echo "avb_system_ext_algorithm=$(BOARD_AVB_SYSTEM_EXT_ALGORITHM)" >> $(1) |
| 1702 | $(hide) echo "avb_system_ext_rollback_index_location=$(BOARD_AVB_SYSTEM_EXT_ROLLBACK_INDEX_LOCATION)" >> $(1))) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 1703 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_odm_hashtree_enable=$(BOARD_AVB_ENABLE)" >> $(1)) |
| 1704 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_odm_add_hashtree_footer_args=$(BOARD_AVB_ODM_ADD_HASHTREE_FOOTER_ARGS)" >> $(1)) |
| 1705 | $(if $(BOARD_AVB_ENABLE),\ |
| 1706 | $(if $(BOARD_AVB_ODM_KEY_PATH),\ |
| 1707 | $(hide) echo "avb_odm_key_path=$(BOARD_AVB_ODM_KEY_PATH)" >> $(1) |
| 1708 | $(hide) echo "avb_odm_algorithm=$(BOARD_AVB_ODM_ALGORITHM)" >> $(1) |
| 1709 | $(hide) echo "avb_odm_rollback_index_location=$(BOARD_AVB_ODM_ROLLBACK_INDEX_LOCATION)" >> $(1))) |
Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 1710 | $(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)),\ |
| 1711 | $(hide) echo "recovery_as_boot=true" >> $(1)) |
Ying Wang | 0eabd4f | 2015-03-24 19:07:40 -0700 | [diff] [blame] | 1712 | $(if $(filter true,$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)),\ |
Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1713 | $(hide) echo "system_root_image=true" >> $(1)) |
| 1714 | $(hide) echo "root_dir=$(TARGET_ROOT_OUT)" >> $(1) |
Yifan Hong | 2dae572 | 2018-07-31 12:47:27 -0700 | [diff] [blame] | 1715 | $(if $(PRODUCT_USE_DYNAMIC_PARTITION_SIZE),$(hide) echo "use_dynamic_partition_size=true" >> $(1)) |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1716 | $(if $(3),$(hide) $(foreach kv,$(3),echo "$(kv)" >> $(1);)) |
| 1717 | endef |
| 1718 | |
| 1719 | # $(1): the path of the output dictionary file |
| 1720 | # $(2): additional "key=value" pairs to append to the dictionary file. |
Daniel Norman | 72c626f | 2019-05-13 15:58:14 -0700 | [diff] [blame] | 1721 | PROP_DICTIONARY_IMAGES := oem |
| 1722 | ifdef BUILDING_CACHE_IMAGE |
| 1723 | PROP_DICTIONARY_IMAGES += cache |
| 1724 | endif |
| 1725 | ifdef BUILDING_SYSTEM_IMAGE |
| 1726 | PROP_DICTIONARY_IMAGES += system |
| 1727 | endif |
| 1728 | ifdef BUILDING_USERDATA_IMAGE |
| 1729 | PROP_DICTIONARY_IMAGES += userdata |
| 1730 | endif |
| 1731 | ifdef BUILDING_VENDOR_IMAGE |
| 1732 | PROP_DICTIONARY_IMAGES += vendor |
| 1733 | endif |
| 1734 | ifdef BUILDING_PRODUCT_IMAGE |
| 1735 | PROP_DICTIONARY_IMAGES += product |
| 1736 | endif |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 1737 | ifdef BUILDING_SYSTEM_EXT_IMAGE |
| 1738 | PROP_DICTIONARY_IMAGES += system_ext |
Daniel Norman | 72c626f | 2019-05-13 15:58:14 -0700 | [diff] [blame] | 1739 | endif |
| 1740 | ifdef BUILDING_ODM_IMAGE |
| 1741 | PROP_DICTIONARY_IMAGES += odm |
| 1742 | endif |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1743 | define generate-userimage-prop-dictionary |
Daniel Norman | 72c626f | 2019-05-13 15:58:14 -0700 | [diff] [blame] | 1744 | $(call generate-image-prop-dictionary,$(1),$(PROP_DICTIONARY_IMAGES),$(2)) |
Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 1745 | endef |
| 1746 | |
Yifan Hong | bbcba1e | 2018-06-18 16:32:35 -0700 | [diff] [blame] | 1747 | # $(1): the path of the input dictionary file, where each line has the format key=value |
| 1748 | # $(2): the key to look up |
| 1749 | define read-image-prop-dictionary |
| 1750 | $$(grep '$(2)=' $(1) | cut -f2- -d'=') |
| 1751 | endef |
| 1752 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1753 | # ----------------------------------------------------------------- |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1754 | # Recovery image |
Doug Zongker | 8cebf1f | 2009-07-07 17:14:25 -0700 | [diff] [blame] | 1755 | |
Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 1756 | # Recovery image exists if we are building recovery, or building recovery as boot. |
Chris Gross | a784ef1 | 2019-04-22 11:09:57 -0700 | [diff] [blame] | 1757 | ifdef BUILDING_RECOVERY_IMAGE |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1758 | |
Ying Wang | 3752614 | 2015-03-10 12:02:57 -0700 | [diff] [blame] | 1759 | INTERNAL_RECOVERYIMAGE_FILES := $(filter $(TARGET_RECOVERY_OUT)/%, \ |
| 1760 | $(ALL_DEFAULT_INSTALLED_MODULES)) |
| 1761 | |
Tao Bao | 10fc949 | 2018-08-14 12:17:48 -0700 | [diff] [blame] | 1762 | INSTALLED_FILES_FILE_RECOVERY := $(PRODUCT_OUT)/installed-files-recovery.txt |
| 1763 | INSTALLED_FILES_JSON_RECOVERY := $(INSTALLED_FILES_FILE_RECOVERY:.txt=.json) |
| 1764 | |
| 1765 | # TODO(b/30414428): Can't depend on INTERNAL_RECOVERYIMAGE_FILES alone like other |
| 1766 | # INSTALLED_FILES_FILE_* rules. Because currently there're cp/rsync/rm commands in |
| 1767 | # build-recoveryimage-target, which would touch the files under TARGET_RECOVERY_OUT and race with |
| 1768 | # the call to FILELIST. |
| 1769 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) |
Chris Gross | a784ef1 | 2019-04-22 11:09:57 -0700 | [diff] [blame] | 1770 | INSTALLED_BOOTIMAGE_TARGET := $(BUILT_BOOTIMAGE_TARGET) |
Tao Bao | 10fc949 | 2018-08-14 12:17:48 -0700 | [diff] [blame] | 1771 | $(INSTALLED_FILES_FILE_RECOVERY): $(INSTALLED_BOOTIMAGE_TARGET) |
| 1772 | else |
| 1773 | $(INSTALLED_FILES_FILE_RECOVERY): $(INSTALLED_RECOVERYIMAGE_TARGET) |
| 1774 | endif |
| 1775 | |
| 1776 | $(INSTALLED_FILES_FILE_RECOVERY): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_RECOVERY) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 1777 | $(INSTALLED_FILES_FILE_RECOVERY): $(INTERNAL_RECOVERYIMAGE_FILES) $(FILESLIST) $(FILESLIST_UTIL) |
Tao Bao | 10fc949 | 2018-08-14 12:17:48 -0700 | [diff] [blame] | 1778 | @echo Installed file list: $@ |
| 1779 | @mkdir -p $(dir $@) |
| 1780 | @rm -f $@ |
| 1781 | $(hide) $(FILESLIST) $(TARGET_RECOVERY_ROOT_OUT) > $(@:.txt=.json) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 1782 | $(hide) $(FILESLIST_UTIL) -c $(@:.txt=.json) > $@ |
Tao Bao | 10fc949 | 2018-08-14 12:17:48 -0700 | [diff] [blame] | 1783 | |
Alex Klyubin | 2a7171a | 2017-03-10 12:53:02 -0800 | [diff] [blame] | 1784 | recovery_sepolicy := \ |
| 1785 | $(TARGET_RECOVERY_ROOT_OUT)/sepolicy \ |
Jeff Vander Stoep | 4ff042c | 2017-06-13 08:30:46 -0700 | [diff] [blame] | 1786 | $(TARGET_RECOVERY_ROOT_OUT)/plat_file_contexts \ |
Alex Klyubin | 2a7171a | 2017-03-10 12:53:02 -0800 | [diff] [blame] | 1787 | $(TARGET_RECOVERY_ROOT_OUT)/plat_property_contexts \ |
Bowgo Tsai | 07365df | 2019-09-28 09:04:51 +0800 | [diff] [blame] | 1788 | $(TARGET_RECOVERY_ROOT_OUT)/system_ext_file_contexts \ |
| 1789 | $(TARGET_RECOVERY_ROOT_OUT)/system_ext_property_contexts \ |
| 1790 | $(TARGET_RECOVERY_ROOT_OUT)/vendor_file_contexts \ |
Tri Vo | 62d51b6 | 2019-02-19 11:23:12 -0800 | [diff] [blame] | 1791 | $(TARGET_RECOVERY_ROOT_OUT)/vendor_property_contexts \ |
Bowgo Tsai | 9967125 | 2017-11-30 22:15:17 +0800 | [diff] [blame] | 1792 | $(TARGET_RECOVERY_ROOT_OUT)/odm_file_contexts \ |
Tri Vo | 62d51b6 | 2019-02-19 11:23:12 -0800 | [diff] [blame] | 1793 | $(TARGET_RECOVERY_ROOT_OUT)/odm_property_contexts \ |
| 1794 | $(TARGET_RECOVERY_ROOT_OUT)/product_file_contexts \ |
| 1795 | $(TARGET_RECOVERY_ROOT_OUT)/product_property_contexts |
Bowgo Tsai | 9967125 | 2017-11-30 22:15:17 +0800 | [diff] [blame] | 1796 | |
Alex Klyubin | 2a7171a | 2017-03-10 12:53:02 -0800 | [diff] [blame] | 1797 | # Passed into rsync from non-recovery root to recovery root, to avoid overwriting recovery-specific |
| 1798 | # SELinux files |
| 1799 | IGNORE_RECOVERY_SEPOLICY := $(patsubst $(TARGET_RECOVERY_OUT)/%,--exclude=/%,$(recovery_sepolicy)) |
| 1800 | |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1801 | recovery_kernel := $(INSTALLED_KERNEL_TARGET) # same as a non-recovery system |
| 1802 | recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1803 | recovery_resources_common := $(call include-path-for, recovery)/res |
Doug Zongker | e129732 | 2013-03-06 15:04:31 -0800 | [diff] [blame] | 1804 | |
Anton Hansson | 45a40da | 2019-01-18 14:06:34 +0000 | [diff] [blame] | 1805 | # Set recovery_density to a density bucket based on TARGET_SCREEN_DENSITY, PRODUCT_AAPT_PREF_CONFIG, |
| 1806 | # or mdpi, in order of preference. We support both specific buckets (e.g. xdpi) and numbers, |
| 1807 | # which get remapped to a bucket. |
| 1808 | recovery_density := $(or $(TARGET_SCREEN_DENSITY),$(PRODUCT_AAPT_PREF_CONFIG),mdpi) |
Tao Bao | e1e829e | 2018-08-29 20:36:00 -0700 | [diff] [blame] | 1809 | ifeq (,$(filter xxxhdpi xxhdpi xhdpi hdpi mdpi,$(recovery_density))) |
| 1810 | recovery_density_value := $(patsubst %dpi,%,$(recovery_density)) |
Anton Hansson | 45a40da | 2019-01-18 14:06:34 +0000 | [diff] [blame] | 1811 | # We roughly use the medium point between the primary densities to split buckets. |
Tao Bao | e1e829e | 2018-08-29 20:36:00 -0700 | [diff] [blame] | 1812 | # ------160------240------320----------480------------640------ |
| 1813 | # mdpi hdpi xhdpi xxhdpi xxxhdpi |
| 1814 | recovery_density := $(strip \ |
| 1815 | $(or $(if $(filter $(shell echo $$(($(recovery_density_value) >= 560))),1),xxxhdpi),\ |
| 1816 | $(if $(filter $(shell echo $$(($(recovery_density_value) >= 400))),1),xxhdpi),\ |
| 1817 | $(if $(filter $(shell echo $$(($(recovery_density_value) >= 280))),1),xhdpi),\ |
| 1818 | $(if $(filter $(shell echo $$(($(recovery_density_value) >= 200))),1),hdpi,mdpi))) |
Doug Zongker | 8eaeea9 | 2014-05-12 15:32:20 -0700 | [diff] [blame] | 1819 | endif |
| 1820 | |
| 1821 | ifneq (,$(wildcard $(recovery_resources_common)-$(recovery_density))) |
| 1822 | recovery_resources_common := $(recovery_resources_common)-$(recovery_density) |
| 1823 | else |
Doug Zongker | 25d55f8 | 2014-04-04 13:51:15 -0700 | [diff] [blame] | 1824 | recovery_resources_common := $(recovery_resources_common)-xhdpi |
| 1825 | endif |
| 1826 | |
Tao Bao | e1e829e | 2018-08-29 20:36:00 -0700 | [diff] [blame] | 1827 | # Select the 18x32 font on high-density devices (xhdpi and up); and the 12x22 font on other devices. |
| 1828 | # Note that the font selected here can be overridden for a particular device by putting a font.png |
| 1829 | # in its private recovery resources. |
| 1830 | ifneq (,$(filter xxxhdpi xxhdpi xhdpi,$(recovery_density))) |
Doug Zongker | e129732 | 2013-03-06 15:04:31 -0800 | [diff] [blame] | 1831 | recovery_font := $(call include-path-for, recovery)/fonts/18x32.png |
| 1832 | else |
| 1833 | recovery_font := $(call include-path-for, recovery)/fonts/12x22.png |
| 1834 | endif |
| 1835 | |
Tianjie Xu | 81c88ad | 2018-11-07 11:36:19 -0800 | [diff] [blame] | 1836 | |
| 1837 | # We will only generate the recovery background text images if the variable |
| 1838 | # TARGET_RECOVERY_UI_SCREEN_WIDTH is defined. For devices with xxxhdpi and xxhdpi, we set the |
| 1839 | # variable to the commonly used values here, if it hasn't been intialized elsewhere. While for |
| 1840 | # devices with lower density, they must have TARGET_RECOVERY_UI_SCREEN_WIDTH defined in their |
| 1841 | # BoardConfig in order to use this feature. |
| 1842 | ifeq ($(recovery_density),xxxhdpi) |
| 1843 | TARGET_RECOVERY_UI_SCREEN_WIDTH ?= 1440 |
| 1844 | else ifeq ($(recovery_density),xxhdpi) |
| 1845 | TARGET_RECOVERY_UI_SCREEN_WIDTH ?= 1080 |
| 1846 | endif |
| 1847 | |
| 1848 | ifneq ($(TARGET_RECOVERY_UI_SCREEN_WIDTH),) |
| 1849 | # Subtracts the margin width and menu indent from the screen width; it's safe to be conservative. |
| 1850 | ifeq ($(TARGET_RECOVERY_UI_MARGIN_WIDTH),) |
| 1851 | recovery_image_width := $$(($(TARGET_RECOVERY_UI_SCREEN_WIDTH) - 10)) |
| 1852 | else |
| 1853 | recovery_image_width := $$(($(TARGET_RECOVERY_UI_SCREEN_WIDTH) - $(TARGET_RECOVERY_UI_MARGIN_WIDTH) - 10)) |
| 1854 | endif |
| 1855 | |
| 1856 | |
| 1857 | RECOVERY_INSTALLING_TEXT_FILE := $(call intermediates-dir-for,PACKAGING,recovery_text_res)/installing_text.png |
| 1858 | RECOVERY_INSTALLING_SECURITY_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/installing_security_text.png |
| 1859 | RECOVERY_ERASING_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/erasing_text.png |
| 1860 | RECOVERY_ERROR_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/error_text.png |
| 1861 | RECOVERY_NO_COMMAND_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/no_command_text.png |
| 1862 | |
xunchang | cc57d31 | 2018-12-07 12:12:17 -0800 | [diff] [blame] | 1863 | RECOVERY_CANCEL_WIPE_DATA_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/cancel_wipe_data_text.png |
| 1864 | RECOVERY_FACTORY_DATA_RESET_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/factory_data_reset_text.png |
| 1865 | RECOVERY_TRY_AGAIN_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/try_again_text.png |
| 1866 | RECOVERY_WIPE_DATA_CONFIRMATION_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/wipe_data_confirmation_text.png |
| 1867 | RECOVERY_WIPE_DATA_MENU_HEADER_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/wipe_data_menu_header_text.png |
| 1868 | |
| 1869 | generated_recovery_text_files := \ |
Tianjie Xu | 81c88ad | 2018-11-07 11:36:19 -0800 | [diff] [blame] | 1870 | $(RECOVERY_INSTALLING_TEXT_FILE) \ |
| 1871 | $(RECOVERY_INSTALLING_SECURITY_TEXT_FILE) \ |
| 1872 | $(RECOVERY_ERASING_TEXT_FILE) \ |
| 1873 | $(RECOVERY_ERROR_TEXT_FILE) \ |
xunchang | cc57d31 | 2018-12-07 12:12:17 -0800 | [diff] [blame] | 1874 | $(RECOVERY_NO_COMMAND_TEXT_FILE) \ |
| 1875 | $(RECOVERY_CANCEL_WIPE_DATA_TEXT_FILE) \ |
| 1876 | $(RECOVERY_FACTORY_DATA_RESET_TEXT_FILE) \ |
| 1877 | $(RECOVERY_TRY_AGAIN_TEXT_FILE) \ |
| 1878 | $(RECOVERY_WIPE_DATA_CONFIRMATION_TEXT_FILE) \ |
| 1879 | $(RECOVERY_WIPE_DATA_MENU_HEADER_TEXT_FILE) |
Tianjie Xu | 81c88ad | 2018-11-07 11:36:19 -0800 | [diff] [blame] | 1880 | |
| 1881 | resource_dir := $(call include-path-for, recovery)/tools/recovery_l10n/res/ |
| 1882 | image_generator_jar := $(HOST_OUT_JAVA_LIBRARIES)/RecoveryImageGenerator.jar |
xunchang | cc57d31 | 2018-12-07 12:12:17 -0800 | [diff] [blame] | 1883 | zopflipng := $(HOST_OUT_EXECUTABLES)/zopflipng |
Tianjie Xu | 81c88ad | 2018-11-07 11:36:19 -0800 | [diff] [blame] | 1884 | $(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_SOURCE_FONTS := $(recovery_noto-fonts_dep) $(recovery_roboto-fonts_dep) |
| 1885 | $(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RECOVERY_FONT_FILES_DIR := $(call intermediates-dir-for,PACKAGING,recovery_font_files) |
| 1886 | $(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RESOURCE_DIR := $(resource_dir) |
| 1887 | $(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_IMAGE_GENERATOR_JAR := $(image_generator_jar) |
xunchang | cc57d31 | 2018-12-07 12:12:17 -0800 | [diff] [blame] | 1888 | $(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_ZOPFLIPNG := $(zopflipng) |
Tianjie Xu | 81c88ad | 2018-11-07 11:36:19 -0800 | [diff] [blame] | 1889 | $(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RECOVERY_IMAGE_WIDTH := $(recovery_image_width) |
xunchang | dbe55e1 | 2018-12-19 17:15:14 -0800 | [diff] [blame] | 1890 | $(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST := \ |
xunchang | cc57d31 | 2018-12-07 12:12:17 -0800 | [diff] [blame] | 1891 | recovery_installing \ |
| 1892 | recovery_installing_security \ |
| 1893 | recovery_erasing \ |
| 1894 | recovery_error \ |
xunchang | dbe55e1 | 2018-12-19 17:15:14 -0800 | [diff] [blame] | 1895 | recovery_no_command |
| 1896 | $(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RECOVERY_WIPE_DATA_TEXT_LIST := \ |
xunchang | cc57d31 | 2018-12-07 12:12:17 -0800 | [diff] [blame] | 1897 | recovery_cancel_wipe_data \ |
| 1898 | recovery_factory_data_reset \ |
| 1899 | recovery_try_again \ |
| 1900 | recovery_wipe_data_menu_header \ |
| 1901 | recovery_wipe_data_confirmation |
| 1902 | $(RECOVERY_INSTALLING_TEXT_FILE): .KATI_IMPLICIT_OUTPUTS := $(filter-out $(RECOVERY_INSTALLING_TEXT_FILE),$(generated_recovery_text_files)) |
| 1903 | $(RECOVERY_INSTALLING_TEXT_FILE): $(image_generator_jar) $(resource_dir) $(recovery_noto-fonts_dep) $(recovery_roboto-fonts_dep) $(zopflipng) |
Tianjie Xu | 81c88ad | 2018-11-07 11:36:19 -0800 | [diff] [blame] | 1904 | # Prepares the font directory. |
| 1905 | @rm -rf $(PRIVATE_RECOVERY_FONT_FILES_DIR) |
| 1906 | @mkdir -p $(PRIVATE_RECOVERY_FONT_FILES_DIR) |
xunchang | cc57d31 | 2018-12-07 12:12:17 -0800 | [diff] [blame] | 1907 | $(foreach filename,$(PRIVATE_SOURCE_FONTS), cp $(filename) $(PRIVATE_RECOVERY_FONT_FILES_DIR) &&) true |
Tianjie Xu | 81c88ad | 2018-11-07 11:36:19 -0800 | [diff] [blame] | 1908 | @rm -rf $(dir $@) |
| 1909 | @mkdir -p $(dir $@) |
xunchang | dbe55e1 | 2018-12-19 17:15:14 -0800 | [diff] [blame] | 1910 | $(foreach text_name,$(PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST) $(PRIVATE_RECOVERY_WIPE_DATA_TEXT_LIST), \ |
xunchang | cc57d31 | 2018-12-07 12:12:17 -0800 | [diff] [blame] | 1911 | $(eval output_file := $(dir $@)/$(patsubst recovery_%,%_text.png,$(text_name))) \ |
xunchang | dbe55e1 | 2018-12-19 17:15:14 -0800 | [diff] [blame] | 1912 | $(eval center_alignment := $(if $(filter $(text_name),$(PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST)), --center_alignment)) \ |
Tianjie Xu | 81c88ad | 2018-11-07 11:36:19 -0800 | [diff] [blame] | 1913 | java -jar $(PRIVATE_IMAGE_GENERATOR_JAR) \ |
| 1914 | --image_width $(PRIVATE_RECOVERY_IMAGE_WIDTH) \ |
| 1915 | --text_name $(text_name) \ |
| 1916 | --font_dir $(PRIVATE_RECOVERY_FONT_FILES_DIR) \ |
| 1917 | --resource_dir $(PRIVATE_RESOURCE_DIR) \ |
xunchang | dbe55e1 | 2018-12-19 17:15:14 -0800 | [diff] [blame] | 1918 | --output_file $(output_file) $(center_alignment) && \ |
xunchang | cc57d31 | 2018-12-07 12:12:17 -0800 | [diff] [blame] | 1919 | $(PRIVATE_ZOPFLIPNG) -y --iterations=1 --filters=0 $(output_file) $(output_file) > /dev/null &&) true |
Tianjie Xu | 81c88ad | 2018-11-07 11:36:19 -0800 | [diff] [blame] | 1920 | else |
| 1921 | RECOVERY_INSTALLING_TEXT_FILE := |
| 1922 | RECOVERY_INSTALLING_SECURITY_TEXT_FILE := |
| 1923 | RECOVERY_ERASING_TEXT_FILE := |
| 1924 | RECOVERY_ERROR_TEXT_FILE := |
| 1925 | RECOVERY_NO_COMMAND_TEXT_FILE := |
xunchang | cc57d31 | 2018-12-07 12:12:17 -0800 | [diff] [blame] | 1926 | RECOVERY_CANCEL_WIPE_DATA_TEXT_FILE := |
| 1927 | RECOVERY_FACTORY_DATA_RESET_TEXT_FILE := |
| 1928 | RECOVERY_TRY_AGAIN_TEXT_FILE := |
| 1929 | RECOVERY_WIPE_DATA_CONFIRMATION_TEXT_FILE := |
| 1930 | RECOVERY_WIPE_DATA_MENU_HEADER_TEXT_FILE := |
Tianjie Xu | 81c88ad | 2018-11-07 11:36:19 -0800 | [diff] [blame] | 1931 | endif # TARGET_RECOVERY_UI_SCREEN_WIDTH |
| 1932 | |
Ying Wang | 9a17568 | 2015-08-06 11:47:47 -0700 | [diff] [blame] | 1933 | ifndef TARGET_PRIVATE_RES_DIRS |
| 1934 | TARGET_PRIVATE_RES_DIRS := $(wildcard $(TARGET_DEVICE_DIR)/recovery/res) |
| 1935 | endif |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1936 | recovery_resource_deps := $(shell find $(recovery_resources_common) \ |
Ying Wang | 9a17568 | 2015-08-06 11:47:47 -0700 | [diff] [blame] | 1937 | $(TARGET_PRIVATE_RES_DIRS) -type f) |
xunchang | cc57d31 | 2018-12-07 12:12:17 -0800 | [diff] [blame] | 1938 | recovery_resource_deps += $(generated_recovery_text_files) |
Tianjie Xu | 81c88ad | 2018-11-07 11:36:19 -0800 | [diff] [blame] | 1939 | |
| 1940 | |
Andrew Boie | fa61ff0 | 2012-09-28 09:33:45 -0700 | [diff] [blame] | 1941 | ifdef TARGET_RECOVERY_FSTAB |
| 1942 | recovery_fstab := $(TARGET_RECOVERY_FSTAB) |
| 1943 | else |
Doug Zongker | 9ce0fb6 | 2010-09-20 18:04:41 -0700 | [diff] [blame] | 1944 | recovery_fstab := $(strip $(wildcard $(TARGET_DEVICE_DIR)/recovery.fstab)) |
Andrew Boie | fa61ff0 | 2012-09-28 09:33:45 -0700 | [diff] [blame] | 1945 | endif |
Tao Bao | c3c1753 | 2016-06-10 10:11:54 -0700 | [diff] [blame] | 1946 | ifdef TARGET_RECOVERY_WIPE |
| 1947 | recovery_wipe := $(TARGET_RECOVERY_WIPE) |
Tao Bao | 3051f4f | 2016-05-31 23:56:23 -0700 | [diff] [blame] | 1948 | else |
Tao Bao | c3c1753 | 2016-06-10 10:11:54 -0700 | [diff] [blame] | 1949 | recovery_wipe := |
Tao Bao | 3051f4f | 2016-05-31 23:56:23 -0700 | [diff] [blame] | 1950 | endif |
Tao Bao | 8beab69 | 2015-07-22 12:33:18 -0700 | [diff] [blame] | 1951 | |
Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 1952 | # Traditionally with non-A/B OTA we have: |
Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 1953 | # boot.img + recovery-from-boot.p + recovery-resource.dat = recovery.img. |
Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 1954 | # recovery-resource.dat is needed only if we carry an imgdiff patch of the boot and recovery images |
| 1955 | # and invoke install-recovery.sh on the first boot post an OTA update. |
Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 1956 | # |
| 1957 | # We no longer need that if one of the following conditions holds: |
Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 1958 | # a) We carry a full copy of the recovery image - no patching needed |
Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 1959 | # (BOARD_USES_FULL_RECOVERY_IMAGE = true); |
Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 1960 | # b) We build a single image that contains boot and recovery both - no recovery image to install |
| 1961 | # (BOARD_USES_RECOVERY_AS_BOOT = true); |
Tom Cherry | 2929cad | 2018-09-20 11:04:37 -0700 | [diff] [blame] | 1962 | # c) We mount the system image as / and therefore do not have a ramdisk in boot.img |
Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 1963 | # (BOARD_BUILD_SYSTEM_ROOT_IMAGE = true). |
Hridya Valsaraju | e74a38b | 2018-03-21 12:15:11 -0700 | [diff] [blame] | 1964 | # d) We include the recovery DTBO image within recovery - not needing the resource file as we |
| 1965 | # do bsdiff because boot and recovery will contain different number of entries |
| 1966 | # (BOARD_INCLUDE_RECOVERY_DTBO = true). |
Chen, ZhiminX | 752439b | 2018-09-23 22:10:47 +0800 | [diff] [blame] | 1967 | # e) We include the recovery ACPIO image within recovery - not needing the resource file as we |
| 1968 | # do bsdiff because boot and recovery will contain different number of entries |
| 1969 | # (BOARD_INCLUDE_RECOVERY_ACPIO = true). |
Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 1970 | |
Tom Cherry | 2929cad | 2018-09-20 11:04:37 -0700 | [diff] [blame] | 1971 | ifeq (,$(filter true, $(BOARD_USES_FULL_RECOVERY_IMAGE) $(BOARD_USES_RECOVERY_AS_BOOT) \ |
Chen, ZhiminX | 752439b | 2018-09-23 22:10:47 +0800 | [diff] [blame] | 1972 | $(BOARD_BUILD_SYSTEM_ROOT_IMAGE) $(BOARD_INCLUDE_RECOVERY_DTBO) $(BOARD_INCLUDE_RECOVERY_ACPIO))) |
Doug Zongker | 5658887 | 2012-08-20 15:38:58 -0700 | [diff] [blame] | 1973 | # Named '.dat' so we don't attempt to use imgdiff for patching it. |
Bill Peckham | e868aec | 2019-09-17 17:06:47 -0700 | [diff] [blame] | 1974 | RECOVERY_RESOURCE_ZIP := $(TARGET_OUT_VENDOR)/etc/recovery-resource.dat |
| 1975 | ALL_DEFAULT_INSTALLED_MODULES += $(RECOVERY_RESOURCE_ZIP) |
Tao Bao | 8beab69 | 2015-07-22 12:33:18 -0700 | [diff] [blame] | 1976 | else |
Tao Bao | 8beab69 | 2015-07-22 12:33:18 -0700 | [diff] [blame] | 1977 | RECOVERY_RESOURCE_ZIP := |
| 1978 | endif |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1979 | |
Tao Bao | 139c727 | 2018-07-31 13:26:54 -0700 | [diff] [blame] | 1980 | INSTALLED_RECOVERY_BUILD_PROP_TARGET := $(TARGET_RECOVERY_ROOT_OUT)/prop.default |
| 1981 | |
| 1982 | $(INSTALLED_RECOVERY_BUILD_PROP_TARGET): PRIVATE_RECOVERY_UI_PROPERTIES := \ |
Tao Bao | 139c727 | 2018-07-31 13:26:54 -0700 | [diff] [blame] | 1983 | TARGET_RECOVERY_UI_ANIMATION_FPS:animation_fps \ |
| 1984 | TARGET_RECOVERY_UI_MARGIN_HEIGHT:margin_height \ |
| 1985 | TARGET_RECOVERY_UI_MARGIN_WIDTH:margin_width \ |
| 1986 | TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS:menu_unusable_rows \ |
| 1987 | TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE:progress_bar_baseline \ |
| 1988 | TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD:touch_low_threshold \ |
| 1989 | TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD:touch_high_threshold \ |
| 1990 | TARGET_RECOVERY_UI_VR_STEREO_OFFSET:vr_stereo_offset |
| 1991 | |
| 1992 | # Parses the given list of build variables and writes their values as build properties if defined. |
| 1993 | # For example, if a target defines `TARGET_RECOVERY_UI_MARGIN_HEIGHT := 100`, |
| 1994 | # `ro.recovery.ui.margin_height=100` will be appended to the given output file. |
| 1995 | # $(1): Map from the build variable names to property names |
| 1996 | # $(2): Output file |
| 1997 | define append-recovery-ui-properties |
| 1998 | echo "#" >> $(2) |
| 1999 | echo "# RECOVERY UI BUILD PROPERTIES" >> $(2) |
| 2000 | echo "#" >> $(2) |
| 2001 | $(foreach prop,$(1), \ |
| 2002 | $(eval _varname := $(call word-colon,1,$(prop))) \ |
| 2003 | $(eval _propname := $(call word-colon,2,$(prop))) \ |
| 2004 | $(eval _value := $($(_varname))) \ |
| 2005 | $(if $(_value), \ |
| 2006 | echo ro.recovery.ui.$(_propname)=$(_value) >> $(2) &&)) true |
| 2007 | endef |
| 2008 | |
| 2009 | $(INSTALLED_RECOVERY_BUILD_PROP_TARGET): \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 2010 | $(INSTALLED_DEFAULT_PROP_TARGET) \ |
| 2011 | $(INSTALLED_VENDOR_DEFAULT_PROP_TARGET) \ |
| 2012 | $(intermediate_system_build_prop) \ |
| 2013 | $(INSTALLED_VENDOR_BUILD_PROP_TARGET) \ |
| 2014 | $(INSTALLED_ODM_BUILD_PROP_TARGET) \ |
| 2015 | $(INSTALLED_PRODUCT_BUILD_PROP_TARGET) \ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 2016 | $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET) |
Tao Bao | 1edaca1 | 2018-09-18 10:22:54 -0700 | [diff] [blame] | 2017 | @echo "Target recovery buildinfo: $@" |
Tao Bao | 139c727 | 2018-07-31 13:26:54 -0700 | [diff] [blame] | 2018 | $(hide) mkdir -p $(dir $@) |
| 2019 | $(hide) rm -f $@ |
| 2020 | $(hide) cat $(INSTALLED_DEFAULT_PROP_TARGET) > $@ |
| 2021 | $(hide) cat $(INSTALLED_VENDOR_DEFAULT_PROP_TARGET) >> $@ |
Tao Bao | 6eb1a99 | 2018-08-06 07:33:45 -0700 | [diff] [blame] | 2022 | $(hide) cat $(intermediate_system_build_prop) >> $@ |
Tao Bao | 139c727 | 2018-07-31 13:26:54 -0700 | [diff] [blame] | 2023 | $(hide) cat $(INSTALLED_VENDOR_BUILD_PROP_TARGET) >> $@ |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 2024 | $(hide) cat $(INSTALLED_ODM_BUILD_PROP_TARGET) >> $@ |
Tao Bao | 139c727 | 2018-07-31 13:26:54 -0700 | [diff] [blame] | 2025 | $(hide) cat $(INSTALLED_PRODUCT_BUILD_PROP_TARGET) >> $@ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 2026 | $(hide) cat $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET) >> $@ |
Tao Bao | 139c727 | 2018-07-31 13:26:54 -0700 | [diff] [blame] | 2027 | $(call append-recovery-ui-properties,$(PRIVATE_RECOVERY_UI_PROPERTIES),$@) |
| 2028 | |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 2029 | ifdef INSTALLED_VENDOR_BOOTIMAGE_TARGET |
| 2030 | INTERNAL_RECOVERYIMAGE_ARGS := \ |
| 2031 | --kernel $(recovery_kernel) --ramdisk $(recovery_ramdisk) |
| 2032 | ifdef GENERIC_KERNEL_CMDLINE |
| 2033 | INTERNAL_RECOVERYIMAGE_ARGS += --cmdline "$(GENERIC_KERNEL_CMDLINE)" |
| 2034 | endif |
| 2035 | else # INSTALLED_VENDOR_BOOTIMAGE_TARGET not defined |
| 2036 | INTERNAL_RECOVERYIMAGE_ARGS := \ |
| 2037 | $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \ |
| 2038 | --kernel $(recovery_kernel) --ramdisk $(recovery_ramdisk) |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 2039 | # Assumes this has already been stripped |
Dan Willemsen | c1f17ff | 2016-10-05 16:57:27 -0700 | [diff] [blame] | 2040 | ifdef INTERNAL_KERNEL_CMDLINE |
| 2041 | INTERNAL_RECOVERYIMAGE_ARGS += --cmdline "$(INTERNAL_KERNEL_CMDLINE)" |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 2042 | endif |
| 2043 | ifdef BOARD_KERNEL_BASE |
| 2044 | INTERNAL_RECOVERYIMAGE_ARGS += --base $(BOARD_KERNEL_BASE) |
| 2045 | endif |
Ying Wang | 4de6b5b | 2010-08-25 14:29:34 -0700 | [diff] [blame] | 2046 | ifdef BOARD_KERNEL_PAGESIZE |
| 2047 | INTERNAL_RECOVERYIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE) |
| 2048 | endif |
Hridya Valsaraju | e74a38b | 2018-03-21 12:15:11 -0700 | [diff] [blame] | 2049 | ifdef BOARD_INCLUDE_RECOVERY_DTBO |
Hridya Valsaraju | a941899 | 2019-02-04 10:35:25 -0800 | [diff] [blame] | 2050 | ifdef BOARD_PREBUILT_RECOVERY_DTBOIMAGE |
| 2051 | INTERNAL_RECOVERYIMAGE_ARGS += --recovery_dtbo $(BOARD_PREBUILT_RECOVERY_DTBOIMAGE) |
| 2052 | else |
Hridya Valsaraju | e74a38b | 2018-03-21 12:15:11 -0700 | [diff] [blame] | 2053 | INTERNAL_RECOVERYIMAGE_ARGS += --recovery_dtbo $(BOARD_PREBUILT_DTBOIMAGE) |
| 2054 | endif |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 2055 | endif # BOARD_INCLUDE_RECOVERY_DTBO |
Chen, ZhiminX | 752439b | 2018-09-23 22:10:47 +0800 | [diff] [blame] | 2056 | ifdef BOARD_INCLUDE_RECOVERY_ACPIO |
| 2057 | INTERNAL_RECOVERYIMAGE_ARGS += --recovery_acpio $(BOARD_RECOVERY_ACPIO) |
| 2058 | endif |
Hridya Valsaraju | 9683b2f | 2019-01-22 18:08:59 -0800 | [diff] [blame] | 2059 | ifdef BOARD_INCLUDE_DTB_IN_BOOTIMG |
| 2060 | INTERNAL_RECOVERYIMAGE_ARGS += --dtb $(INSTALLED_DTBIMAGE_TARGET) |
| 2061 | endif |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 2062 | endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET not defined |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 2063 | |
Ying Wang | 747b9f1 | 2015-01-30 14:05:22 -0800 | [diff] [blame] | 2064 | # $(1): output file |
| 2065 | define build-recoveryimage-target |
Tomasz Wasilczyk | 29ec06b | 2017-11-15 10:34:01 -0800 | [diff] [blame] | 2066 | # Making recovery image |
Ying Wang | 747b9f1 | 2015-01-30 14:05:22 -0800 | [diff] [blame] | 2067 | $(hide) mkdir -p $(TARGET_RECOVERY_OUT) |
Tao Bao | 696bb33 | 2018-08-17 16:27:01 -0700 | [diff] [blame] | 2068 | $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sdcard $(TARGET_RECOVERY_ROOT_OUT)/tmp |
Tomasz Wasilczyk | 29ec06b | 2017-11-15 10:34:01 -0800 | [diff] [blame] | 2069 | # Copying baseline ramdisk... |
Alex Klyubin | 2a7171a | 2017-03-10 12:53:02 -0800 | [diff] [blame] | 2070 | # Use rsync because "cp -Rf" fails to overwrite broken symlinks on Mac. |
Tao Bao | 696bb33 | 2018-08-17 16:27:01 -0700 | [diff] [blame] | 2071 | $(hide) rsync -a --exclude=sdcard $(IGNORE_RECOVERY_SEPOLICY) $(IGNORE_CACHE_LINK) $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT) |
Tomasz Wasilczyk | 29ec06b | 2017-11-15 10:34:01 -0800 | [diff] [blame] | 2072 | # Modifying ramdisk contents... |
Tom Cherry | 3871f0f | 2018-11-06 14:23:44 -0800 | [diff] [blame] | 2073 | $(if $(filter true,$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)),, \ |
| 2074 | $(hide) ln -sf /system/bin/init $(TARGET_RECOVERY_ROOT_OUT)/init) |
Bowgo Tsai | b5b3bc6 | 2017-09-25 17:50:41 +0800 | [diff] [blame] | 2075 | # Removes $(TARGET_RECOVERY_ROOT_OUT)/init*.rc EXCEPT init.recovery*.rc. |
| 2076 | $(hide) find $(TARGET_RECOVERY_ROOT_OUT) -maxdepth 1 -name 'init*.rc' -type f -not -name "init.recovery.*.rc" | xargs rm -f |
Tao Bao | cf8853b | 2018-08-13 14:27:32 -0700 | [diff] [blame] | 2077 | $(hide) cp $(TARGET_ROOT_OUT)/init.recovery.*.rc $(TARGET_RECOVERY_ROOT_OUT)/ 2> /dev/null || true # Ignore error when the src file doesn't exist. |
Ying Wang | 747b9f1 | 2015-01-30 14:05:22 -0800 | [diff] [blame] | 2078 | $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/res |
| 2079 | $(hide) rm -rf $(TARGET_RECOVERY_ROOT_OUT)/res/* |
| 2080 | $(hide) cp -rf $(recovery_resources_common)/* $(TARGET_RECOVERY_ROOT_OUT)/res |
xunchang | cc57d31 | 2018-12-07 12:12:17 -0800 | [diff] [blame] | 2081 | $(hide) $(foreach recovery_text_file,$(generated_recovery_text_files), \ |
| 2082 | cp -rf $(recovery_text_file) $(TARGET_RECOVERY_ROOT_OUT)/res/images/ &&) true |
Ying Wang | 747b9f1 | 2015-01-30 14:05:22 -0800 | [diff] [blame] | 2083 | $(hide) cp -f $(recovery_font) $(TARGET_RECOVERY_ROOT_OUT)/res/images/font.png |
Ying Wang | 9a17568 | 2015-08-06 11:47:47 -0700 | [diff] [blame] | 2084 | $(hide) $(foreach item,$(TARGET_PRIVATE_RES_DIRS), \ |
| 2085 | cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline)) |
Ying Wang | 747b9f1 | 2015-01-30 14:05:22 -0800 | [diff] [blame] | 2086 | $(hide) $(foreach item,$(recovery_fstab), \ |
Tao Bao | 696bb33 | 2018-08-17 16:27:01 -0700 | [diff] [blame] | 2087 | cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.fstab) |
Tao Bao | c3c1753 | 2016-06-10 10:11:54 -0700 | [diff] [blame] | 2088 | $(if $(strip $(recovery_wipe)), \ |
Tao Bao | 696bb33 | 2018-08-17 16:27:01 -0700 | [diff] [blame] | 2089 | $(hide) cp -f $(recovery_wipe) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.wipe) |
Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 2090 | $(hide) ln -sf prop.default $(TARGET_RECOVERY_ROOT_OUT)/default.prop |
Andriy Naborskyy | 5310557 | 2016-07-22 11:03:31 -0700 | [diff] [blame] | 2091 | $(BOARD_RECOVERY_IMAGE_PREPARE) |
Thierry Strudel | 74a81e6 | 2015-07-09 09:54:55 -0700 | [diff] [blame] | 2092 | $(hide) $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RECOVERY_ROOT_OUT) | $(MINIGZIP) > $(recovery_ramdisk) |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 2093 | $(if $(filter true,$(PRODUCT_SUPPORTS_VBOOT)), \ |
Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 2094 | $(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1).unsigned, \ |
Jooyung Han | 72b65ab | 2019-05-23 19:48:13 +0900 | [diff] [blame] | 2095 | $(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1)) |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 2096 | $(if $(filter true,$(PRODUCT_SUPPORTS_BOOT_SIGNER)),\ |
Nick Desaulniers | d491fcf | 2016-08-08 10:51:10 -0700 | [diff] [blame] | 2097 | $(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)),\ |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 2098 | $(BOOT_SIGNER) /boot $(1) $(PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCT_VERITY_SIGNING_KEY).x509.pem $(1),\ |
| 2099 | $(BOOT_SIGNER) /recovery $(1) $(PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCT_VERITY_SIGNING_KEY).x509.pem $(1)\ |
Nick Desaulniers | d491fcf | 2016-08-08 10:51:10 -0700 | [diff] [blame] | 2100 | )\ |
| 2101 | ) |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 2102 | $(if $(filter true,$(PRODUCT_SUPPORTS_VBOOT)), \ |
| 2103 | $(VBOOT_SIGNER) $(FUTILITY) $(1).unsigned $(PRODUCT_VBOOT_SIGNING_KEY).vbpubk $(PRODUCT_VBOOT_SIGNING_KEY).vbprivk $(PRODUCT_VBOOT_SIGNING_SUBKEY).vbprivk $(1).keyblock $(1)) |
Bowgo Tsai | 03b9c8e | 2017-11-17 15:22:37 +0800 | [diff] [blame] | 2104 | $(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)), \ |
| 2105 | $(hide) $(call assert-max-image-size,$(1),$(call get-hash-image-max-size,$(BOARD_BOOTIMAGE_PARTITION_SIZE))), \ |
| 2106 | $(hide) $(call assert-max-image-size,$(1),$(call get-hash-image-max-size,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE)))) |
David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 2107 | $(if $(filter true,$(BOARD_AVB_ENABLE)), \ |
| 2108 | $(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)), \ |
| 2109 | $(hide) $(AVBTOOL) add_hash_footer --image $(1) --partition_size $(BOARD_BOOTIMAGE_PARTITION_SIZE) --partition_name boot $(INTERNAL_AVB_BOOT_SIGNING_ARGS) $(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS),\ |
| 2110 | $(hide) $(AVBTOOL) add_hash_footer --image $(1) --partition_size $(BOARD_RECOVERYIMAGE_PARTITION_SIZE) --partition_name recovery $(INTERNAL_AVB_RECOVERY_SIGNING_ARGS) $(BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS))) |
Ying Wang | 747b9f1 | 2015-01-30 14:05:22 -0800 | [diff] [blame] | 2111 | endef |
| 2112 | |
Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 2113 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 2114 | ifeq (true,$(PRODUCT_SUPPORTS_BOOT_SIGNER)) |
Ying Wang | bd07ad0 | 2016-03-10 12:57:33 -0800 | [diff] [blame] | 2115 | $(INSTALLED_BOOTIMAGE_TARGET) : $(BOOT_SIGNER) |
| 2116 | endif |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 2117 | ifeq (true,$(PRODUCT_SUPPORTS_VBOOT)) |
Ying Wang | bd07ad0 | 2016-03-10 12:57:33 -0800 | [diff] [blame] | 2118 | $(INSTALLED_BOOTIMAGE_TARGET) : $(VBOOT_SIGNER) |
| 2119 | endif |
Thierry Strudel | d7bd1f2 | 2017-05-04 13:58:04 -0700 | [diff] [blame] | 2120 | ifeq (true,$(BOARD_AVB_ENABLE)) |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2121 | $(INSTALLED_BOOTIMAGE_TARGET) : $(AVBTOOL) $(BOARD_AVB_BOOT_KEY_PATH) |
Thierry Strudel | d7bd1f2 | 2017-05-04 13:58:04 -0700 | [diff] [blame] | 2122 | endif |
Tao Bao | f4866c7 | 2018-08-22 14:35:09 -0700 | [diff] [blame] | 2123 | ifdef BOARD_INCLUDE_RECOVERY_DTBO |
Hridya Valsaraju | a941899 | 2019-02-04 10:35:25 -0800 | [diff] [blame] | 2124 | ifdef BOARD_PREBUILT_RECOVERY_DTBOIMAGE |
| 2125 | $(INSTALLED_BOOTIMAGE_TARGET): $(BOARD_PREBUILT_RECOVERY_DTBOIMAGE) |
| 2126 | else |
Tao Bao | f4866c7 | 2018-08-22 14:35:09 -0700 | [diff] [blame] | 2127 | $(INSTALLED_BOOTIMAGE_TARGET): $(BOARD_PREBUILT_DTBOIMAGE) |
| 2128 | endif |
Hridya Valsaraju | a941899 | 2019-02-04 10:35:25 -0800 | [diff] [blame] | 2129 | endif |
Chen, ZhiminX | 752439b | 2018-09-23 22:10:47 +0800 | [diff] [blame] | 2130 | ifdef BOARD_INCLUDE_RECOVERY_ACPIO |
| 2131 | $(INSTALLED_BOOTIMAGE_TARGET): $(BOARD_RECOVERY_ACPIO) |
| 2132 | endif |
Hridya Valsaraju | 9683b2f | 2019-01-22 18:08:59 -0800 | [diff] [blame] | 2133 | ifdef BOARD_INCLUDE_DTB_IN_BOOTIMG |
| 2134 | $(INSTALLED_BOOTIMAGE_TARGET): $(INSTALLED_DTBIMAGE_TARGET) |
| 2135 | endif |
Tao Bao | f4866c7 | 2018-08-22 14:35:09 -0700 | [diff] [blame] | 2136 | |
Jiyong Park | ce3e34f | 2018-05-24 14:24:50 +0900 | [diff] [blame] | 2137 | $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 2138 | $(INTERNAL_ROOT_FILES) \ |
| 2139 | $(INSTALLED_RAMDISK_TARGET) \ |
| 2140 | $(INTERNAL_RECOVERYIMAGE_FILES) \ |
Tom Cherry | 89eea96 | 2019-11-04 10:41:51 -0800 | [diff] [blame] | 2141 | $(recovery_sepolicy) $(recovery_kernel) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 2142 | $(INSTALLED_2NDBOOTLOADER_TARGET) \ |
| 2143 | $(INSTALLED_RECOVERY_BUILD_PROP_TARGET) \ |
| 2144 | $(recovery_resource_deps) \ |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 2145 | $(recovery_fstab) |
Tao Bao | f4866c7 | 2018-08-22 14:35:09 -0700 | [diff] [blame] | 2146 | $(call pretty,"Target boot image from recovery: $@") |
| 2147 | $(call build-recoveryimage-target, $@) |
Daniel Mentz | 4d6017d | 2019-12-19 20:48:43 -0800 | [diff] [blame] | 2148 | $(INSTALLED_BOOTIMAGE_TARGET): .KATI_IMPLICIT_OUTPUTS += $(recovery_ramdisk) |
Tao Bao | f4866c7 | 2018-08-22 14:35:09 -0700 | [diff] [blame] | 2149 | endif # BOARD_USES_RECOVERY_AS_BOOT |
| 2150 | |
| 2151 | ifdef BOARD_INCLUDE_RECOVERY_DTBO |
Hridya Valsaraju | a941899 | 2019-02-04 10:35:25 -0800 | [diff] [blame] | 2152 | ifdef BOARD_PREBUILT_RECOVERY_DTBOIMAGE |
| 2153 | $(INSTALLED_RECOVERYIMAGE_TARGET): $(BOARD_PREBUILT_RECOVERY_DTBOIMAGE) |
| 2154 | else |
Tao Bao | f4866c7 | 2018-08-22 14:35:09 -0700 | [diff] [blame] | 2155 | $(INSTALLED_RECOVERYIMAGE_TARGET): $(BOARD_PREBUILT_DTBOIMAGE) |
Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 2156 | endif |
Hridya Valsaraju | a941899 | 2019-02-04 10:35:25 -0800 | [diff] [blame] | 2157 | endif |
Chen, ZhiminX | 752439b | 2018-09-23 22:10:47 +0800 | [diff] [blame] | 2158 | ifdef BOARD_INCLUDE_RECOVERY_ACPIO |
| 2159 | $(INSTALLED_RECOVERYIMAGE_TARGET): $(BOARD_RECOVERY_ACPIO) |
| 2160 | endif |
Hridya Valsaraju | 9683b2f | 2019-01-22 18:08:59 -0800 | [diff] [blame] | 2161 | ifdef BOARD_INCLUDE_DTB_IN_BOOTIMG |
| 2162 | $(INSTALLED_RECOVERYIMAGE_TARGET): $(INSTALLED_DTBIMAGE_TARGET) |
| 2163 | endif |
Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 2164 | |
Jiyong Park | ce3e34f | 2018-05-24 14:24:50 +0900 | [diff] [blame] | 2165 | $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 2166 | $(INTERNAL_ROOT_FILES) \ |
| 2167 | $(INSTALLED_RAMDISK_TARGET) \ |
| 2168 | $(INSTALLED_BOOTIMAGE_TARGET) \ |
| 2169 | $(INTERNAL_RECOVERYIMAGE_FILES) \ |
Tom Cherry | 89eea96 | 2019-11-04 10:41:51 -0800 | [diff] [blame] | 2170 | $(recovery_sepolicy) $(recovery_kernel) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 2171 | $(INSTALLED_2NDBOOTLOADER_TARGET) \ |
| 2172 | $(INSTALLED_RECOVERY_BUILD_PROP_TARGET) \ |
| 2173 | $(recovery_resource_deps) \ |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 2174 | $(recovery_fstab) |
Tao Bao | f4866c7 | 2018-08-22 14:35:09 -0700 | [diff] [blame] | 2175 | $(call build-recoveryimage-target, $@) |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 2176 | |
Tao Bao | 4594d0e | 2015-12-22 09:47:46 -0800 | [diff] [blame] | 2177 | ifdef RECOVERY_RESOURCE_ZIP |
Dan Willemsen | 48a621c | 2015-10-29 16:33:05 -0700 | [diff] [blame] | 2178 | $(RECOVERY_RESOURCE_ZIP): $(INSTALLED_RECOVERYIMAGE_TARGET) | $(ZIPTIME) |
Doug Zongker | 1a09726 | 2012-09-04 14:45:11 -0700 | [diff] [blame] | 2179 | $(hide) mkdir -p $(dir $@) |
Dan Willemsen | 48a621c | 2015-10-29 16:33:05 -0700 | [diff] [blame] | 2180 | $(hide) find $(TARGET_RECOVERY_ROOT_OUT)/res -type f | sort | zip -0qrjX $@ -@ |
| 2181 | $(remove-timestamps-from-package) |
Tao Bao | 8beab69 | 2015-07-22 12:33:18 -0700 | [diff] [blame] | 2182 | endif |
Doug Zongker | 5658887 | 2012-08-20 15:38:58 -0700 | [diff] [blame] | 2183 | |
Ying Wang | 747b9f1 | 2015-01-30 14:05:22 -0800 | [diff] [blame] | 2184 | .PHONY: recoveryimage-nodeps |
| 2185 | recoveryimage-nodeps: |
| 2186 | @echo "make $@: ignoring dependencies" |
| 2187 | $(call build-recoveryimage-target, $(INSTALLED_RECOVERYIMAGE_TARGET)) |
| 2188 | |
Chris Gross | a784ef1 | 2019-04-22 11:09:57 -0700 | [diff] [blame] | 2189 | else # BUILDING_RECOVERY_IMAGE |
Doug Zongker | 5658887 | 2012-08-20 15:38:58 -0700 | [diff] [blame] | 2190 | RECOVERY_RESOURCE_ZIP := |
Chris Gross | a784ef1 | 2019-04-22 11:09:57 -0700 | [diff] [blame] | 2191 | endif # BUILDING_RECOVERY_IMAGE |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 2192 | |
| 2193 | .PHONY: recoveryimage |
Doug Zongker | 5658887 | 2012-08-20 15:38:58 -0700 | [diff] [blame] | 2194 | recoveryimage: $(INSTALLED_RECOVERYIMAGE_TARGET) $(RECOVERY_RESOURCE_ZIP) |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 2195 | |
Jiyong Park | 03eb061 | 2017-10-04 21:22:41 +0900 | [diff] [blame] | 2196 | ifneq ($(BOARD_NAND_PAGE_SIZE),) |
| 2197 | $(error MTD device is no longer supported and thus BOARD_NAND_PAGE_SIZE is deprecated.) |
Dima Zavin | 1181898 | 2010-02-05 13:34:34 -0800 | [diff] [blame] | 2198 | endif |
| 2199 | |
Jiyong Park | 03eb061 | 2017-10-04 21:22:41 +0900 | [diff] [blame] | 2200 | ifneq ($(BOARD_NAND_SPARE_SIZE),) |
| 2201 | $(error MTD device is no longer supported and thus BOARD_NAND_SPARE_SIZE is deprecated.) |
Naseer Ahmed | 5387188 | 2010-08-06 12:19:29 -0700 | [diff] [blame] | 2202 | endif |
| 2203 | |
Bowgo Tsai | 5c40c71 | 2019-10-08 10:22:19 +0800 | [diff] [blame] | 2204 | ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 2205 | # ----------------------------------------------------------------- |
Bowgo Tsai | 0013f55 | 2019-03-20 17:59:52 +0800 | [diff] [blame] | 2206 | # the debug ramdisk, which is the original ramdisk plus additional |
| 2207 | # files: force_debuggable, adb_debug.prop and userdebug sepolicy. |
| 2208 | # When /force_debuggable is present, /init will load userdebug sepolicy |
| 2209 | # and property files to allow adb root, if the device is unlocked. |
| 2210 | |
| 2211 | ifdef BUILDING_RAMDISK_IMAGE |
| 2212 | BUILT_DEBUG_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk-debug.img |
| 2213 | INSTALLED_DEBUG_RAMDISK_TARGET := $(BUILT_DEBUG_RAMDISK_TARGET) |
| 2214 | |
| 2215 | INTERNAL_DEBUG_RAMDISK_FILES := $(filter $(TARGET_DEBUG_RAMDISK_OUT)/%, \ |
| 2216 | $(ALL_GENERATED_SOURCES) \ |
| 2217 | $(ALL_DEFAULT_INSTALLED_MODULES)) |
| 2218 | |
| 2219 | # Note: TARGET_DEBUG_RAMDISK_OUT will be $(PRODUCT_OUT)/debug_ramdisk/first_stage_ramdisk, |
| 2220 | # if BOARD_USES_RECOVERY_AS_BOOT is true. Otherwise, it will be $(PRODUCT_OUT)/debug_ramdisk. |
| 2221 | # But the root dir of the ramdisk to build is always $(PRODUCT_OUT)/debug_ramdisk. |
| 2222 | my_debug_ramdisk_root_dir := $(PRODUCT_OUT)/debug_ramdisk |
| 2223 | |
| 2224 | INSTALLED_FILES_FILE_DEBUG_RAMDISK := $(PRODUCT_OUT)/installed-files-ramdisk-debug.txt |
| 2225 | INSTALLED_FILES_JSON_DEBUG_RAMDISK := $(INSTALLED_FILES_FILE_DEBUG_RAMDISK:.txt=.json) |
| 2226 | $(INSTALLED_FILES_FILE_DEBUG_RAMDISK): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_DEBUG_RAMDISK) |
| 2227 | $(INSTALLED_FILES_FILE_DEBUG_RAMDISK): DEBUG_RAMDISK_ROOT_DIR := $(my_debug_ramdisk_root_dir) |
| 2228 | |
| 2229 | # Cannot just depend on INTERNAL_DEBUG_RAMDISK_FILES like other INSTALLED_FILES_FILE_* rules. |
| 2230 | # Because ramdisk-debug.img will rsync from either ramdisk.img or ramdisk-recovery.img. |
| 2231 | # Need to depend on the built ramdisk-debug.img, to get a complete list of the installed files. |
| 2232 | $(INSTALLED_FILES_FILE_DEBUG_RAMDISK) : $(INSTALLED_DEBUG_RAMDISK_TARGET) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 2233 | $(INSTALLED_FILES_FILE_DEBUG_RAMDISK) : $(INTERNAL_DEBUG_RAMDISK_FILES) $(FILESLIST) $(FILESLIST_UTIL) |
Bowgo Tsai | 0013f55 | 2019-03-20 17:59:52 +0800 | [diff] [blame] | 2234 | echo Installed file list: $@ |
| 2235 | mkdir -p $(dir $@) |
| 2236 | rm -f $@ |
| 2237 | $(FILESLIST) $(DEBUG_RAMDISK_ROOT_DIR) > $(@:.txt=.json) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 2238 | $(FILESLIST_UTIL) -c $(@:.txt=.json) > $@ |
Bowgo Tsai | 0013f55 | 2019-03-20 17:59:52 +0800 | [diff] [blame] | 2239 | |
| 2240 | # ramdisk-debug.img will rsync the content from either ramdisk.img or ramdisk-recovery.img, |
| 2241 | # depending on whether BOARD_USES_RECOVERY_AS_BOOT is set or not. |
| 2242 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) |
| 2243 | my_debug_ramdisk_sync_dir := $(TARGET_RECOVERY_ROOT_OUT) |
| 2244 | else |
| 2245 | my_debug_ramdisk_sync_dir := $(TARGET_RAMDISK_OUT) |
| 2246 | endif # BOARD_USES_RECOVERY_AS_BOOT |
| 2247 | |
| 2248 | $(INSTALLED_DEBUG_RAMDISK_TARGET): DEBUG_RAMDISK_SYNC_DIR := $(my_debug_ramdisk_sync_dir) |
| 2249 | $(INSTALLED_DEBUG_RAMDISK_TARGET): DEBUG_RAMDISK_ROOT_DIR := $(my_debug_ramdisk_root_dir) |
Bowgo Tsai | c3e8cc9 | 2019-04-24 12:35:50 +0800 | [diff] [blame] | 2250 | |
| 2251 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) |
| 2252 | # ramdisk-recovery.img isn't a make target, need to depend on boot.img if it's for recovery. |
Bowgo Tsai | 0013f55 | 2019-03-20 17:59:52 +0800 | [diff] [blame] | 2253 | $(INSTALLED_DEBUG_RAMDISK_TARGET): $(INSTALLED_BOOTIMAGE_TARGET) |
Bowgo Tsai | c3e8cc9 | 2019-04-24 12:35:50 +0800 | [diff] [blame] | 2254 | else |
| 2255 | # Depends on ramdisk.img, note that some target has ramdisk.img but no boot.img, e.g., emulator. |
| 2256 | $(INSTALLED_DEBUG_RAMDISK_TARGET): $(INSTALLED_RAMDISK_TARGET) |
| 2257 | endif # BOARD_USES_RECOVERY_AS_BOOT |
Bowgo Tsai | 0013f55 | 2019-03-20 17:59:52 +0800 | [diff] [blame] | 2258 | $(INSTALLED_DEBUG_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_DEBUG_RAMDISK_FILES) | $(MINIGZIP) |
| 2259 | $(call pretty,"Target debug ram disk: $@") |
| 2260 | mkdir -p $(TARGET_DEBUG_RAMDISK_OUT) |
| 2261 | touch $(TARGET_DEBUG_RAMDISK_OUT)/force_debuggable |
Bowgo Tsai | 1578e23 | 2019-04-24 15:33:03 +0800 | [diff] [blame] | 2262 | rsync -a $(DEBUG_RAMDISK_SYNC_DIR)/ $(DEBUG_RAMDISK_ROOT_DIR) |
Bowgo Tsai | 0013f55 | 2019-03-20 17:59:52 +0800 | [diff] [blame] | 2263 | $(MKBOOTFS) -d $(TARGET_OUT) $(DEBUG_RAMDISK_ROOT_DIR) | $(MINIGZIP) > $@ |
| 2264 | |
| 2265 | .PHONY: ramdisk_debug-nodeps |
| 2266 | ramdisk_debug-nodeps: DEBUG_RAMDISK_SYNC_DIR := $(my_debug_ramdisk_sync_dir) |
| 2267 | ramdisk_debug-nodeps: DEBUG_RAMDISK_ROOT_DIR := $(my_debug_ramdisk_root_dir) |
| 2268 | ramdisk_debug-nodeps: $(MKBOOTFS) | $(MINIGZIP) |
| 2269 | echo "make $@: ignoring dependencies" |
| 2270 | mkdir -p $(TARGET_DEBUG_RAMDISK_OUT) |
| 2271 | touch $(TARGET_DEBUG_RAMDISK_OUT)/force_debuggable |
Bowgo Tsai | 1578e23 | 2019-04-24 15:33:03 +0800 | [diff] [blame] | 2272 | rsync -a $(DEBUG_RAMDISK_SYNC_DIR)/ $(DEBUG_RAMDISK_ROOT_DIR) |
Bowgo Tsai | 0013f55 | 2019-03-20 17:59:52 +0800 | [diff] [blame] | 2273 | $(MKBOOTFS) -d $(TARGET_OUT) $(DEBUG_RAMDISK_ROOT_DIR) | $(MINIGZIP) > $(INSTALLED_DEBUG_RAMDISK_TARGET) |
| 2274 | |
| 2275 | my_debug_ramdisk_sync_dir := |
| 2276 | my_debug_ramdisk_root_dir := |
| 2277 | |
| 2278 | endif # BUILDING_RAMDISK_IMAGE |
| 2279 | |
| 2280 | # ----------------------------------------------------------------- |
| 2281 | # the boot-debug.img, which is the kernel plus ramdisk-debug.img |
| 2282 | # |
| 2283 | # Note: it's intentional to skip signing for boot-debug.img, because it |
| 2284 | # can only be used if the device is unlocked with verification error. |
| 2285 | ifneq ($(strip $(TARGET_NO_KERNEL)),true) |
| 2286 | |
| 2287 | INSTALLED_DEBUG_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot-debug.img |
| 2288 | |
| 2289 | # Replace ramdisk.img in $(MKBOOTIMG) ARGS with ramdisk-debug.img to build boot-debug.img |
| 2290 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) |
| 2291 | INTERNAL_DEBUG_BOOTIMAGE_ARGS := $(subst $(recovery_ramdisk),$(INSTALLED_DEBUG_RAMDISK_TARGET), $(INTERNAL_RECOVERYIMAGE_ARGS)) |
| 2292 | else |
| 2293 | INTERNAL_DEBUG_BOOTIMAGE_ARGS := $(subst $(INSTALLED_RAMDISK_TARGET),$(INSTALLED_DEBUG_RAMDISK_TARGET), $(INTERNAL_BOOTIMAGE_ARGS)) |
| 2294 | endif |
| 2295 | |
Bowgo Tsai | 26b0a26 | 2019-05-03 16:38:34 +0800 | [diff] [blame] | 2296 | # If boot.img is chained but boot-debug.img is not signed, libavb in bootloader |
| 2297 | # will fail to find valid AVB metadata from the end of /boot, thus stop booting. |
| 2298 | # Using a test key to sign boot-debug.img to continue booting with the mismatched |
| 2299 | # public key, if the device is unlocked. |
| 2300 | ifneq ($(BOARD_AVB_BOOT_KEY_PATH),) |
Bowgo Tsai | 5c40c71 | 2019-10-08 10:22:19 +0800 | [diff] [blame] | 2301 | $(INSTALLED_DEBUG_BOOTIMAGE_TARGET): $(AVBTOOL) $(BOARD_AVB_BOOT_TEST_KEY_PATH) |
Bowgo Tsai | 26b0a26 | 2019-05-03 16:38:34 +0800 | [diff] [blame] | 2302 | endif |
| 2303 | |
Bowgo Tsai | 5c40c71 | 2019-10-08 10:22:19 +0800 | [diff] [blame] | 2304 | BOARD_AVB_BOOT_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem |
| 2305 | INTERNAL_AVB_BOOT_TEST_SIGNING_ARGS := --algorithm SHA256_RSA2048 --key $(BOARD_AVB_BOOT_TEST_KEY_PATH) |
| 2306 | # $(1): the bootimage to sign |
| 2307 | define test-key-sign-bootimage |
| 2308 | $(call assert-max-image-size,$(1),$(call get-hash-image-max-size,$(BOARD_BOOTIMAGE_PARTITION_SIZE))) |
| 2309 | $(AVBTOOL) add_hash_footer \ |
| 2310 | --image $(1) \ |
| 2311 | --partition_size $(BOARD_BOOTIMAGE_PARTITION_SIZE) \ |
| 2312 | --partition_name boot $(INTERNAL_AVB_BOOT_TEST_SIGNING_ARGS) \ |
| 2313 | $(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS) |
| 2314 | $(call assert-max-image-size,$(1),$(BOARD_BOOTIMAGE_PARTITION_SIZE)) |
| 2315 | endef |
| 2316 | |
Bowgo Tsai | 0013f55 | 2019-03-20 17:59:52 +0800 | [diff] [blame] | 2317 | # Depends on original boot.img and ramdisk-debug.img, to build the new boot-debug.img |
| 2318 | $(INSTALLED_DEBUG_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_DEBUG_RAMDISK_TARGET) |
| 2319 | $(call pretty,"Target boot debug image: $@") |
| 2320 | $(MKBOOTIMG) $(INTERNAL_DEBUG_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ |
Bowgo Tsai | 5c40c71 | 2019-10-08 10:22:19 +0800 | [diff] [blame] | 2321 | $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$@)) |
Bowgo Tsai | 0013f55 | 2019-03-20 17:59:52 +0800 | [diff] [blame] | 2322 | |
| 2323 | .PHONY: bootimage_debug-nodeps |
| 2324 | bootimage_debug-nodeps: $(MKBOOTIMG) |
| 2325 | echo "make $@: ignoring dependencies" |
| 2326 | $(MKBOOTIMG) $(INTERNAL_DEBUG_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(INSTALLED_DEBUG_BOOTIMAGE_TARGET) |
Bowgo Tsai | 5c40c71 | 2019-10-08 10:22:19 +0800 | [diff] [blame] | 2327 | $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$(INSTALLED_DEBUG_BOOTIMAGE_TARGET))) |
Bowgo Tsai | 0013f55 | 2019-03-20 17:59:52 +0800 | [diff] [blame] | 2328 | |
| 2329 | endif # TARGET_NO_KERNEL |
| 2330 | |
| 2331 | # ----------------------------------------------------------------- |
Bowgo Tsai | 5c40c71 | 2019-10-08 10:22:19 +0800 | [diff] [blame] | 2332 | # The test harness ramdisk, which is based off debug_ramdisk, plus a |
| 2333 | # few additional test-harness-specific properties in adb_debug.prop. |
| 2334 | |
| 2335 | ifdef BUILDING_RAMDISK_IMAGE |
| 2336 | BUILT_TEST_HARNESS_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk-test-harness.img |
| 2337 | INSTALLED_TEST_HARNESS_RAMDISK_TARGET := $(BUILT_TEST_HARNESS_RAMDISK_TARGET) |
| 2338 | |
| 2339 | # rsync the content from ramdisk-debug.img to ramdisk-test-harness.img, then |
| 2340 | # appends a few test harness specific properties into the adb_debug.prop. |
| 2341 | TEST_HARNESS_RAMDISK_SYNC_DIR := $(PRODUCT_OUT)/debug_ramdisk |
| 2342 | TEST_HARNESS_RAMDISK_ROOT_DIR := $(PRODUCT_OUT)/test_harness_ramdisk |
| 2343 | |
| 2344 | # The following TARGET_TEST_HARNESS_RAMDISK_OUT will be $(PRODUCT_OUT)/test_harness_ramdisk/first_stage_ramdisk, |
| 2345 | # if BOARD_USES_RECOVERY_AS_BOOT is true. Otherwise, it will be $(PRODUCT_OUT)/test_harness_ramdisk. |
| 2346 | TEST_HARNESS_PROP_TARGET := $(TARGET_TEST_HARNESS_RAMDISK_OUT)/adb_debug.prop |
| 2347 | ADDITIONAL_TEST_HARNESS_PROPERTIES := ro.audio.silent=1 |
| 2348 | ADDITIONAL_TEST_HARNESS_PROPERTIES += ro.test_harness=1 |
| 2349 | |
| 2350 | # $(1): a list of key=value pairs for additional property assignments |
| 2351 | # $(2): the target .prop file to append the properties from $(1) |
| 2352 | define append-test-harness-props |
| 2353 | echo "#" >> $(2); \ |
| 2354 | echo "# ADDITIONAL TEST HARNESS_PROPERTIES" >> $(2); \ |
| 2355 | echo "#" >> $(2); |
| 2356 | $(foreach line,$(1), echo "$(line)" >> $(2);) |
| 2357 | endef |
| 2358 | |
| 2359 | $(INSTALLED_TEST_HARNESS_RAMDISK_TARGET): $(INSTALLED_DEBUG_RAMDISK_TARGET) |
| 2360 | $(INSTALLED_TEST_HARNESS_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_TEST_HARNESS_RAMDISK_FILES) | $(MINIGZIP) |
| 2361 | $(call pretty,"Target test harness ram disk: $@") |
| 2362 | rsync -a $(TEST_HARNESS_RAMDISK_SYNC_DIR)/ $(TEST_HARNESS_RAMDISK_ROOT_DIR) |
| 2363 | $(call append-test-harness-props,$(ADDITIONAL_TEST_HARNESS_PROPERTIES),$(TEST_HARNESS_PROP_TARGET)) |
| 2364 | $(MKBOOTFS) -d $(TARGET_OUT) $(TEST_HARNESS_RAMDISK_ROOT_DIR) | $(MINIGZIP) > $@ |
| 2365 | |
| 2366 | .PHONY: ramdisk_test_harness-nodeps |
| 2367 | ramdisk_test_harness-nodeps: $(MKBOOTFS) | $(MINIGZIP) |
| 2368 | echo "make $@: ignoring dependencies" |
| 2369 | rsync -a $(TEST_HARNESS_RAMDISK_SYNC_DIR)/ $(TEST_HARNESS_RAMDISK_ROOT_DIR) |
| 2370 | $(call append-test-harness-props,$(ADDITIONAL_TEST_HARNESS_PROPERTIES),$(TEST_HARNESS_PROP_TARGET)) |
| 2371 | $(MKBOOTFS) -d $(TARGET_OUT) $(TEST_HARNESS_RAMDISK_ROOT_DIR) | $(MINIGZIP) > $(INSTALLED_TEST_HARNESS_RAMDISK_TARGET) |
| 2372 | |
| 2373 | endif # BUILDING_RAMDISK_IMAGE |
| 2374 | |
| 2375 | # ----------------------------------------------------------------- |
| 2376 | # the boot-test-harness.img, which is the kernel plus ramdisk-test-harness.img |
| 2377 | # |
| 2378 | # Note: it's intentional to skip signing for boot-test-harness.img, because it |
| 2379 | # can only be used if the device is unlocked with verification error. |
| 2380 | ifneq ($(strip $(TARGET_NO_KERNEL)),true) |
| 2381 | |
| 2382 | INSTALLED_TEST_HARNESS_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot-test-harness.img |
| 2383 | |
| 2384 | # Replace ramdisk-debug.img in $(MKBOOTIMG) ARGS with ramdisk-test-harness.img to build boot-test-harness.img |
| 2385 | INTERNAL_TEST_HARNESS_BOOTIMAGE_ARGS := $(subst $(INSTALLED_DEBUG_RAMDISK_TARGET),$(INSTALLED_TEST_HARNESS_RAMDISK_TARGET),$(INTERNAL_DEBUG_BOOTIMAGE_ARGS)) |
| 2386 | |
| 2387 | # If boot.img is chained but boot-test-harness.img is not signed, libavb in bootloader |
| 2388 | # will fail to find valid AVB metadata from the end of /boot, thus stop booting. |
| 2389 | # Using a test key to sign boot-test-harness.img to continue booting with the mismatched |
| 2390 | # public key, if the device is unlocked. |
| 2391 | ifneq ($(BOARD_AVB_BOOT_KEY_PATH),) |
| 2392 | $(INSTALLED_TEST_HARNESS_BOOTIMAGE_TARGET): $(AVBTOOL) $(BOARD_AVB_BOOT_TEST_KEY_PATH) |
| 2393 | endif |
| 2394 | |
| 2395 | # Build the new boot-test-harness.img, based on boot-debug.img and ramdisk-test-harness.img. |
| 2396 | $(INSTALLED_TEST_HARNESS_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INSTALLED_DEBUG_BOOTIMAGE_TARGET) $(INSTALLED_TEST_HARNESS_RAMDISK_TARGET) |
| 2397 | $(call pretty,"Target boot test harness image: $@") |
| 2398 | $(MKBOOTIMG) $(INTERNAL_TEST_HARNESS_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ |
| 2399 | $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$@)) |
| 2400 | |
| 2401 | .PHONY: bootimage_test_harness-nodeps |
| 2402 | bootimage_test_harness-nodeps: $(MKBOOTIMG) |
| 2403 | echo "make $@: ignoring dependencies" |
| 2404 | $(MKBOOTIMG) $(INTERNAL_TEST_HARNESS_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(INSTALLED_TEST_HARNESS_BOOTIMAGE_TARGET) |
| 2405 | $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$(INSTALLED_TEST_HARNESS_BOOTIMAGE_TARGET))) |
| 2406 | |
| 2407 | endif # TARGET_NO_KERNEL |
| 2408 | endif # BOARD_BUILD_SYSTEM_ROOT_IMAGE is not true |
| 2409 | |
| 2410 | # ----------------------------------------------------------------- |
Ying Wang | 0235237 | 2010-09-27 10:37:25 -0700 | [diff] [blame] | 2411 | # system image |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2412 | # |
Ying Wang | 9c649a7 | 2012-08-08 15:27:00 -0700 | [diff] [blame] | 2413 | # Remove overridden packages from $(ALL_PDK_FUSION_FILES) |
| 2414 | PDK_FUSION_SYSIMG_FILES := \ |
| 2415 | $(filter-out $(foreach p,$(overridden_packages),$(p) %/$(p).apk), \ |
| 2416 | $(ALL_PDK_FUSION_FILES)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2417 | |
Dan Willemsen | 37a1986 | 2018-10-31 16:31:46 -0700 | [diff] [blame] | 2418 | INTERNAL_SYSTEMIMAGE_FILES := $(sort $(filter $(TARGET_OUT)/%, \ |
Ying Wang | 160b670 | 2012-03-13 18:58:27 -0700 | [diff] [blame] | 2419 | $(ALL_GENERATED_SOURCES) \ |
Doug Zongker | 5658887 | 2012-08-20 15:38:58 -0700 | [diff] [blame] | 2420 | $(ALL_DEFAULT_INSTALLED_MODULES) \ |
Bill Peckham | e868aec | 2019-09-17 17:06:47 -0700 | [diff] [blame] | 2421 | $(PDK_FUSION_SYSIMG_FILES)) \ |
Dan Willemsen | 37a1986 | 2018-10-31 16:31:46 -0700 | [diff] [blame] | 2422 | $(PDK_FUSION_SYMLINK_STAMP)) |
Ying Wang | 160b670 | 2012-03-13 18:58:27 -0700 | [diff] [blame] | 2423 | |
Ying Wang | 82cceba | 2012-08-13 15:03:00 -0700 | [diff] [blame] | 2424 | FULL_SYSTEMIMAGE_DEPS := $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_USERIMAGES_DEPS) |
Andreas Gampe | 039b5c7 | 2017-03-24 16:06:31 -0700 | [diff] [blame] | 2425 | |
| 2426 | # ASAN libraries in the system image - add dependency. |
| 2427 | ASAN_IN_SYSTEM_INSTALLED := $(TARGET_OUT)/asan.tar.bz2 |
Evgenii Stepanov | 8841a7f | 2018-07-27 11:54:32 -0700 | [diff] [blame] | 2428 | ifneq (,$(filter address, $(SANITIZE_TARGET))) |
Andreas Gampe | 039b5c7 | 2017-03-24 16:06:31 -0700 | [diff] [blame] | 2429 | ifeq (true,$(SANITIZE_TARGET_SYSTEM)) |
| 2430 | FULL_SYSTEMIMAGE_DEPS += $(ASAN_IN_SYSTEM_INSTALLED) |
| 2431 | endif |
| 2432 | endif |
| 2433 | |
Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 2434 | FULL_SYSTEMIMAGE_DEPS += $(INTERNAL_ROOT_FILES) $(INSTALLED_FILES_FILE_ROOT) |
Luis Hector Chavez | ff48993 | 2018-07-03 15:41:40 -0700 | [diff] [blame] | 2435 | |
Ying Wang | e5e8c5f | 2011-09-09 16:35:53 -0700 | [diff] [blame] | 2436 | # ----------------------------------------------------------------- |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 2437 | ifdef BUILDING_SYSTEM_IMAGE |
| 2438 | |
Ying Wang | e5e8c5f | 2011-09-09 16:35:53 -0700 | [diff] [blame] | 2439 | # installed file list |
| 2440 | # Depending on anything that $(BUILT_SYSTEMIMAGE) depends on. |
| 2441 | # We put installed-files.txt ahead of image itself in the dependency graph |
| 2442 | # so that we can get the size stat even if the build fails due to too large |
| 2443 | # system image. |
| 2444 | INSTALLED_FILES_FILE := $(PRODUCT_OUT)/installed-files.txt |
Colin Cross | 23dded0 | 2018-06-13 14:04:22 -0700 | [diff] [blame] | 2445 | INSTALLED_FILES_JSON := $(INSTALLED_FILES_FILE:.txt=.json) |
| 2446 | $(INSTALLED_FILES_FILE): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 2447 | $(INSTALLED_FILES_FILE): $(FULL_SYSTEMIMAGE_DEPS) $(FILESLIST) $(FILESLIST_UTIL) |
Ying Wang | e5e8c5f | 2011-09-09 16:35:53 -0700 | [diff] [blame] | 2448 | @echo Installed file list: $@ |
| 2449 | @mkdir -p $(dir $@) |
| 2450 | @rm -f $@ |
Makoto Onuki | 9fe97e2 | 2017-03-16 09:41:19 -0700 | [diff] [blame] | 2451 | $(hide) $(FILESLIST) $(TARGET_OUT) > $(@:.txt=.json) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 2452 | $(hide) $(FILESLIST_UTIL) -c $(@:.txt=.json) > $@ |
Ying Wang | e5e8c5f | 2011-09-09 16:35:53 -0700 | [diff] [blame] | 2453 | |
| 2454 | .PHONY: installed-file-list |
| 2455 | installed-file-list: $(INSTALLED_FILES_FILE) |
Ying Wang | 534fcd7 | 2013-03-01 16:45:35 -0800 | [diff] [blame] | 2456 | |
| 2457 | $(call dist-for-goals, sdk win_sdk sdk_addon, $(INSTALLED_FILES_FILE)) |
Ying Wang | e5e8c5f | 2011-09-09 16:35:53 -0700 | [diff] [blame] | 2458 | |
| 2459 | systemimage_intermediates := \ |
Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2460 | $(call intermediates-dir-for,PACKAGING,systemimage) |
Ying Wang | e5e8c5f | 2011-09-09 16:35:53 -0700 | [diff] [blame] | 2461 | BUILT_SYSTEMIMAGE := $(systemimage_intermediates)/system.img |
| 2462 | |
Ying Wang | 23898df | 2014-06-18 20:26:24 -0700 | [diff] [blame] | 2463 | # Create symlink /system/vendor to /vendor if necessary. |
Dan Willemsen | 6c3e79b | 2016-06-17 14:07:37 -0700 | [diff] [blame] | 2464 | ifdef BOARD_USES_VENDORIMAGE |
Ying Wang | 23898df | 2014-06-18 20:26:24 -0700 | [diff] [blame] | 2465 | define create-system-vendor-symlink |
Ying Wang | 3e72ed1 | 2014-07-17 12:56:49 -0700 | [diff] [blame] | 2466 | $(hide) if [ -d $(TARGET_OUT)/vendor ] && [ ! -h $(TARGET_OUT)/vendor ]; then \ |
| 2467 | echo 'Non-symlink $(TARGET_OUT)/vendor detected!' 1>&2; \ |
| 2468 | echo 'You cannot install files to $(TARGET_OUT)/vendor while building a separate vendor.img!' 1>&2; \ |
| 2469 | exit 1; \ |
| 2470 | fi |
Ying Wang | 23898df | 2014-06-18 20:26:24 -0700 | [diff] [blame] | 2471 | $(hide) ln -sf /vendor $(TARGET_OUT)/vendor |
| 2472 | endef |
| 2473 | else |
| 2474 | define create-system-vendor-symlink |
| 2475 | endef |
| 2476 | endif |
| 2477 | |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2478 | # Create symlink /system/product to /product if necessary. |
| 2479 | ifdef BOARD_USES_PRODUCTIMAGE |
| 2480 | define create-system-product-symlink |
| 2481 | $(hide) if [ -d $(TARGET_OUT)/product ] && [ ! -h $(TARGET_OUT)/product ]; then \ |
| 2482 | echo 'Non-symlink $(TARGET_OUT)/product detected!' 1>&2; \ |
| 2483 | echo 'You cannot install files to $(TARGET_OUT)/product while building a separate product.img!' 1>&2; \ |
| 2484 | exit 1; \ |
| 2485 | fi |
| 2486 | $(hide) ln -sf /product $(TARGET_OUT)/product |
| 2487 | endef |
| 2488 | else |
| 2489 | define create-system-product-symlink |
| 2490 | endef |
| 2491 | endif |
| 2492 | |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 2493 | # Create symlink /system/system_ext to /system_ext if necessary. |
| 2494 | ifdef BOARD_USES_SYSTEM_EXTIMAGE |
| 2495 | define create-system-system_ext-symlink |
| 2496 | $(hide) if [ -d $(TARGET_OUT)/system_ext ] && [ ! -h $(TARGET_OUT)/system_ext ]; then \ |
| 2497 | echo 'Non-symlink $(TARGET_OUT)/system_ext detected!' 1>&2; \ |
| 2498 | echo 'You cannot install files to $(TARGET_OUT)/system_ext while building a separate system_ext.img!' 1>&2; \ |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2499 | exit 1; \ |
| 2500 | fi |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 2501 | $(hide) ln -sf /system_ext $(TARGET_OUT)/system_ext |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2502 | endef |
| 2503 | else |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 2504 | define create-system-system_ext-symlink |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2505 | endef |
| 2506 | endif |
| 2507 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2508 | # $(1): output file |
| 2509 | define build-systemimage-target |
Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 2510 | @echo "Target system fs image: $(1)" |
Ying Wang | 23898df | 2014-06-18 20:26:24 -0700 | [diff] [blame] | 2511 | $(call create-system-vendor-symlink) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2512 | $(call create-system-product-symlink) |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 2513 | $(call create-system-system_ext-symlink) |
Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 2514 | @mkdir -p $(dir $(1)) $(systemimage_intermediates) && rm -rf $(systemimage_intermediates)/system_image_info.txt |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 2515 | $(call generate-image-prop-dictionary, $(systemimage_intermediates)/system_image_info.txt,system, \ |
Geremy Condra | 5b5f495 | 2014-05-05 22:19:37 -0700 | [diff] [blame] | 2516 | skip_fsck=true) |
Tao Bao | cf821fc | 2019-06-24 12:39:10 -0700 | [diff] [blame] | 2517 | PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$$PATH \ |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 2518 | $(BUILD_IMAGE) \ |
| 2519 | $(TARGET_OUT) $(systemimage_intermediates)/system_image_info.txt $(1) $(TARGET_OUT) \ |
| 2520 | || ( mkdir -p $${DIST_DIR}; \ |
| 2521 | cp $(INSTALLED_FILES_FILE) $${DIST_DIR}/installed-files-rescued.txt; \ |
| 2522 | exit 1 ) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2523 | endef |
| 2524 | |
Dan Willemsen | 6b72c73 | 2019-06-12 21:33:38 +0000 | [diff] [blame] | 2525 | ifeq ($(BOARD_AVB_ENABLE),true) |
| 2526 | $(BUILT_SYSTEMIMAGE): $(BOARD_AVB_SYSTEM_KEY_PATH) |
| 2527 | endif |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 2528 | $(BUILT_SYSTEMIMAGE): $(FULL_SYSTEMIMAGE_DEPS) $(INSTALLED_FILES_FILE) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2529 | $(call build-systemimage-target,$@) |
| 2530 | |
Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2531 | INSTALLED_SYSTEMIMAGE_TARGET := $(PRODUCT_OUT)/system.img |
Ying Wang | 0235237 | 2010-09-27 10:37:25 -0700 | [diff] [blame] | 2532 | SYSTEMIMAGE_SOURCE_DIR := $(TARGET_OUT) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2533 | |
Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2534 | # INSTALLED_SYSTEMIMAGE_TARGET used to be named INSTALLED_SYSTEMIMAGE. Create an alias for backward |
| 2535 | # compatibility, in case device-specific Makefiles still refer to the old name. |
| 2536 | INSTALLED_SYSTEMIMAGE := $(INSTALLED_SYSTEMIMAGE_TARGET) |
| 2537 | |
Doug Zongker | 73ef825 | 2009-07-23 15:12:53 -0700 | [diff] [blame] | 2538 | # The system partition needs room for the recovery image as well. We |
| 2539 | # now store the recovery image as a binary patch using the boot image |
| 2540 | # as the source (since they are very similar). Generate the patch so |
| 2541 | # we can see how big it's going to be, and include that in the system |
| 2542 | # image size check calculation. |
Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 2543 | ifneq ($(INSTALLED_BOOTIMAGE_TARGET),) |
Sriram Raman | 1e96ac8 | 2009-07-24 13:52:32 -0700 | [diff] [blame] | 2544 | ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),) |
Tao Bao | 8beab69 | 2015-07-22 12:33:18 -0700 | [diff] [blame] | 2545 | ifneq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true) |
Chen, ZhiminX | 752439b | 2018-09-23 22:10:47 +0800 | [diff] [blame] | 2546 | ifneq (,$(filter true, $(BOARD_BUILD_SYSTEM_ROOT_IMAGE) $(BOARD_INCLUDE_RECOVERY_DTBO) $(BOARD_INCLUDE_RECOVERY_ACPIO))) |
Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 2547 | diff_tool := $(HOST_OUT_EXECUTABLES)/bsdiff |
| 2548 | else |
| 2549 | diff_tool := $(HOST_OUT_EXECUTABLES)/imgdiff |
| 2550 | endif |
Doug Zongker | 73ef825 | 2009-07-23 15:12:53 -0700 | [diff] [blame] | 2551 | intermediates := $(call intermediates-dir-for,PACKAGING,recovery_patch) |
| 2552 | RECOVERY_FROM_BOOT_PATCH := $(intermediates)/recovery_from_boot.p |
Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 2553 | $(RECOVERY_FROM_BOOT_PATCH): PRIVATE_DIFF_TOOL := $(diff_tool) |
| 2554 | $(RECOVERY_FROM_BOOT_PATCH): \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 2555 | $(INSTALLED_RECOVERYIMAGE_TARGET) \ |
| 2556 | $(INSTALLED_BOOTIMAGE_TARGET) \ |
| 2557 | $(diff_tool) |
Doug Zongker | 73ef825 | 2009-07-23 15:12:53 -0700 | [diff] [blame] | 2558 | @echo "Construct recovery from boot" |
| 2559 | mkdir -p $(dir $@) |
Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 2560 | $(PRIVATE_DIFF_TOOL) $(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_RECOVERYIMAGE_TARGET) $@ |
Tao Bao | 8beab69 | 2015-07-22 12:33:18 -0700 | [diff] [blame] | 2561 | else # $(BOARD_USES_FULL_RECOVERY_IMAGE) == true |
| 2562 | RECOVERY_FROM_BOOT_PATCH := $(INSTALLED_RECOVERYIMAGE_TARGET) |
Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 2563 | endif # BOARD_USES_FULL_RECOVERY_IMAGE |
| 2564 | endif # INSTALLED_RECOVERYIMAGE_TARGET |
| 2565 | endif # INSTALLED_BOOTIMAGE_TARGET |
Doug Zongker | 73ef825 | 2009-07-23 15:12:53 -0700 | [diff] [blame] | 2566 | |
Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2567 | $(INSTALLED_SYSTEMIMAGE_TARGET): $(BUILT_SYSTEMIMAGE) $(RECOVERY_FROM_BOOT_PATCH) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2568 | @echo "Install system fs image: $@" |
| 2569 | $(copy-file-to-target) |
Yifan Hong | 8c3dce0 | 2019-04-09 17:03:57 +0000 | [diff] [blame] | 2570 | $(hide) $(call assert-max-image-size,$@ $(RECOVERY_FROM_BOOT_PATCH),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2571 | |
Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2572 | systemimage: $(INSTALLED_SYSTEMIMAGE_TARGET) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2573 | |
| 2574 | .PHONY: systemimage-nodeps snod |
| 2575 | systemimage-nodeps snod: $(filter-out systemimage-nodeps snod,$(MAKECMDGOALS)) \ |
Colin Cross | 144b028 | 2010-05-10 13:04:47 -0700 | [diff] [blame] | 2576 | | $(INTERNAL_USERIMAGES_DEPS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2577 | @echo "make $@: ignoring dependencies" |
Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2578 | $(call build-systemimage-target,$(INSTALLED_SYSTEMIMAGE_TARGET)) |
Yifan Hong | 8c3dce0 | 2019-04-09 17:03:57 +0000 | [diff] [blame] | 2579 | $(hide) $(call assert-max-image-size,$(INSTALLED_SYSTEMIMAGE_TARGET),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2580 | |
Ying Wang | acf01ec | 2012-02-24 11:05:48 -0800 | [diff] [blame] | 2581 | ifneq (,$(filter systemimage-nodeps snod, $(MAKECMDGOALS))) |
| 2582 | ifeq (true,$(WITH_DEXPREOPT)) |
| 2583 | $(warning Warning: with dexpreopt enabled, you may need a full rebuild.) |
| 2584 | endif |
| 2585 | endif |
| 2586 | |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 2587 | endif # BUILDING_SYSTEM_IMAGE |
| 2588 | |
Anton Hansson | 30e061b | 2018-11-12 13:36:46 +0000 | [diff] [blame] | 2589 | .PHONY: sync syncsys |
| 2590 | sync syncsys: $(INTERNAL_SYSTEMIMAGE_FILES) |
Colin Cross | 91a5227 | 2017-06-20 16:57:52 -0700 | [diff] [blame] | 2591 | |
Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2592 | # ----------------------------------------------------------------- |
Ying Wang | 4534d81 | 2012-04-09 17:04:12 -0700 | [diff] [blame] | 2593 | ## platform.zip: system, plus other files to be used in PDK fusion build, |
| 2594 | ## in a zip file |
keunyoung | c017806 | 2013-07-22 14:54:58 -0700 | [diff] [blame] | 2595 | ## |
| 2596 | ## PDK_PLATFORM_ZIP_PRODUCT_BINARIES is used to store specified files to platform.zip. |
| 2597 | ## The variable will be typically set from BoardConfig.mk. |
| 2598 | ## Files under out dir will be rejected to prevent possible conflicts with other rules. |
Colin Cross | 53c8f97 | 2018-09-28 16:19:42 -0700 | [diff] [blame] | 2599 | ifneq (,$(BUILD_PLATFORM_ZIP)) |
Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2600 | pdk_odex_javalibs := $(strip $(foreach m,$(DEXPREOPT.MODULES.JAVA_LIBRARIES),\ |
Colin Cross | 6db5b0e | 2018-11-16 21:26:33 -0800 | [diff] [blame] | 2601 | $(if $(filter $(DEXPREOPT.$(m).INSTALLED_STRIPPED),$(ALL_DEFAULT_INSTALLED_MODULES)),$(m)))) |
Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2602 | pdk_odex_apps := $(strip $(foreach m,$(DEXPREOPT.MODULES.APPS),\ |
Colin Cross | 6db5b0e | 2018-11-16 21:26:33 -0800 | [diff] [blame] | 2603 | $(if $(filter $(DEXPREOPT.$(m).INSTALLED_STRIPPED),$(ALL_DEFAULT_INSTALLED_MODULES)),$(m)))) |
Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2604 | pdk_classes_dex := $(strip \ |
| 2605 | $(foreach m,$(pdk_odex_javalibs),$(call intermediates-dir-for,JAVA_LIBRARIES,$(m),,COMMON)/javalib.jar) \ |
Nicolas Geoffray | 2ca0e49 | 2019-10-18 14:47:19 +0100 | [diff] [blame] | 2606 | $(foreach m,$(pdk_odex_apps),$(call intermediates-dir-for,APPS,$(m))/package.apk)) |
Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2607 | |
| 2608 | pdk_odex_config_mk := $(PRODUCT_OUT)/pdk_dexpreopt_config.mk |
| 2609 | $(pdk_odex_config_mk): PRIVATE_JAVA_LIBRARIES := $(pdk_odex_javalibs) |
| 2610 | $(pdk_odex_config_mk): PRIVATE_APPS := $(pdk_odex_apps) |
| 2611 | $(pdk_odex_config_mk) : |
| 2612 | @echo "PDK odex config makefile: $@" |
| 2613 | $(hide) mkdir -p $(dir $@) |
| 2614 | $(hide) echo "# Auto-generated. Do not modify." > $@ |
| 2615 | $(hide) echo "PDK.DEXPREOPT.JAVA_LIBRARIES:=$(PRIVATE_JAVA_LIBRARIES)" >> $@ |
| 2616 | $(hide) echo "PDK.DEXPREOPT.APPS:=$(PRIVATE_APPS)" >> $@ |
| 2617 | $(foreach m,$(PRIVATE_JAVA_LIBRARIES),\ |
| 2618 | $(hide) echo "PDK.DEXPREOPT.$(m).SRC:=$(patsubst $(OUT_DIR)/%,%,$(call intermediates-dir-for,JAVA_LIBRARIES,$(m),,COMMON)/javalib.jar)" >> $@$(newline)\ |
| 2619 | $(hide) echo "PDK.DEXPREOPT.$(m).DEX_PREOPT:=$(DEXPREOPT.$(m).DEX_PREOPT)" >> $@$(newline)\ |
| 2620 | $(hide) echo "PDK.DEXPREOPT.$(m).MULTILIB:=$(DEXPREOPT.$(m).MULTILIB)" >> $@$(newline)\ |
| 2621 | $(hide) echo "PDK.DEXPREOPT.$(m).DEX_PREOPT_FLAGS:=$(DEXPREOPT.$(m).DEX_PREOPT_FLAGS)" >> $@$(newline)\ |
| 2622 | ) |
| 2623 | $(foreach m,$(PRIVATE_APPS),\ |
Nicolas Geoffray | 2ca0e49 | 2019-10-18 14:47:19 +0100 | [diff] [blame] | 2624 | $(hide) echo "PDK.DEXPREOPT.$(m).SRC:=$(patsubst $(OUT_DIR)/%,%,$(call intermediates-dir-for,APPS,$(m))/package.apk)" >> $@$(newline)\ |
Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2625 | $(hide) echo "PDK.DEXPREOPT.$(m).DEX_PREOPT:=$(DEXPREOPT.$(m).DEX_PREOPT)" >> $@$(newline)\ |
| 2626 | $(hide) echo "PDK.DEXPREOPT.$(m).MULTILIB:=$(DEXPREOPT.$(m).MULTILIB)" >> $@$(newline)\ |
| 2627 | $(hide) echo "PDK.DEXPREOPT.$(m).DEX_PREOPT_FLAGS:=$(DEXPREOPT.$(m).DEX_PREOPT_FLAGS)" >> $@$(newline)\ |
| 2628 | $(hide) echo "PDK.DEXPREOPT.$(m).PRIVILEGED_MODULE:=$(DEXPREOPT.$(m).PRIVILEGED_MODULE)" >> $@$(newline)\ |
Dan Willemsen | 05a2b93 | 2017-03-20 18:31:17 -0700 | [diff] [blame] | 2629 | $(hide) echo "PDK.DEXPREOPT.$(m).VENDOR_MODULE:=$(DEXPREOPT.$(m).VENDOR_MODULE)" >> $@$(newline)\ |
Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2630 | $(hide) echo "PDK.DEXPREOPT.$(m).TARGET_ARCH:=$(DEXPREOPT.$(m).TARGET_ARCH)" >> $@$(newline)\ |
| 2631 | $(hide) echo "PDK.DEXPREOPT.$(m).STRIPPED_SRC:=$(patsubst $(PRODUCT_OUT)/%,%,$(DEXPREOPT.$(m).INSTALLED_STRIPPED))" >> $@$(newline)\ |
| 2632 | ) |
| 2633 | |
keunyoung | c017806 | 2013-07-22 14:54:58 -0700 | [diff] [blame] | 2634 | PDK_PLATFORM_ZIP_PRODUCT_BINARIES := $(filter-out $(OUT_DIR)/%,$(PDK_PLATFORM_ZIP_PRODUCT_BINARIES)) |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 2635 | INSTALLED_PLATFORM_ZIP := $(PRODUCT_OUT)/platform.zip |
Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2636 | |
| 2637 | $(INSTALLED_PLATFORM_ZIP): PRIVATE_DEX_FILES := $(pdk_classes_dex) |
| 2638 | $(INSTALLED_PLATFORM_ZIP): PRIVATE_ODEX_CONFIG := $(pdk_odex_config_mk) |
Colin Cross | 7363cde | 2018-09-14 21:51:11 -0700 | [diff] [blame] | 2639 | $(INSTALLED_PLATFORM_ZIP) : $(SOONG_ZIP) |
| 2640 | # dependencies for the other partitions are defined below after their file lists |
| 2641 | # are known |
Colin Cross | d60401a | 2019-04-18 14:46:48 -0700 | [diff] [blame] | 2642 | $(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_SYSTEMIMAGE_FILES) $(pdk_classes_dex) $(pdk_odex_config_mk) $(API_FINGERPRINT) |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 2643 | $(call pretty,"Platform zip package: $(INSTALLED_PLATFORM_ZIP)") |
Colin Cross | 7363cde | 2018-09-14 21:51:11 -0700 | [diff] [blame] | 2644 | rm -f $@ $@.lst |
| 2645 | echo "-C $(PRODUCT_OUT)" >> $@.lst |
| 2646 | echo "-D $(TARGET_OUT)" >> $@.lst |
| 2647 | echo "-D $(TARGET_OUT_NOTICE_FILES)" >> $@.lst |
| 2648 | echo "$(addprefix -f $(TARGET_OUT_UNSTRIPPED)/,$(PDK_SYMBOL_FILES_LIST))" >> $@.lst |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 2649 | ifdef BUILDING_VENDOR_IMAGE |
Colin Cross | 7363cde | 2018-09-14 21:51:11 -0700 | [diff] [blame] | 2650 | echo "-D $(TARGET_OUT_VENDOR)" >> $@.lst |
Ying Wang | cff3862 | 2014-07-16 17:46:35 -0700 | [diff] [blame] | 2651 | endif |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 2652 | ifdef BUILDING_PRODUCT_IMAGE |
Colin Cross | 7363cde | 2018-09-14 21:51:11 -0700 | [diff] [blame] | 2653 | echo "-D $(TARGET_OUT_PRODUCT)" >> $@.lst |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2654 | endif |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 2655 | ifdef BUILDING_SYSTEM_EXT_IMAGE |
| 2656 | echo "-D $(TARGET_OUT_SYSTEM_EXT)" >> $@.lst |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2657 | endif |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 2658 | ifdef BUILDING_ODM_IMAGE |
Colin Cross | 7363cde | 2018-09-14 21:51:11 -0700 | [diff] [blame] | 2659 | echo "-D $(TARGET_OUT_ODM)" >> $@.lst |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 2660 | endif |
Colin Cross | c451a37 | 2013-12-18 19:36:44 -0800 | [diff] [blame] | 2661 | ifneq ($(PDK_PLATFORM_JAVA_ZIP_CONTENTS),) |
Colin Cross | 7363cde | 2018-09-14 21:51:11 -0700 | [diff] [blame] | 2662 | echo "-C $(OUT_DIR)" >> $@.lst |
| 2663 | for f in $(filter-out $(PRIVATE_DEX_FILES),$(addprefix -f $(OUT_DIR)/,$(PDK_PLATFORM_JAVA_ZIP_CONTENTS))); do \ |
| 2664 | if [ -e $$f ]; then \ |
| 2665 | echo "-f $$f"; \ |
| 2666 | fi \ |
| 2667 | done >> $@.lst |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 2668 | endif |
keunyoung | c017806 | 2013-07-22 14:54:58 -0700 | [diff] [blame] | 2669 | ifneq ($(PDK_PLATFORM_ZIP_PRODUCT_BINARIES),) |
Colin Cross | 7363cde | 2018-09-14 21:51:11 -0700 | [diff] [blame] | 2670 | echo "-C . $(addprefix -f ,$(PDK_PLATFORM_ZIP_PRODUCT_BINARIES))" >> $@.lst |
keunyoung | c017806 | 2013-07-22 14:54:58 -0700 | [diff] [blame] | 2671 | endif |
Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2672 | @# Add dex-preopt files and config. |
Colin Cross | 7363cde | 2018-09-14 21:51:11 -0700 | [diff] [blame] | 2673 | $(if $(PRIVATE_DEX_FILES),\ |
| 2674 | echo "-C $(OUT_DIR) $(addprefix -f ,$(PRIVATE_DEX_FILES))") >> $@.lst |
Colin Cross | d60401a | 2019-04-18 14:46:48 -0700 | [diff] [blame] | 2675 | echo "-C $(dir $(API_FINGERPRINT)) -f $(API_FINGERPRINT)" >> $@.lst |
Colin Cross | 7363cde | 2018-09-14 21:51:11 -0700 | [diff] [blame] | 2676 | touch $(PRODUCT_OUT)/pdk.mk |
| 2677 | echo "-C $(PRODUCT_OUT) -f $(PRIVATE_ODEX_CONFIG) -f $(PRODUCT_OUT)/pdk.mk" >> $@.lst |
| 2678 | $(SOONG_ZIP) --ignore_missing_files -o $@ @$@.lst |
Ying Wang | 4c289e5 | 2012-03-30 13:52:54 -0700 | [diff] [blame] | 2679 | |
| 2680 | .PHONY: platform |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 2681 | platform: $(INSTALLED_PLATFORM_ZIP) |
| 2682 | |
| 2683 | .PHONY: platform-java |
| 2684 | platform-java: platform |
Ying Wang | 4c289e5 | 2012-03-30 13:52:54 -0700 | [diff] [blame] | 2685 | |
| 2686 | # Dist the platform.zip |
Keun young Park | 3e93aea | 2012-05-29 17:55:46 -0700 | [diff] [blame] | 2687 | ifneq (,$(filter platform platform-java, $(MAKECMDGOALS))) |
| 2688 | $(call dist-for-goals, platform platform-java, $(INSTALLED_PLATFORM_ZIP)) |
Ying Wang | 4c289e5 | 2012-03-30 13:52:54 -0700 | [diff] [blame] | 2689 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2690 | |
Colin Cross | 53c8f97 | 2018-09-28 16:19:42 -0700 | [diff] [blame] | 2691 | endif # BUILD_PLATFORM_ZIP |
| 2692 | |
Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2693 | # ----------------------------------------------------------------- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2694 | # data partition image |
| 2695 | INTERNAL_USERDATAIMAGE_FILES := \ |
Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2696 | $(filter $(TARGET_OUT_DATA)/%,$(ALL_DEFAULT_INSTALLED_MODULES)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2697 | |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 2698 | ifdef BUILDING_USERDATA_IMAGE |
Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 2699 | userdataimage_intermediates := \ |
Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2700 | $(call intermediates-dir-for,PACKAGING,userdata) |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 2701 | BUILT_USERDATAIMAGE_TARGET := $(PRODUCT_OUT)/userdata.img |
| 2702 | |
Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 2703 | define build-userdataimage-target |
| 2704 | $(call pretty,"Target userdata fs image: $(INSTALLED_USERDATAIMAGE_TARGET)") |
| 2705 | @mkdir -p $(TARGET_OUT_DATA) |
| 2706 | @mkdir -p $(userdataimage_intermediates) && rm -rf $(userdataimage_intermediates)/userdata_image_info.txt |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 2707 | $(call generate-image-prop-dictionary, $(userdataimage_intermediates)/userdata_image_info.txt,userdata,skip_fsck=true) |
Tao Bao | cf821fc | 2019-06-24 12:39:10 -0700 | [diff] [blame] | 2708 | PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$$PATH \ |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 2709 | $(BUILD_IMAGE) \ |
| 2710 | $(TARGET_OUT_DATA) $(userdataimage_intermediates)/userdata_image_info.txt \ |
| 2711 | $(INSTALLED_USERDATAIMAGE_TARGET) $(TARGET_OUT) |
| 2712 | $(call assert-max-image-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_PARTITION_SIZE)) |
Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 2713 | endef |
| 2714 | |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 2715 | # We just build this directly to the install location. |
| 2716 | INSTALLED_USERDATAIMAGE_TARGET := $(BUILT_USERDATAIMAGE_TARGET) |
Andreas Gampe | 039b5c7 | 2017-03-24 16:06:31 -0700 | [diff] [blame] | 2717 | INSTALLED_USERDATAIMAGE_TARGET_DEPS := \ |
| 2718 | $(INTERNAL_USERIMAGES_DEPS) \ |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 2719 | $(INTERNAL_USERDATAIMAGE_FILES) |
Andreas Gampe | 039b5c7 | 2017-03-24 16:06:31 -0700 | [diff] [blame] | 2720 | $(INSTALLED_USERDATAIMAGE_TARGET): $(INSTALLED_USERDATAIMAGE_TARGET_DEPS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2721 | $(build-userdataimage-target) |
| 2722 | |
| 2723 | .PHONY: userdataimage-nodeps |
Colin Cross | 144b028 | 2010-05-10 13:04:47 -0700 | [diff] [blame] | 2724 | userdataimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2725 | $(build-userdataimage-target) |
| 2726 | |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 2727 | endif # BUILDING_USERDATA_IMAGE |
Ying Wang | e215ed5 | 2012-10-15 14:36:22 -0700 | [diff] [blame] | 2728 | |
Andreas Gampe | 039b5c7 | 2017-03-24 16:06:31 -0700 | [diff] [blame] | 2729 | # ASAN libraries in the system image - build rule. |
| 2730 | ASAN_OUT_DIRS_FOR_SYSTEM_INSTALL := $(sort $(patsubst $(PRODUCT_OUT)/%,%,\ |
| 2731 | $(TARGET_OUT_SHARED_LIBRARIES) \ |
| 2732 | $(2ND_TARGET_OUT_SHARED_LIBRARIES) \ |
| 2733 | $(TARGET_OUT_VENDOR_SHARED_LIBRARIES) \ |
| 2734 | $(2ND_TARGET_OUT_VENDOR_SHARED_LIBRARIES))) |
Andreas Gampe | 2c498a3 | 2017-03-30 16:54:23 -0700 | [diff] [blame] | 2735 | # Extra options: Enforce the system user for the files to avoid having to change ownership. |
| 2736 | ASAN_SYSTEM_INSTALL_OPTIONS := --owner=1000 --group=1000 |
Andreas Gampe | 039b5c7 | 2017-03-24 16:06:31 -0700 | [diff] [blame] | 2737 | # Note: experimentally, it seems not worth it to try to get "best" compression. We don't save |
| 2738 | # enough space. |
| 2739 | $(ASAN_IN_SYSTEM_INSTALLED): $(INSTALLED_USERDATAIMAGE_TARGET_DEPS) |
Andreas Gampe | 2c498a3 | 2017-03-30 16:54:23 -0700 | [diff] [blame] | 2740 | tar cfj $(ASAN_IN_SYSTEM_INSTALLED) $(ASAN_SYSTEM_INSTALL_OPTIONS) -C $(TARGET_OUT_DATA)/.. $(ASAN_OUT_DIRS_FOR_SYSTEM_INSTALL) >/dev/null |
Andreas Gampe | 039b5c7 | 2017-03-24 16:06:31 -0700 | [diff] [blame] | 2741 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2742 | # ----------------------------------------------------------------- |
David Zeuthen | 2532862 | 2016-04-08 15:08:03 -0400 | [diff] [blame] | 2743 | # partition table image |
| 2744 | ifdef BOARD_BPT_INPUT_FILES |
| 2745 | |
| 2746 | BUILT_BPTIMAGE_TARGET := $(PRODUCT_OUT)/partition-table.img |
Casey Dahlin | 04d15dd | 2016-08-19 10:59:57 -0700 | [diff] [blame] | 2747 | BUILT_BPTJSON_TARGET := $(PRODUCT_OUT)/partition-table.bpt |
David Zeuthen | 2532862 | 2016-04-08 15:08:03 -0400 | [diff] [blame] | 2748 | |
| 2749 | INTERNAL_BVBTOOL_MAKE_TABLE_ARGS := \ |
| 2750 | --output_gpt $(BUILT_BPTIMAGE_TARGET) \ |
Casey Dahlin | 04d15dd | 2016-08-19 10:59:57 -0700 | [diff] [blame] | 2751 | --output_json $(BUILT_BPTJSON_TARGET) \ |
David Zeuthen | 2532862 | 2016-04-08 15:08:03 -0400 | [diff] [blame] | 2752 | $(foreach file, $(BOARD_BPT_INPUT_FILES), --input $(file)) |
| 2753 | |
| 2754 | ifdef BOARD_BPT_DISK_SIZE |
| 2755 | INTERNAL_BVBTOOL_MAKE_TABLE_ARGS += --disk_size $(BOARD_BPT_DISK_SIZE) |
| 2756 | endif |
| 2757 | |
| 2758 | define build-bptimage-target |
| 2759 | $(call pretty,"Target partition table image: $(INSTALLED_BPTIMAGE_TARGET)") |
| 2760 | $(hide) $(BPTTOOL) make_table $(INTERNAL_BVBTOOL_MAKE_TABLE_ARGS) $(BOARD_BPT_MAKE_TABLE_ARGS) |
| 2761 | endef |
| 2762 | |
| 2763 | INSTALLED_BPTIMAGE_TARGET := $(BUILT_BPTIMAGE_TARGET) |
Casey Dahlin | 04d15dd | 2016-08-19 10:59:57 -0700 | [diff] [blame] | 2764 | $(BUILT_BPTJSON_TARGET): $(INSTALLED_BPTIMAGE_TARGET) |
| 2765 | $(hide) touch -c $(BUILT_BPTJSON_TARGET) |
| 2766 | |
David Zeuthen | 2532862 | 2016-04-08 15:08:03 -0400 | [diff] [blame] | 2767 | $(INSTALLED_BPTIMAGE_TARGET): $(BPTTOOL) $(BOARD_BPT_INPUT_FILES) |
| 2768 | $(build-bptimage-target) |
| 2769 | |
| 2770 | .PHONY: bptimage-nodeps |
| 2771 | bptimage-nodeps: |
| 2772 | $(build-bptimage-target) |
| 2773 | |
| 2774 | endif # BOARD_BPT_INPUT_FILES |
| 2775 | |
| 2776 | # ----------------------------------------------------------------- |
Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2777 | # cache partition image |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 2778 | ifdef BUILDING_CACHE_IMAGE |
Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2779 | INTERNAL_CACHEIMAGE_FILES := \ |
| 2780 | $(filter $(TARGET_OUT_CACHE)/%,$(ALL_DEFAULT_INSTALLED_MODULES)) |
| 2781 | |
| 2782 | cacheimage_intermediates := \ |
| 2783 | $(call intermediates-dir-for,PACKAGING,cache) |
| 2784 | BUILT_CACHEIMAGE_TARGET := $(PRODUCT_OUT)/cache.img |
| 2785 | |
| 2786 | define build-cacheimage-target |
| 2787 | $(call pretty,"Target cache fs image: $(INSTALLED_CACHEIMAGE_TARGET)") |
| 2788 | @mkdir -p $(TARGET_OUT_CACHE) |
| 2789 | @mkdir -p $(cacheimage_intermediates) && rm -rf $(cacheimage_intermediates)/cache_image_info.txt |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 2790 | $(call generate-image-prop-dictionary, $(cacheimage_intermediates)/cache_image_info.txt,cache,skip_fsck=true) |
Tao Bao | cf821fc | 2019-06-24 12:39:10 -0700 | [diff] [blame] | 2791 | PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$$PATH \ |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 2792 | $(BUILD_IMAGE) \ |
| 2793 | $(TARGET_OUT_CACHE) $(cacheimage_intermediates)/cache_image_info.txt \ |
| 2794 | $(INSTALLED_CACHEIMAGE_TARGET) $(TARGET_OUT) |
| 2795 | $(call assert-max-image-size,$(INSTALLED_CACHEIMAGE_TARGET),$(BOARD_CACHEIMAGE_PARTITION_SIZE)) |
Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2796 | endef |
| 2797 | |
| 2798 | # We just build this directly to the install location. |
| 2799 | INSTALLED_CACHEIMAGE_TARGET := $(BUILT_CACHEIMAGE_TARGET) |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 2800 | $(INSTALLED_CACHEIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) $(INTERNAL_CACHEIMAGE_FILES) |
Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2801 | $(build-cacheimage-target) |
| 2802 | |
| 2803 | .PHONY: cacheimage-nodeps |
| 2804 | cacheimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS) |
| 2805 | $(build-cacheimage-target) |
| 2806 | |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 2807 | else # BUILDING_CACHE_IMAGE |
Patrick Tjin | f3b0dc2 | 2016-05-13 15:26:09 -0700 | [diff] [blame] | 2808 | # we need to ignore the broken cache link when doing the rsync |
| 2809 | IGNORE_CACHE_LINK := --exclude=cache |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 2810 | endif # BUILDING_CACHE_IMAGE |
Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2811 | |
David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 2812 | # ----------------------------------------------------------------- |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2813 | # system_other partition image |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 2814 | ifdef BUILDING_SYSTEM_OTHER_IMAGE |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2815 | ifeq ($(BOARD_USES_SYSTEM_OTHER_ODEX),true) |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2816 | # Marker file to identify that odex files are installed |
| 2817 | INSTALLED_SYSTEM_OTHER_ODEX_MARKER := $(TARGET_OUT_SYSTEM_OTHER)/system-other-odex-marker |
| 2818 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_SYSTEM_OTHER_ODEX_MARKER) |
| 2819 | $(INSTALLED_SYSTEM_OTHER_ODEX_MARKER): |
| 2820 | $(hide) touch $@ |
| 2821 | endif |
| 2822 | |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2823 | INTERNAL_SYSTEMOTHERIMAGE_FILES := \ |
| 2824 | $(filter $(TARGET_OUT_SYSTEM_OTHER)/%,\ |
| 2825 | $(ALL_DEFAULT_INSTALLED_MODULES)\ |
Dan Willemsen | 0663f68 | 2018-03-06 14:07:21 -0800 | [diff] [blame] | 2826 | $(ALL_PDK_FUSION_FILES)) \ |
| 2827 | $(PDK_FUSION_SYMLINK_STAMP) |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2828 | |
Colin Cross | 6db5b0e | 2018-11-16 21:26:33 -0800 | [diff] [blame] | 2829 | # system_other dex files are installed as a side-effect of installing system image files |
| 2830 | INTERNAL_SYSTEMOTHERIMAGE_FILES += $(INTERNAL_SYSTEMIMAGE_FILES) |
| 2831 | |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2832 | INSTALLED_FILES_FILE_SYSTEMOTHER := $(PRODUCT_OUT)/installed-files-system-other.txt |
Colin Cross | 23dded0 | 2018-06-13 14:04:22 -0700 | [diff] [blame] | 2833 | INSTALLED_FILES_JSON_SYSTEMOTHER := $(INSTALLED_FILES_FILE_SYSTEMOTHER:.txt=.json) |
| 2834 | $(INSTALLED_FILES_FILE_SYSTEMOTHER): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_SYSTEMOTHER) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 2835 | $(INSTALLED_FILES_FILE_SYSTEMOTHER) : $(INTERNAL_SYSTEMOTHERIMAGE_FILES) $(FILESLIST) $(FILESLIST_UTIL) |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2836 | @echo Installed file list: $@ |
| 2837 | @mkdir -p $(dir $@) |
| 2838 | @rm -f $@ |
Makoto Onuki | 9fe97e2 | 2017-03-16 09:41:19 -0700 | [diff] [blame] | 2839 | $(hide) $(FILESLIST) $(TARGET_OUT_SYSTEM_OTHER) > $(@:.txt=.json) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 2840 | $(hide) $(FILESLIST_UTIL) -c $(@:.txt=.json) > $@ |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2841 | |
Bowgo Tsai | 867ab66 | 2019-01-29 13:30:18 +0800 | [diff] [blame] | 2842 | # Determines partition size for system_other.img. |
| 2843 | ifeq ($(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS),true) |
| 2844 | ifneq ($(filter system,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),) |
| 2845 | INTERNAL_SYSTEM_OTHER_PARTITION_SIZE := $(BOARD_SUPER_PARTITION_SYSTEM_DEVICE_SIZE) |
| 2846 | endif |
| 2847 | endif |
| 2848 | |
| 2849 | ifndef INTERNAL_SYSTEM_OTHER_PARTITION_SIZE |
| 2850 | INTERNAL_SYSTEM_OTHER_PARTITION_SIZE:= $(BOARD_SYSTEMIMAGE_PARTITION_SIZE) |
| 2851 | endif |
| 2852 | |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2853 | systemotherimage_intermediates := \ |
| 2854 | $(call intermediates-dir-for,PACKAGING,system_other) |
| 2855 | BUILT_SYSTEMOTHERIMAGE_TARGET := $(PRODUCT_OUT)/system_other.img |
| 2856 | |
| 2857 | # Note that we assert the size is SYSTEMIMAGE_PARTITION_SIZE since this is the 'b' system image. |
| 2858 | define build-systemotherimage-target |
| 2859 | $(call pretty,"Target system_other fs image: $(INSTALLED_SYSTEMOTHERIMAGE_TARGET)") |
| 2860 | @mkdir -p $(TARGET_OUT_SYSTEM_OTHER) |
| 2861 | @mkdir -p $(systemotherimage_intermediates) && rm -rf $(systemotherimage_intermediates)/system_other_image_info.txt |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 2862 | $(call generate-image-prop-dictionary, $(systemotherimage_intermediates)/system_other_image_info.txt,system,skip_fsck=true) |
Tao Bao | cf821fc | 2019-06-24 12:39:10 -0700 | [diff] [blame] | 2863 | PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$$PATH \ |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 2864 | $(BUILD_IMAGE) \ |
| 2865 | $(TARGET_OUT_SYSTEM_OTHER) $(systemotherimage_intermediates)/system_other_image_info.txt \ |
| 2866 | $(INSTALLED_SYSTEMOTHERIMAGE_TARGET) $(TARGET_OUT) |
| 2867 | $(call assert-max-image-size,$(INSTALLED_SYSTEMOTHERIMAGE_TARGET),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE)) |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2868 | endef |
| 2869 | |
| 2870 | # We just build this directly to the install location. |
| 2871 | INSTALLED_SYSTEMOTHERIMAGE_TARGET := $(BUILT_SYSTEMOTHERIMAGE_TARGET) |
Andreas Gampe | 4ed21d1 | 2017-06-16 10:24:54 -0700 | [diff] [blame] | 2872 | ifneq (true,$(SANITIZE_LITE)) |
| 2873 | # Only create system_other when not building the second stage of a SANITIZE_LITE build. |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2874 | $(INSTALLED_SYSTEMOTHERIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) $(INTERNAL_SYSTEMOTHERIMAGE_FILES) $(INSTALLED_FILES_FILE_SYSTEMOTHER) |
| 2875 | $(build-systemotherimage-target) |
Andreas Gampe | 4ed21d1 | 2017-06-16 10:24:54 -0700 | [diff] [blame] | 2876 | endif |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2877 | |
| 2878 | .PHONY: systemotherimage-nodeps |
| 2879 | systemotherimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS) |
| 2880 | $(build-systemotherimage-target) |
| 2881 | |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 2882 | endif # BUILDING_SYSTEM_OTHER_IMAGE |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2883 | |
| 2884 | |
| 2885 | # ----------------------------------------------------------------- |
Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2886 | # vendor partition image |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 2887 | ifdef BUILDING_VENDOR_IMAGE |
Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2888 | INTERNAL_VENDORIMAGE_FILES := \ |
Ying Wang | cff3862 | 2014-07-16 17:46:35 -0700 | [diff] [blame] | 2889 | $(filter $(TARGET_OUT_VENDOR)/%,\ |
| 2890 | $(ALL_DEFAULT_INSTALLED_MODULES)\ |
Dan Willemsen | 0663f68 | 2018-03-06 14:07:21 -0800 | [diff] [blame] | 2891 | $(ALL_PDK_FUSION_FILES)) \ |
| 2892 | $(PDK_FUSION_SYMLINK_STAMP) |
Ying Wang | cff3862 | 2014-07-16 17:46:35 -0700 | [diff] [blame] | 2893 | |
| 2894 | # platform.zip depends on $(INTERNAL_VENDORIMAGE_FILES). |
| 2895 | $(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_VENDORIMAGE_FILES) |
Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2896 | |
Ying Wang | 8da19e3 | 2015-09-15 14:22:12 -0700 | [diff] [blame] | 2897 | INSTALLED_FILES_FILE_VENDOR := $(PRODUCT_OUT)/installed-files-vendor.txt |
Colin Cross | 23dded0 | 2018-06-13 14:04:22 -0700 | [diff] [blame] | 2898 | INSTALLED_FILES_JSON_VENDOR := $(INSTALLED_FILES_FILE_VENDOR:.txt=.json) |
| 2899 | $(INSTALLED_FILES_FILE_VENDOR): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_VENDOR) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 2900 | $(INSTALLED_FILES_FILE_VENDOR) : $(INTERNAL_VENDORIMAGE_FILES) $(FILESLIST) $(FILESLIST_UTIL) |
Ying Wang | 8da19e3 | 2015-09-15 14:22:12 -0700 | [diff] [blame] | 2901 | @echo Installed file list: $@ |
| 2902 | @mkdir -p $(dir $@) |
| 2903 | @rm -f $@ |
Makoto Onuki | 9fe97e2 | 2017-03-16 09:41:19 -0700 | [diff] [blame] | 2904 | $(hide) $(FILESLIST) $(TARGET_OUT_VENDOR) > $(@:.txt=.json) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 2905 | $(hide) $(FILESLIST_UTIL) -c $(@:.txt=.json) > $@ |
Ying Wang | 8da19e3 | 2015-09-15 14:22:12 -0700 | [diff] [blame] | 2906 | |
Bill Peckham | 1f9b8f0 | 2019-07-03 15:58:48 -0700 | [diff] [blame] | 2907 | # Create symlink /vendor/odm to /odm if necessary. |
| 2908 | ifdef BOARD_USES_ODMIMAGE |
| 2909 | define create-vendor-odm-symlink |
| 2910 | $(hide) if [ -d $(TARGET_OUT_VENDOR)/odm ] && [ ! -h $(TARGET_OUT_VENDOR)/odm ]; then \ |
| 2911 | echo 'Non-symlink $(TARGET_OUT_VENDOR)/odm detected!' 1>&2; \ |
| 2912 | echo 'You cannot install files to $(TARGET_OUT_VENDOR)/odm while building a separate odm.img!' 1>&2; \ |
| 2913 | exit 1; \ |
| 2914 | fi |
| 2915 | $(hide) ln -sf /odm $(TARGET_OUT_VENDOR)/odm |
| 2916 | endef |
| 2917 | else |
| 2918 | define create-vendor-odm-symlink |
| 2919 | endef |
| 2920 | endif |
| 2921 | |
Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2922 | vendorimage_intermediates := \ |
| 2923 | $(call intermediates-dir-for,PACKAGING,vendor) |
| 2924 | BUILT_VENDORIMAGE_TARGET := $(PRODUCT_OUT)/vendor.img |
Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2925 | define build-vendorimage-target |
| 2926 | $(call pretty,"Target vendor fs image: $(INSTALLED_VENDORIMAGE_TARGET)") |
| 2927 | @mkdir -p $(TARGET_OUT_VENDOR) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 2928 | $(call create-vendor-odm-symlink) |
Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2929 | @mkdir -p $(vendorimage_intermediates) && rm -rf $(vendorimage_intermediates)/vendor_image_info.txt |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 2930 | $(call generate-image-prop-dictionary, $(vendorimage_intermediates)/vendor_image_info.txt,vendor,skip_fsck=true) |
Tao Bao | cf821fc | 2019-06-24 12:39:10 -0700 | [diff] [blame] | 2931 | PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$$PATH \ |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 2932 | $(BUILD_IMAGE) \ |
| 2933 | $(TARGET_OUT_VENDOR) $(vendorimage_intermediates)/vendor_image_info.txt \ |
| 2934 | $(INSTALLED_VENDORIMAGE_TARGET) $(TARGET_OUT) |
| 2935 | $(call assert-max-image-size,$(INSTALLED_VENDORIMAGE_TARGET),$(BOARD_VENDORIMAGE_PARTITION_SIZE)) |
Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2936 | endef |
| 2937 | |
| 2938 | # We just build this directly to the install location. |
| 2939 | INSTALLED_VENDORIMAGE_TARGET := $(BUILT_VENDORIMAGE_TARGET) |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 2940 | $(INSTALLED_VENDORIMAGE_TARGET): \ |
| 2941 | $(INTERNAL_USERIMAGES_DEPS) \ |
| 2942 | $(INTERNAL_VENDORIMAGE_FILES) \ |
| 2943 | $(INSTALLED_FILES_FILE_VENDOR) |
Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2944 | $(build-vendorimage-target) |
| 2945 | |
Steven Moreland | a2e734d | 2017-03-07 12:10:09 -0800 | [diff] [blame] | 2946 | .PHONY: vendorimage-nodeps vnod |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 2947 | vendorimage-nodeps vnod: | $(INTERNAL_USERIMAGES_DEPS) |
Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2948 | $(build-vendorimage-target) |
| 2949 | |
Colin Cross | 91a5227 | 2017-06-20 16:57:52 -0700 | [diff] [blame] | 2950 | sync: $(INTERNAL_VENDORIMAGE_FILES) |
| 2951 | |
Dan Willemsen | 6c3e79b | 2016-06-17 14:07:37 -0700 | [diff] [blame] | 2952 | else ifdef BOARD_PREBUILT_VENDORIMAGE |
| 2953 | INSTALLED_VENDORIMAGE_TARGET := $(PRODUCT_OUT)/vendor.img |
| 2954 | $(eval $(call copy-one-file,$(BOARD_PREBUILT_VENDORIMAGE),$(INSTALLED_VENDORIMAGE_TARGET))) |
| 2955 | endif |
Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2956 | |
Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2957 | # ----------------------------------------------------------------- |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2958 | # product partition image |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 2959 | ifdef BUILDING_PRODUCT_IMAGE |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2960 | INTERNAL_PRODUCTIMAGE_FILES := \ |
| 2961 | $(filter $(TARGET_OUT_PRODUCT)/%,\ |
| 2962 | $(ALL_DEFAULT_INSTALLED_MODULES)\ |
Dan Willemsen | 0663f68 | 2018-03-06 14:07:21 -0800 | [diff] [blame] | 2963 | $(ALL_PDK_FUSION_FILES)) \ |
| 2964 | $(PDK_FUSION_SYMLINK_STAMP) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2965 | |
| 2966 | # platform.zip depends on $(INTERNAL_PRODUCTIMAGE_FILES). |
| 2967 | $(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_PRODUCTIMAGE_FILES) |
| 2968 | |
| 2969 | INSTALLED_FILES_FILE_PRODUCT := $(PRODUCT_OUT)/installed-files-product.txt |
Colin Cross | 23dded0 | 2018-06-13 14:04:22 -0700 | [diff] [blame] | 2970 | INSTALLED_FILES_JSON_PRODUCT := $(INSTALLED_FILES_FILE_PRODUCT:.txt=.json) |
| 2971 | $(INSTALLED_FILES_FILE_PRODUCT): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_PRODUCT) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 2972 | $(INSTALLED_FILES_FILE_PRODUCT) : $(INTERNAL_PRODUCTIMAGE_FILES) $(FILESLIST) $(FILESLIST_UTIL) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2973 | @echo Installed file list: $@ |
| 2974 | @mkdir -p $(dir $@) |
| 2975 | @rm -f $@ |
| 2976 | $(hide) $(FILESLIST) $(TARGET_OUT_PRODUCT) > $(@:.txt=.json) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 2977 | $(hide) $(FILESLIST_UTIL) -c $(@:.txt=.json) > $@ |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2978 | |
| 2979 | productimage_intermediates := \ |
| 2980 | $(call intermediates-dir-for,PACKAGING,product) |
| 2981 | BUILT_PRODUCTIMAGE_TARGET := $(PRODUCT_OUT)/product.img |
| 2982 | define build-productimage-target |
| 2983 | $(call pretty,"Target product fs image: $(INSTALLED_PRODUCTIMAGE_TARGET)") |
| 2984 | @mkdir -p $(TARGET_OUT_PRODUCT) |
| 2985 | @mkdir -p $(productimage_intermediates) && rm -rf $(productimage_intermediates)/product_image_info.txt |
Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 2986 | $(call generate-image-prop-dictionary, $(productimage_intermediates)/product_image_info.txt,product,skip_fsck=true) |
Tao Bao | cf821fc | 2019-06-24 12:39:10 -0700 | [diff] [blame] | 2987 | PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$$PATH \ |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 2988 | $(BUILD_IMAGE) \ |
| 2989 | $(TARGET_OUT_PRODUCT) $(productimage_intermediates)/product_image_info.txt \ |
| 2990 | $(INSTALLED_PRODUCTIMAGE_TARGET) $(TARGET_OUT) |
| 2991 | $(call assert-max-image-size,$(INSTALLED_PRODUCTIMAGE_TARGET),$(BOARD_PRODUCTIMAGE_PARTITION_SIZE)) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2992 | endef |
| 2993 | |
| 2994 | # We just build this directly to the install location. |
| 2995 | INSTALLED_PRODUCTIMAGE_TARGET := $(BUILT_PRODUCTIMAGE_TARGET) |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 2996 | $(INSTALLED_PRODUCTIMAGE_TARGET): \ |
| 2997 | $(INTERNAL_USERIMAGES_DEPS) \ |
| 2998 | $(INTERNAL_PRODUCTIMAGE_FILES) \ |
| 2999 | $(INSTALLED_FILES_FILE_PRODUCT) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3000 | $(build-productimage-target) |
| 3001 | |
| 3002 | .PHONY: productimage-nodeps pnod |
| 3003 | productimage-nodeps pnod: | $(INTERNAL_USERIMAGES_DEPS) |
| 3004 | $(build-productimage-target) |
| 3005 | |
| 3006 | sync: $(INTERNAL_PRODUCTIMAGE_FILES) |
| 3007 | |
| 3008 | else ifdef BOARD_PREBUILT_PRODUCTIMAGE |
| 3009 | INSTALLED_PRODUCTIMAGE_TARGET := $(PRODUCT_OUT)/product.img |
| 3010 | $(eval $(call copy-one-file,$(BOARD_PREBUILT_PRODUCTIMAGE),$(INSTALLED_PRODUCTIMAGE_TARGET))) |
| 3011 | endif |
| 3012 | |
| 3013 | # ----------------------------------------------------------------- |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3014 | # system_ext partition image |
| 3015 | ifdef BUILDING_SYSTEM_EXT_IMAGE |
| 3016 | INTERNAL_SYSTEM_EXTIMAGE_FILES := \ |
| 3017 | $(filter $(TARGET_OUT_SYSTEM_EXT)/%,\ |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3018 | $(ALL_DEFAULT_INSTALLED_MODULES)\ |
| 3019 | $(ALL_PDK_FUSION_FILES)) \ |
| 3020 | $(PDK_FUSION_SYMLINK_STAMP) |
| 3021 | |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3022 | # platform.zip depends on $(INTERNAL_SYSTEM_EXTIMAGE_FILES). |
| 3023 | $(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_SYSTEM_EXTIMAGE_FILES) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3024 | |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3025 | INSTALLED_FILES_FILE_SYSTEM_EXT := $(PRODUCT_OUT)/installed-files-system_ext.txt |
| 3026 | INSTALLED_FILES_JSON_SYSTEM_EXT := $(INSTALLED_FILES_FILE_SYSTEM_EXT:.txt=.json) |
| 3027 | $(INSTALLED_FILES_FILE_SYSTEM_EXT): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_SYSTEM_EXT) |
| 3028 | $(INSTALLED_FILES_FILE_SYSTEM_EXT) : $(INTERNAL_SYSTEM_EXTIMAGE_FILES) $(FILESLIST) $(FILESLIST_UTIL) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3029 | @echo Installed file list: $@ |
| 3030 | @mkdir -p $(dir $@) |
| 3031 | @rm -f $@ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3032 | $(hide) $(FILESLIST) $(TARGET_OUT_SYSTEM_EXT) > $(@:.txt=.json) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 3033 | $(hide) $(FILESLIST_UTIL) -c $(@:.txt=.json) > $@ |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3034 | |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3035 | system_extimage_intermediates := \ |
| 3036 | $(call intermediates-dir-for,PACKAGING,system_ext) |
| 3037 | BUILT_SYSTEM_EXTIMAGE_TARGET := $(PRODUCT_OUT)/system_ext.img |
| 3038 | define build-system_extimage-target |
| 3039 | $(call pretty,"Target system_ext fs image: $(INSTALLED_SYSTEM_EXTIMAGE_TARGET)") |
| 3040 | @mkdir -p $(TARGET_OUT_SYSTEM_EXT) |
| 3041 | @mkdir -p $(system_extimage_intermediates) && rm -rf $(system_extimage_intermediates)/system_ext_image_info.txt |
| 3042 | $(call generate-image-prop-dictionary, $(system_extimage_intermediates)/system_ext_image_info.txt,system_ext, skip_fsck=true) |
Tao Bao | cf821fc | 2019-06-24 12:39:10 -0700 | [diff] [blame] | 3043 | PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$$PATH \ |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 3044 | $(BUILD_IMAGE) \ |
| 3045 | $(TARGET_OUT_SYSTEM_EXT) \ |
| 3046 | $(system_extimage_intermediates)/system_ext_image_info.txt \ |
| 3047 | $(INSTALLED_SYSTEM_EXTIMAGE_TARGET) \ |
| 3048 | $(TARGET_OUT) |
| 3049 | $(call assert-max-image-size,$(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET),$(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE)) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3050 | endef |
| 3051 | |
| 3052 | # We just build this directly to the install location. |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3053 | INSTALLED_SYSTEM_EXTIMAGE_TARGET := $(BUILT_SYSTEM_EXTIMAGE_TARGET) |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 3054 | $(INSTALLED_SYSTEM_EXTIMAGE_TARGET): \ |
| 3055 | $(INTERNAL_USERIMAGES_DEPS) \ |
| 3056 | $(INTERNAL_SYSTEM_EXTIMAGE_FILES) \ |
| 3057 | $(INSTALLED_FILES_FILE_SYSTEM_EXT) |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3058 | $(build-system_extimage-target) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3059 | |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3060 | .PHONY: systemextimage-nodeps senod |
| 3061 | systemextimage-nodeps senod: | $(INTERNAL_USERIMAGES_DEPS) |
| 3062 | $(build-system_extimage-target) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3063 | |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3064 | sync: $(INTERNAL_SYSTEM_EXTIMAGE_FILES) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3065 | |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3066 | else ifdef BOARD_PREBUILT_SYSTEM_EXTIMAGE |
| 3067 | INSTALLED_SYSTEM_EXTIMAGE_TARGET := $(PRODUCT_OUT)/system_ext.img |
| 3068 | $(eval $(call copy-one-file,$(BOARD_PREBUILT_SYSTEM_EXTIMAGE),$(INSTALLED_SYSTEM_EXTIMAGE_TARGET))) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3069 | endif |
| 3070 | |
| 3071 | # ----------------------------------------------------------------- |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3072 | # odm partition image |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 3073 | ifdef BUILDING_ODM_IMAGE |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3074 | INTERNAL_ODMIMAGE_FILES := \ |
| 3075 | $(filter $(TARGET_OUT_ODM)/%,\ |
| 3076 | $(ALL_DEFAULT_INSTALLED_MODULES)\ |
| 3077 | $(ALL_PDK_FUSION_FILES)) \ |
| 3078 | $(PDK_FUSION_SYMLINK_STAMP) |
| 3079 | # platform.zip depends on $(INTERNAL_ODMIMAGE_FILES). |
| 3080 | $(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_ODMIMAGE_FILES) |
| 3081 | |
| 3082 | INSTALLED_FILES_FILE_ODM := $(PRODUCT_OUT)/installed-files-odm.txt |
| 3083 | INSTALLED_FILES_JSON_ODM := $(INSTALLED_FILES_FILE_ODM:.txt=.json) |
| 3084 | $(INSTALLED_FILES_FILE_ODM): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_ODM) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 3085 | $(INSTALLED_FILES_FILE_ODM) : $(INTERNAL_ODMIMAGE_FILES) $(FILESLIST) $(FILESLIST_UTIL) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3086 | @echo Installed file list: $@ |
| 3087 | @mkdir -p $(dir $@) |
| 3088 | @rm -f $@ |
| 3089 | $(hide) $(FILESLIST) $(TARGET_OUT_ODM) > $(@:.txt=.json) |
Dan Willemsen | c84e4cb | 2019-06-10 16:39:45 -0700 | [diff] [blame] | 3090 | $(hide) $(FILESLIST_UTIL) -c $(@:.txt=.json) > $@ |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3091 | |
| 3092 | odmimage_intermediates := \ |
| 3093 | $(call intermediates-dir-for,PACKAGING,odm) |
| 3094 | BUILT_ODMIMAGE_TARGET := $(PRODUCT_OUT)/odm.img |
| 3095 | define build-odmimage-target |
| 3096 | $(call pretty,"Target odm fs image: $(INSTALLED_ODMIMAGE_TARGET)") |
| 3097 | @mkdir -p $(TARGET_OUT_ODM) |
| 3098 | @mkdir -p $(odmimage_intermediates) && rm -rf $(odmimage_intermediates)/odm_image_info.txt |
| 3099 | $(call generate-userimage-prop-dictionary, $(odmimage_intermediates)/odm_image_info.txt, skip_fsck=true) |
Tao Bao | cf821fc | 2019-06-24 12:39:10 -0700 | [diff] [blame] | 3100 | PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$$PATH \ |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 3101 | $(BUILD_IMAGE) \ |
| 3102 | $(TARGET_OUT_ODM) $(odmimage_intermediates)/odm_image_info.txt \ |
| 3103 | $(INSTALLED_ODMIMAGE_TARGET) $(TARGET_OUT) |
| 3104 | $(call assert-max-image-size,$(INSTALLED_ODMIMAGE_TARGET),$(BOARD_ODMIMAGE_PARTITION_SIZE)) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3105 | endef |
| 3106 | |
| 3107 | # We just build this directly to the install location. |
| 3108 | INSTALLED_ODMIMAGE_TARGET := $(BUILT_ODMIMAGE_TARGET) |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 3109 | $(INSTALLED_ODMIMAGE_TARGET): \ |
| 3110 | $(INTERNAL_USERIMAGES_DEPS) \ |
| 3111 | $(INTERNAL_ODMIMAGE_FILES) \ |
| 3112 | $(INSTALLED_FILES_FILE_ODM) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3113 | $(build-odmimage-target) |
| 3114 | |
| 3115 | .PHONY: odmimage-nodeps onod |
Colin Cross | 4f60e36 | 2019-06-05 11:53:43 -0700 | [diff] [blame] | 3116 | odmimage-nodeps onod: | $(INTERNAL_USERIMAGES_DEPS) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3117 | $(build-odmimage-target) |
| 3118 | |
| 3119 | sync: $(INTERNAL_ODMIMAGE_FILES) |
| 3120 | |
| 3121 | else ifdef BOARD_PREBUILT_ODMIMAGE |
| 3122 | INSTALLED_ODMIMAGE_TARGET := $(PRODUCT_OUT)/odm.img |
| 3123 | $(eval $(call copy-one-file,$(BOARD_PREBUILT_ODMIMAGE),$(INSTALLED_ODMIMAGE_TARGET))) |
| 3124 | endif |
| 3125 | |
| 3126 | # ----------------------------------------------------------------- |
Yueyao Zhu | 211c901 | 2017-04-27 00:34:50 -0700 | [diff] [blame] | 3127 | # dtbo image |
| 3128 | ifdef BOARD_PREBUILT_DTBOIMAGE |
| 3129 | INSTALLED_DTBOIMAGE_TARGET := $(PRODUCT_OUT)/dtbo.img |
| 3130 | |
| 3131 | ifeq ($(BOARD_AVB_ENABLE),true) |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3132 | $(INSTALLED_DTBOIMAGE_TARGET): $(BOARD_PREBUILT_DTBOIMAGE) $(AVBTOOL) $(BOARD_AVB_DTBO_KEY_PATH) |
Yueyao Zhu | 211c901 | 2017-04-27 00:34:50 -0700 | [diff] [blame] | 3133 | cp $(BOARD_PREBUILT_DTBOIMAGE) $@ |
| 3134 | $(AVBTOOL) add_hash_footer \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 3135 | --image $@ \ |
| 3136 | --partition_size $(BOARD_DTBOIMG_PARTITION_SIZE) \ |
| 3137 | --partition_name dtbo $(INTERNAL_AVB_DTBO_SIGNING_ARGS) \ |
| 3138 | $(BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS) |
Yueyao Zhu | 211c901 | 2017-04-27 00:34:50 -0700 | [diff] [blame] | 3139 | else |
| 3140 | $(INSTALLED_DTBOIMAGE_TARGET): $(BOARD_PREBUILT_DTBOIMAGE) |
| 3141 | cp $(BOARD_PREBUILT_DTBOIMAGE) $@ |
| 3142 | endif |
| 3143 | |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3144 | endif # BOARD_PREBUILT_DTBOIMAGE |
| 3145 | |
| 3146 | # Returns a list of image targets corresponding to the given list of partitions. For example, it |
| 3147 | # returns "$(INSTALLED_PRODUCTIMAGE_TARGET)" for "product", or "$(INSTALLED_SYSTEMIMAGE_TARGET) |
| 3148 | # $(INSTALLED_VENDORIMAGE_TARGET)" for "system vendor". |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3149 | # (1): list of partitions like "system", "vendor" or "system product system_ext". |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3150 | define images-for-partitions |
| 3151 | $(strip $(foreach item,$(1),$(INSTALLED_$(call to-upper,$(item))IMAGE_TARGET))) |
| 3152 | endef |
Yueyao Zhu | 211c901 | 2017-04-27 00:34:50 -0700 | [diff] [blame] | 3153 | |
| 3154 | # ----------------------------------------------------------------- |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3155 | # vbmeta image |
| 3156 | ifeq ($(BOARD_AVB_ENABLE),true) |
| 3157 | |
| 3158 | BUILT_VBMETAIMAGE_TARGET := $(PRODUCT_OUT)/vbmeta.img |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3159 | AVB_CHAIN_KEY_DIR := $(TARGET_OUT_INTERMEDIATES)/avb_chain_keys |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3160 | |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3161 | ifdef BOARD_AVB_KEY_PATH |
| 3162 | $(if $(BOARD_AVB_ALGORITHM),,$(error BOARD_AVB_ALGORITHM is not defined)) |
| 3163 | else |
| 3164 | # If key path isn't specified, use the 4096-bit test key. |
| 3165 | BOARD_AVB_ALGORITHM := SHA256_RSA4096 |
| 3166 | BOARD_AVB_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem |
| 3167 | endif |
| 3168 | |
Bowgo Tsai | 1e04bf7 | 2019-01-23 22:19:19 +0800 | [diff] [blame] | 3169 | # AVB signing for system_other.img. |
| 3170 | ifdef BUILDING_SYSTEM_OTHER_IMAGE |
| 3171 | ifdef BOARD_AVB_SYSTEM_OTHER_KEY_PATH |
| 3172 | $(if $(BOARD_AVB_SYSTEM_OTHER_ALGORITHM),,$(error BOARD_AVB_SYSTEM_OTHER_ALGORITHM is not defined)) |
| 3173 | else |
| 3174 | # If key path isn't specified, use the same key as BOARD_AVB_KEY_PATH. |
| 3175 | BOARD_AVB_SYSTEM_OTHER_KEY_PATH := $(BOARD_AVB_KEY_PATH) |
| 3176 | BOARD_AVB_SYSTEM_OTHER_ALGORITHM := $(BOARD_AVB_ALGORITHM) |
| 3177 | endif |
| 3178 | |
Bowgo Tsai | e4544b1 | 2019-02-27 10:15:51 +0800 | [diff] [blame] | 3179 | $(INSTALLED_PRODUCT_SYSTEM_OTHER_AVBKEY_TARGET): $(AVBTOOL) $(BOARD_AVB_SYSTEM_OTHER_KEY_PATH) |
| 3180 | @echo Extracting system_other avb key: $@ |
| 3181 | @rm -f $@ |
| 3182 | @mkdir -p $(dir $@) |
| 3183 | $(AVBTOOL) extract_public_key --key $(BOARD_AVB_SYSTEM_OTHER_KEY_PATH) --output $@ |
Bowgo Tsai | 45db7ce | 2019-01-30 14:53:57 +0800 | [diff] [blame] | 3184 | |
Bowgo Tsai | 1e04bf7 | 2019-01-23 22:19:19 +0800 | [diff] [blame] | 3185 | ifndef BOARD_AVB_SYSTEM_OTHER_ROLLBACK_INDEX |
| 3186 | BOARD_AVB_SYSTEM_OTHER_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) |
| 3187 | endif |
| 3188 | |
| 3189 | BOARD_AVB_SYSTEM_OTHER_ADD_HASHTREE_FOOTER_ARGS += --rollback_index $(BOARD_AVB_SYSTEM_OTHER_ROLLBACK_INDEX) |
| 3190 | endif # end of AVB for BUILDING_SYSTEM_OTHER_IMAGE |
| 3191 | |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3192 | INTERNAL_AVB_PARTITIONS_IN_CHAINED_VBMETA_IMAGES := \ |
David Anderson | 7709ab2 | 2018-10-15 14:41:34 -0700 | [diff] [blame] | 3193 | $(BOARD_AVB_VBMETA_SYSTEM) \ |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3194 | $(BOARD_AVB_VBMETA_VENDOR) |
| 3195 | |
| 3196 | # Not allowing the same partition to appear in multiple groups. |
| 3197 | ifneq ($(words $(sort $(INTERNAL_AVB_PARTITIONS_IN_CHAINED_VBMETA_IMAGES))),$(words $(INTERNAL_AVB_PARTITIONS_IN_CHAINED_VBMETA_IMAGES))) |
David Anderson | 7709ab2 | 2018-10-15 14:41:34 -0700 | [diff] [blame] | 3198 | $(error BOARD_AVB_VBMETA_SYSTEM and BOARD_AVB_VBMETA_VENDOR cannot have duplicates) |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3199 | endif |
| 3200 | |
cfig | 1aeef72 | 2019-09-20 22:45:06 +0800 | [diff] [blame] | 3201 | # When building a standalone recovery image for non-A/B devices, recovery image must be self-signed |
| 3202 | # to be verified independently, and cannot be chained into vbmeta.img. See the link below for |
| 3203 | # details. |
| 3204 | ifneq ($(AB_OTA_UPDATER),true) |
| 3205 | ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),) |
| 3206 | $(if $(BOARD_AVB_RECOVERY_KEY_PATH),,\ |
| 3207 | $(error BOARD_AVB_RECOVERY_KEY_PATH must be defined for non-A/B devices. \ |
| 3208 | See https://android.googlesource.com/platform/external/avb/+/master/README.md#booting-into-recovery)) |
| 3209 | endif |
| 3210 | endif |
| 3211 | |
Bowgo Tsai | 9b54801 | 2019-05-14 16:57:03 +0800 | [diff] [blame] | 3212 | # Appends os version and security patch level as a AVB property descriptor |
Bowgo Tsai | cca76dd | 2019-01-30 21:52:32 +0800 | [diff] [blame] | 3213 | |
| 3214 | BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS += \ |
Tao Bao | 19b02fe | 2019-10-09 00:04:28 -0700 | [diff] [blame] | 3215 | --prop com.android.build.system.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) \ |
Bowgo Tsai | 9b54801 | 2019-05-14 16:57:03 +0800 | [diff] [blame] | 3216 | --prop com.android.build.system.os_version:$(PLATFORM_VERSION) \ |
Bowgo Tsai | cca76dd | 2019-01-30 21:52:32 +0800 | [diff] [blame] | 3217 | --prop com.android.build.system.security_patch:$(PLATFORM_SECURITY_PATCH) |
| 3218 | |
| 3219 | BOARD_AVB_PRODUCT_ADD_HASHTREE_FOOTER_ARGS += \ |
Tao Bao | 19b02fe | 2019-10-09 00:04:28 -0700 | [diff] [blame] | 3220 | --prop com.android.build.product.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) \ |
Bowgo Tsai | 9b54801 | 2019-05-14 16:57:03 +0800 | [diff] [blame] | 3221 | --prop com.android.build.product.os_version:$(PLATFORM_VERSION) \ |
Bowgo Tsai | cca76dd | 2019-01-30 21:52:32 +0800 | [diff] [blame] | 3222 | --prop com.android.build.product.security_patch:$(PLATFORM_SECURITY_PATCH) |
| 3223 | |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3224 | BOARD_AVB_SYSTEM_EXT_ADD_HASHTREE_FOOTER_ARGS += \ |
Tao Bao | 19b02fe | 2019-10-09 00:04:28 -0700 | [diff] [blame] | 3225 | --prop com.android.build.system_ext.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) \ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3226 | --prop com.android.build.system_ext.os_version:$(PLATFORM_VERSION) \ |
| 3227 | --prop com.android.build.system_ext.security_patch:$(PLATFORM_SECURITY_PATCH) |
Bowgo Tsai | cca76dd | 2019-01-30 21:52:32 +0800 | [diff] [blame] | 3228 | |
Bowgo Tsai | 9b54801 | 2019-05-14 16:57:03 +0800 | [diff] [blame] | 3229 | BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS += \ |
Tao Bao | 19b02fe | 2019-10-09 00:04:28 -0700 | [diff] [blame] | 3230 | --prop com.android.build.boot.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) \ |
Bowgo Tsai | 9b54801 | 2019-05-14 16:57:03 +0800 | [diff] [blame] | 3231 | --prop com.android.build.boot.os_version:$(PLATFORM_VERSION) |
| 3232 | |
Tao Bao | 19b02fe | 2019-10-09 00:04:28 -0700 | [diff] [blame] | 3233 | BOARD_AVB_VENDOR_BOOT_ADD_HASH_FOOTER_ARGS += \ |
| 3234 | --prop com.android.build.vendor_boot.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) \ |
| 3235 | |
| 3236 | BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS += \ |
| 3237 | --prop com.android.build.recovery.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) |
| 3238 | |
Bowgo Tsai | 9b54801 | 2019-05-14 16:57:03 +0800 | [diff] [blame] | 3239 | BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS += \ |
Tao Bao | 19b02fe | 2019-10-09 00:04:28 -0700 | [diff] [blame] | 3240 | --prop com.android.build.vendor.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) \ |
Bowgo Tsai | 9b54801 | 2019-05-14 16:57:03 +0800 | [diff] [blame] | 3241 | --prop com.android.build.vendor.os_version:$(PLATFORM_VERSION) |
| 3242 | |
| 3243 | BOARD_AVB_ODM_ADD_HASHTREE_FOOTER_ARGS += \ |
Tao Bao | 19b02fe | 2019-10-09 00:04:28 -0700 | [diff] [blame] | 3244 | --prop com.android.build.odm.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) \ |
Bowgo Tsai | 9b54801 | 2019-05-14 16:57:03 +0800 | [diff] [blame] | 3245 | --prop com.android.build.odm.os_version:$(PLATFORM_VERSION) |
| 3246 | |
Tao Bao | 19b02fe | 2019-10-09 00:04:28 -0700 | [diff] [blame] | 3247 | BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS += \ |
| 3248 | --prop com.android.build.dtbo.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) |
| 3249 | |
Bowgo Tsai | 9b54801 | 2019-05-14 16:57:03 +0800 | [diff] [blame] | 3250 | # The following vendor- and odm-specific images needs explicit SPL set per board. |
Bowgo Tsai | cca76dd | 2019-01-30 21:52:32 +0800 | [diff] [blame] | 3251 | ifdef BOOT_SECURITY_PATCH |
| 3252 | BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS += \ |
| 3253 | --prop com.android.build.boot.security_patch:$(BOOT_SECURITY_PATCH) |
| 3254 | endif |
| 3255 | |
| 3256 | ifdef VENDOR_SECURITY_PATCH |
| 3257 | BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS += \ |
| 3258 | --prop com.android.build.vendor.security_patch:$(VENDOR_SECURITY_PATCH) |
| 3259 | endif |
| 3260 | |
| 3261 | ifdef ODM_SECURITY_PATCH |
| 3262 | BOARD_AVB_ODM_ADD_HASHTREE_FOOTER_ARGS += \ |
| 3263 | --prop com.android.build.odm.security_patch:$(ODM_SECURITY_PATCH) |
| 3264 | endif |
| 3265 | |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3266 | BOOT_FOOTER_ARGS := BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 3267 | VENDOR_BOOT_FOOTER_ARGS := BOARD_AVB_VENDOR_BOOT_ADD_HASH_FOOTER_ARGS |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3268 | DTBO_FOOTER_ARGS := BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS |
| 3269 | SYSTEM_FOOTER_ARGS := BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS |
| 3270 | VENDOR_FOOTER_ARGS := BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS |
David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 3271 | RECOVERY_FOOTER_ARGS := BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3272 | PRODUCT_FOOTER_ARGS := BOARD_AVB_PRODUCT_ADD_HASHTREE_FOOTER_ARGS |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3273 | SYSTEM_EXT_FOOTER_ARGS := BOARD_AVB_SYSTEM_EXT_ADD_HASHTREE_FOOTER_ARGS |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3274 | ODM_FOOTER_ARGS := BOARD_AVB_ODM_ADD_HASHTREE_FOOTER_ARGS |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3275 | |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3276 | # Helper function that checks and sets required build variables for an AVB chained partition. |
David Anderson | 7709ab2 | 2018-10-15 14:41:34 -0700 | [diff] [blame] | 3277 | # $(1): the partition to enable AVB chain, e.g., boot or system or vbmeta_system. |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3278 | define _check-and-set-avb-chain-args |
| 3279 | $(eval part := $(1)) |
| 3280 | $(eval PART=$(call to-upper,$(part))) |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3281 | |
| 3282 | $(eval _key_path := BOARD_AVB_$(PART)_KEY_PATH) |
| 3283 | $(eval _signing_algorithm := BOARD_AVB_$(PART)_ALGORITHM) |
| 3284 | $(eval _rollback_index := BOARD_AVB_$(PART)_ROLLBACK_INDEX) |
| 3285 | $(eval _rollback_index_location := BOARD_AVB_$(PART)_ROLLBACK_INDEX_LOCATION) |
| 3286 | $(if $($(_key_path)),,$(error $(_key_path) is not defined)) |
| 3287 | $(if $($(_signing_algorithm)),,$(error $(_signing_algorithm) is not defined)) |
| 3288 | $(if $($(_rollback_index)),,$(error $(_rollback_index) is not defined)) |
| 3289 | $(if $($(_rollback_index_location)),,$(error $(_rollback_index_location) is not defined)) |
| 3290 | |
| 3291 | # Set INTERNAL_AVB_(PART)_SIGNING_ARGS |
| 3292 | $(eval _signing_args := INTERNAL_AVB_$(PART)_SIGNING_ARGS) |
| 3293 | $(eval $(_signing_args) := \ |
| 3294 | --algorithm $($(_signing_algorithm)) --key $($(_key_path))) |
| 3295 | |
cfig | 1aeef72 | 2019-09-20 22:45:06 +0800 | [diff] [blame] | 3296 | # The recovery partition in non-A/B devices should be verified separately. Skip adding the chain |
| 3297 | # partition descriptor for recovery partition into vbmeta.img. |
| 3298 | $(if $(or $(filter true,$(AB_OTA_UPDATER)),$(filter-out recovery,$(part))),\ |
| 3299 | $(eval INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += \ |
| 3300 | --chain_partition $(part):$($(_rollback_index_location)):$(AVB_CHAIN_KEY_DIR)/$(part).avbpubkey)) |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3301 | |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3302 | # Set rollback_index via footer args for non-chained vbmeta image. Chained vbmeta image will pick up |
David Anderson | 7709ab2 | 2018-10-15 14:41:34 -0700 | [diff] [blame] | 3303 | # the index via a separate flag (e.g. BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX). |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3304 | $(if $(filter $(part),$(part:vbmeta_%=%)),\ |
| 3305 | $(eval _footer_args := $(PART)_FOOTER_ARGS) \ |
| 3306 | $(eval $($(_footer_args)) += --rollback_index $($(_rollback_index)))) |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3307 | endef |
| 3308 | |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3309 | # Checks and sets the required build variables for an AVB partition. The partition will be |
| 3310 | # configured as a chained partition, if BOARD_AVB_<partition>_KEY_PATH is defined. Otherwise the |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3311 | # image descriptor will be included into vbmeta.img, unless it has been already added to any chained |
| 3312 | # VBMeta image. |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3313 | # $(1): Partition name, e.g. boot or system. |
| 3314 | define check-and-set-avb-args |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3315 | $(eval _in_chained_vbmeta := $(filter $(1),$(INTERNAL_AVB_PARTITIONS_IN_CHAINED_VBMETA_IMAGES))) |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3316 | $(if $(BOARD_AVB_$(call to-upper,$(1))_KEY_PATH),\ |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3317 | $(if $(_in_chained_vbmeta),\ |
| 3318 | $(error Chaining partition "$(1)" in chained VBMeta image is not supported)) \ |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3319 | $(call _check-and-set-avb-chain-args,$(1)),\ |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3320 | $(if $(_in_chained_vbmeta),,\ |
| 3321 | $(eval INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += \ |
| 3322 | --include_descriptors_from_image $(call images-for-partitions,$(1))))) |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3323 | endef |
| 3324 | |
Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 3325 | ifdef INSTALLED_BOOTIMAGE_TARGET |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3326 | $(eval $(call check-and-set-avb-args,boot)) |
Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 3327 | endif |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3328 | |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 3329 | ifdef INSTALLED_VENDOR_BOOTIMAGE_TARGET |
| 3330 | $(eval $(call check-and-set-avb-args,vendor_boot)) |
| 3331 | endif |
| 3332 | |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3333 | $(eval $(call check-and-set-avb-args,system)) |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3334 | |
| 3335 | ifdef INSTALLED_VENDORIMAGE_TARGET |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3336 | $(eval $(call check-and-set-avb-args,vendor)) |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3337 | endif |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3338 | |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3339 | ifdef INSTALLED_PRODUCTIMAGE_TARGET |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3340 | $(eval $(call check-and-set-avb-args,product)) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3341 | endif |
| 3342 | |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3343 | ifdef INSTALLED_SYSTEM_EXTIMAGE_TARGET |
| 3344 | $(eval $(call check-and-set-avb-args,system_ext)) |
Tao Bao | cee6d04 | 2018-08-22 23:39:03 -0700 | [diff] [blame] | 3345 | endif |
| 3346 | |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3347 | ifdef INSTALLED_ODMIMAGE_TARGET |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3348 | $(eval $(call check-and-set-avb-args,odm)) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3349 | endif |
| 3350 | |
Yueyao Zhu | 211c901 | 2017-04-27 00:34:50 -0700 | [diff] [blame] | 3351 | ifdef INSTALLED_DTBOIMAGE_TARGET |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3352 | $(eval $(call check-and-set-avb-args,dtbo)) |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3353 | endif |
Yueyao Zhu | 211c901 | 2017-04-27 00:34:50 -0700 | [diff] [blame] | 3354 | |
David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 3355 | ifdef INSTALLED_RECOVERYIMAGE_TARGET |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3356 | $(eval $(call check-and-set-avb-args,recovery)) |
David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 3357 | endif |
Bowgo Tsai | 53cf999 | 2017-06-13 11:27:06 +0800 | [diff] [blame] | 3358 | |
David Anderson | 7709ab2 | 2018-10-15 14:41:34 -0700 | [diff] [blame] | 3359 | # Not using INSTALLED_VBMETA_SYSTEMIMAGE_TARGET as it won't be set yet. |
| 3360 | ifdef BOARD_AVB_VBMETA_SYSTEM |
| 3361 | $(eval $(call check-and-set-avb-args,vbmeta_system)) |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3362 | endif |
| 3363 | |
| 3364 | ifdef BOARD_AVB_VBMETA_VENDOR |
| 3365 | $(eval $(call check-and-set-avb-args,vbmeta_vendor)) |
| 3366 | endif |
| 3367 | |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3368 | # Add kernel cmdline descriptor for kernel to mount system.img as root with |
| 3369 | # dm-verity. This works when system.img is either chained or not-chained: |
| 3370 | # - chained: The --setup_as_rootfs_from_kernel option will add dm-verity kernel |
| 3371 | # cmdline descriptor to system.img |
| 3372 | # - not-chained: The --include_descriptors_from_image option for make_vbmeta_image |
| 3373 | # will include the kernel cmdline descriptor from system.img into vbmeta.img |
Bowgo Tsai | 9b37760 | 2017-04-14 18:50:11 +0800 | [diff] [blame] | 3374 | ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) |
David Anderson | 8916a2a | 2018-09-18 15:46:59 -0700 | [diff] [blame] | 3375 | ifeq ($(filter system, $(BOARD_SUPER_PARTITION_PARTITION_LIST)),) |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3376 | BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS += --setup_as_rootfs_from_kernel |
Bowgo Tsai | 9b37760 | 2017-04-14 18:50:11 +0800 | [diff] [blame] | 3377 | endif |
David Anderson | 8916a2a | 2018-09-18 15:46:59 -0700 | [diff] [blame] | 3378 | endif |
Bowgo Tsai | 9b37760 | 2017-04-14 18:50:11 +0800 | [diff] [blame] | 3379 | |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3380 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --padding_size 4096 |
David Anderson | 7709ab2 | 2018-10-15 14:41:34 -0700 | [diff] [blame] | 3381 | BOARD_AVB_MAKE_VBMETA_SYSTEM_IMAGE_ARGS += --padding_size 4096 |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3382 | BOARD_AVB_MAKE_VBMETA_VENDOR_IMAGE_ARGS += --padding_size 4096 |
| 3383 | |
| 3384 | ifeq (eng,$(filter eng, $(TARGET_BUILD_VARIANT))) |
Tao Bao | 240dcb8 | 2018-10-22 13:02:53 -0700 | [diff] [blame] | 3385 | # We only need the flag in top-level vbmeta.img. |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3386 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --set_hashtree_disabled_flag |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3387 | endif |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3388 | |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3389 | ifdef BOARD_AVB_ROLLBACK_INDEX |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3390 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --rollback_index $(BOARD_AVB_ROLLBACK_INDEX) |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3391 | endif |
| 3392 | |
David Anderson | 7709ab2 | 2018-10-15 14:41:34 -0700 | [diff] [blame] | 3393 | ifdef BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX |
| 3394 | BOARD_AVB_MAKE_VBMETA_SYSTEM_IMAGE_ARGS += \ |
| 3395 | --rollback_index $(BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX) |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3396 | endif |
| 3397 | |
| 3398 | ifdef BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX |
| 3399 | BOARD_AVB_MAKE_VBMETA_VENDOR_IMAGE_ARGS += \ |
| 3400 | --rollback_index $(BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX) |
John Reck | 0588b43 | 2018-05-03 13:20:01 -0700 | [diff] [blame] | 3401 | endif |
| 3402 | |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3403 | # $(1): the directory to extract public keys to |
| 3404 | define extract-avb-chain-public-keys |
| 3405 | $(if $(BOARD_AVB_BOOT_KEY_PATH),\ |
| 3406 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_BOOT_KEY_PATH) \ |
| 3407 | --output $(1)/boot.avbpubkey) |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 3408 | $(if $(BOARD_AVB_VENDOR_BOOT_KEY_PATH),\ |
| 3409 | $(AVBTOOL) extract_public_key --key $(BOARD_AVB_VENDOR_BOOT_KEY_PATH) \ |
| 3410 | --output $(1)/vendor_boot.avbpubkey) |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3411 | $(if $(BOARD_AVB_SYSTEM_KEY_PATH),\ |
| 3412 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_SYSTEM_KEY_PATH) \ |
| 3413 | --output $(1)/system.avbpubkey) |
| 3414 | $(if $(BOARD_AVB_VENDOR_KEY_PATH),\ |
| 3415 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_VENDOR_KEY_PATH) \ |
| 3416 | --output $(1)/vendor.avbpubkey) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3417 | $(if $(BOARD_AVB_PRODUCT_KEY_PATH),\ |
| 3418 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_PRODUCT_KEY_PATH) \ |
| 3419 | --output $(1)/product.avbpubkey) |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3420 | $(if $(BOARD_AVB_SYSTEM_EXT_KEY_PATH),\ |
| 3421 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_SYSTEM_EXT_KEY_PATH) \ |
| 3422 | --output $(1)/system_ext.avbpubkey) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3423 | $(if $(BOARD_AVB_ODM_KEY_PATH),\ |
| 3424 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_ODM_KEY_PATH) \ |
| 3425 | --output $(1)/odm.avbpubkey) |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3426 | $(if $(BOARD_AVB_DTBO_KEY_PATH),\ |
| 3427 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_DTBO_KEY_PATH) \ |
| 3428 | --output $(1)/dtbo.avbpubkey) |
David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 3429 | $(if $(BOARD_AVB_RECOVERY_KEY_PATH),\ |
| 3430 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_RECOVERY_KEY_PATH) \ |
| 3431 | --output $(1)/recovery.avbpubkey) |
David Anderson | 7709ab2 | 2018-10-15 14:41:34 -0700 | [diff] [blame] | 3432 | $(if $(BOARD_AVB_VBMETA_SYSTEM_KEY_PATH),\ |
| 3433 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_VBMETA_SYSTEM_KEY_PATH) \ |
| 3434 | --output $(1)/vbmeta_system.avbpubkey) |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3435 | $(if $(BOARD_AVB_VBMETA_VENDOR_KEY_PATH),\ |
| 3436 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_VBMETA_VENDOR_KEY_PATH) \ |
| 3437 | --output $(1)/vbmeta_vendor.avbpubkey) |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3438 | endef |
| 3439 | |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3440 | # Builds a chained VBMeta image. This VBMeta image will contain the descriptors for the partitions |
| 3441 | # specified in BOARD_AVB_VBMETA_<NAME>. The built VBMeta image will be included into the top-level |
David Anderson | 7709ab2 | 2018-10-15 14:41:34 -0700 | [diff] [blame] | 3442 | # vbmeta image as a chained partition. For example, if a target defines `BOARD_AVB_VBMETA_SYSTEM |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3443 | # := system system_ext`, `vbmeta_system.img` will be created that includes the descriptors for |
| 3444 | # `system.img` and `system_ext.img`. `vbmeta_system.img` itself will be included into |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3445 | # `vbmeta.img` as a chained partition. |
David Anderson | 7709ab2 | 2018-10-15 14:41:34 -0700 | [diff] [blame] | 3446 | # $(1): VBMeta image name, such as "vbmeta_system", "vbmeta_vendor" etc. |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3447 | # $(2): Output filename. |
| 3448 | define build-chained-vbmeta-image |
| 3449 | $(call pretty,"Target chained vbmeta image: $@") |
| 3450 | $(hide) $(AVBTOOL) make_vbmeta_image \ |
| 3451 | $(INTERNAL_AVB_$(call to-upper,$(1))_SIGNING_ARGS) \ |
| 3452 | $(BOARD_AVB_MAKE_$(call to-upper,$(1))_IMAGE_ARGS) \ |
| 3453 | $(foreach image,$(BOARD_AVB_$(call to-upper,$(1))), \ |
| 3454 | --include_descriptors_from_image $(call images-for-partitions,$(image))) \ |
| 3455 | --output $@ |
| 3456 | endef |
| 3457 | |
Bill Peckham | d52fd9b | 2019-04-16 10:06:13 -0700 | [diff] [blame] | 3458 | ifdef BUILDING_SYSTEM_IMAGE |
David Anderson | 7709ab2 | 2018-10-15 14:41:34 -0700 | [diff] [blame] | 3459 | ifdef BOARD_AVB_VBMETA_SYSTEM |
| 3460 | INSTALLED_VBMETA_SYSTEMIMAGE_TARGET := $(PRODUCT_OUT)/vbmeta_system.img |
| 3461 | $(INSTALLED_VBMETA_SYSTEMIMAGE_TARGET): \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 3462 | $(AVBTOOL) \ |
| 3463 | $(call images-for-partitions,$(BOARD_AVB_VBMETA_SYSTEM)) \ |
| 3464 | $(BOARD_AVB_VBMETA_SYSTEM_KEY_PATH) |
David Anderson | 7709ab2 | 2018-10-15 14:41:34 -0700 | [diff] [blame] | 3465 | $(call build-chained-vbmeta-image,vbmeta_system) |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3466 | endif |
Bill Peckham | d52fd9b | 2019-04-16 10:06:13 -0700 | [diff] [blame] | 3467 | endif # BUILDING_SYSTEM_IMAGE |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3468 | |
| 3469 | ifdef BOARD_AVB_VBMETA_VENDOR |
| 3470 | INSTALLED_VBMETA_VENDORIMAGE_TARGET := $(PRODUCT_OUT)/vbmeta_vendor.img |
| 3471 | $(INSTALLED_VBMETA_VENDORIMAGE_TARGET): \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 3472 | $(AVBTOOL) \ |
| 3473 | $(call images-for-partitions,$(BOARD_AVB_VBMETA_VENDOR)) \ |
| 3474 | $(BOARD_AVB_VBMETA_VENDOR_KEY_PATH) |
Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3475 | $(call build-chained-vbmeta-image,vbmeta_vendor) |
| 3476 | endif |
| 3477 | |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3478 | define build-vbmetaimage-target |
| 3479 | $(call pretty,"Target vbmeta image: $(INSTALLED_VBMETAIMAGE_TARGET)") |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3480 | $(hide) mkdir -p $(AVB_CHAIN_KEY_DIR) |
| 3481 | $(call extract-avb-chain-public-keys, $(AVB_CHAIN_KEY_DIR)) |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3482 | $(hide) $(AVBTOOL) make_vbmeta_image \ |
| 3483 | $(INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS) \ |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3484 | $(PRIVATE_AVB_VBMETA_SIGNING_ARGS) \ |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3485 | $(BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS) \ |
| 3486 | --output $@ |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3487 | $(hide) rm -rf $(AVB_CHAIN_KEY_DIR) |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3488 | endef |
| 3489 | |
Paul Trautrim | 4e14323 | 2019-08-13 16:30:57 +0900 | [diff] [blame] | 3490 | ifdef BUILDING_VBMETA_IMAGE |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3491 | INSTALLED_VBMETAIMAGE_TARGET := $(BUILT_VBMETAIMAGE_TARGET) |
Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 3492 | $(INSTALLED_VBMETAIMAGE_TARGET): PRIVATE_AVB_VBMETA_SIGNING_ARGS := \ |
| 3493 | --algorithm $(BOARD_AVB_ALGORITHM) --key $(BOARD_AVB_KEY_PATH) |
| 3494 | |
David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 3495 | $(INSTALLED_VBMETAIMAGE_TARGET): \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 3496 | $(AVBTOOL) \ |
| 3497 | $(INSTALLED_BOOTIMAGE_TARGET) \ |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 3498 | $(INSTALLED_VENDOR_BOOTIMAGE_TARGET) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 3499 | $(INSTALLED_SYSTEMIMAGE_TARGET) \ |
| 3500 | $(INSTALLED_VENDORIMAGE_TARGET) \ |
| 3501 | $(INSTALLED_PRODUCTIMAGE_TARGET) \ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 3502 | $(INSTALLED_SYSTEM_EXTIMAGE_TARGET) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 3503 | $(INSTALLED_ODMIMAGE_TARGET) \ |
| 3504 | $(INSTALLED_DTBOIMAGE_TARGET) \ |
| 3505 | $(INSTALLED_RECOVERYIMAGE_TARGET) \ |
| 3506 | $(INSTALLED_VBMETA_SYSTEMIMAGE_TARGET) \ |
| 3507 | $(INSTALLED_VBMETA_VENDORIMAGE_TARGET) \ |
| 3508 | $(BOARD_AVB_VBMETA_SYSTEM_KEY_PATH) \ |
| 3509 | $(BOARD_AVB_VBMETA_VENDOR_KEY_PATH) \ |
| 3510 | $(BOARD_AVB_KEY_PATH) |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3511 | $(build-vbmetaimage-target) |
| 3512 | |
| 3513 | .PHONY: vbmetaimage-nodeps |
Bowgo Tsai | 6a4eaa5 | 2019-12-09 15:48:09 +0800 | [diff] [blame] | 3514 | vbmetaimage-nodeps: PRIVATE_AVB_VBMETA_SIGNING_ARGS := \ |
| 3515 | --algorithm $(BOARD_AVB_ALGORITHM) --key $(BOARD_AVB_KEY_PATH) |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3516 | vbmetaimage-nodeps: |
| 3517 | $(build-vbmetaimage-target) |
Paul Trautrim | 4e14323 | 2019-08-13 16:30:57 +0900 | [diff] [blame] | 3518 | endif # BUILDING_VBMETA_IMAGE |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3519 | |
Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 3520 | endif # BOARD_AVB_ENABLE |
| 3521 | |
| 3522 | # ----------------------------------------------------------------- |
Yifan Hong | bcd46bc | 2020-01-14 21:35:45 +0000 | [diff] [blame] | 3523 | # Check VINTF of build |
| 3524 | |
| 3525 | ifndef TARGET_BUILD_APPS |
| 3526 | intermediates := $(call intermediates-dir-for,PACKAGING,check_vintf_all) |
| 3527 | check_vintf_all_deps := |
| 3528 | |
Yifan Hong | af9b070 | 2020-01-21 12:46:57 -0800 | [diff] [blame] | 3529 | # The build system only writes VINTF metadata to */etc/vintf paths. Legacy paths aren't needed here |
| 3530 | # because they are only used for prebuilt images. |
| 3531 | check_vintf_common_srcs_patterns := \ |
| 3532 | $(TARGET_OUT)/etc/vintf/% \ |
| 3533 | $(TARGET_OUT_VENDOR)/etc/vintf/% \ |
| 3534 | $(TARGET_OUT_ODM)/etc/vintf/% \ |
| 3535 | $(TARGET_OUT_PRODUCT)/etc/vintf/% \ |
| 3536 | $(TARGET_OUT_SYSTEM_EXT)/etc/vintf/% \ |
| 3537 | |
| 3538 | check_vintf_common_srcs := $(sort $(filter $(check_vintf_common_srcs_patterns), \ |
| 3539 | $(INTERNAL_SYSTEMIMAGE_FILES) \ |
| 3540 | $(INTERNAL_VENDORIMAGE_FILES) \ |
| 3541 | $(INTERNAL_ODMIMAGE_FILES) \ |
| 3542 | $(INTERNAL_PRODUCTIMAGE_FILES) \ |
| 3543 | $(INTERNAL_SYSTEM_EXTIMAGE_FILES) \ |
| 3544 | )) |
| 3545 | check_vintf_common_srcs_patterns := |
| 3546 | |
| 3547 | check_vintf_has_system := |
| 3548 | check_vintf_has_vendor := |
| 3549 | |
Yifan Hong | 605ea04 | 2020-01-14 21:36:00 +0000 | [diff] [blame] | 3550 | # -- Check system manifest / matrix including fragments (excluding other framework manifests / matrices, e.g. product); |
Yifan Hong | af9b070 | 2020-01-21 12:46:57 -0800 | [diff] [blame] | 3551 | check_vintf_system_deps := $(filter $(TARGET_OUT)/etc/vintf/%, $(check_vintf_common_srcs)) |
| 3552 | ifneq ($(check_vintf_system_deps),) |
| 3553 | check_vintf_has_system := true |
Yifan Hong | 605ea04 | 2020-01-14 21:36:00 +0000 | [diff] [blame] | 3554 | check_vintf_system_log := $(intermediates)/check_vintf_system_log |
| 3555 | check_vintf_all_deps += $(check_vintf_system_log) |
Yifan Hong | af9b070 | 2020-01-21 12:46:57 -0800 | [diff] [blame] | 3556 | $(check_vintf_system_log): $(HOST_OUT_EXECUTABLES)/checkvintf $(check_vintf_system_deps) |
Yifan Hong | 605ea04 | 2020-01-14 21:36:00 +0000 | [diff] [blame] | 3557 | @( $< --check-one --dirmap /system:$(TARGET_OUT) > $@ 2>&1 ) || ( cat $@ && exit 1 ) |
| 3558 | check_vintf_system_log := |
Yifan Hong | af9b070 | 2020-01-21 12:46:57 -0800 | [diff] [blame] | 3559 | endif # check_vintf_system_deps |
| 3560 | check_vintf_system_deps := |
Yifan Hong | 605ea04 | 2020-01-14 21:36:00 +0000 | [diff] [blame] | 3561 | |
| 3562 | # -- Check vendor manifest / matrix including fragments (excluding other device manifests / matrices) |
Yifan Hong | af9b070 | 2020-01-21 12:46:57 -0800 | [diff] [blame] | 3563 | check_vintf_vendor_deps := $(filter $(TARGET_OUT_VENDOR)/etc/vintf/%, $(check_vintf_common_srcs)) |
| 3564 | ifneq ($(check_vintf_vendor_deps),) |
| 3565 | check_vintf_has_vendor := true |
Yifan Hong | 605ea04 | 2020-01-14 21:36:00 +0000 | [diff] [blame] | 3566 | check_vintf_vendor_log := $(intermediates)/check_vintf_vendor_log |
| 3567 | check_vintf_all_deps += $(check_vintf_vendor_log) |
Yifan Hong | af9b070 | 2020-01-21 12:46:57 -0800 | [diff] [blame] | 3568 | $(check_vintf_vendor_log): $(HOST_OUT_EXECUTABLES)/checkvintf $(check_vintf_vendor_deps) |
Yifan Hong | 605ea04 | 2020-01-14 21:36:00 +0000 | [diff] [blame] | 3569 | @( $< --check-one --dirmap /vendor:$(TARGET_OUT_VENDOR) > $@ 2>&1 ) || ( cat $@ && exit 1 ) |
| 3570 | check_vintf_vendor_log := |
Yifan Hong | af9b070 | 2020-01-21 12:46:57 -0800 | [diff] [blame] | 3571 | endif # check_vintf_vendor_deps |
| 3572 | check_vintf_vendor_deps := |
Yifan Hong | 605ea04 | 2020-01-14 21:36:00 +0000 | [diff] [blame] | 3573 | |
Yifan Hong | bcd46bc | 2020-01-14 21:35:45 +0000 | [diff] [blame] | 3574 | # -- Check VINTF compatibility of build. |
| 3575 | # Skip partial builds; only check full builds. Only check if: |
| 3576 | # - PRODUCT_ENFORCE_VINTF_MANIFEST is true |
Yifan Hong | af9b070 | 2020-01-21 12:46:57 -0800 | [diff] [blame] | 3577 | # - system / vendor VINTF metadata exists |
Yifan Hong | bcd46bc | 2020-01-14 21:35:45 +0000 | [diff] [blame] | 3578 | # - Building product / system_ext / odm images if board has product / system_ext / odm images |
| 3579 | ifeq ($(PRODUCT_ENFORCE_VINTF_MANIFEST),true) |
Yifan Hong | af9b070 | 2020-01-21 12:46:57 -0800 | [diff] [blame] | 3580 | ifeq ($(check_vintf_has_system),true) |
| 3581 | ifeq ($(check_vintf_has_vendor),true) |
Yifan Hong | bcd46bc | 2020-01-14 21:35:45 +0000 | [diff] [blame] | 3582 | ifeq ($(filter true,$(BUILDING_ODM_IMAGE)),$(filter true,$(BOARD_USES_ODMIMAGE))) |
| 3583 | ifeq ($(filter true,$(BUILDING_PRODUCT_IMAGE)),$(filter true,$(BOARD_USES_PRODUCTIMAGE))) |
| 3584 | ifeq ($(filter true,$(BUILDING_SYSTEM_EXT_IMAGE)),$(filter true,$(BOARD_USES_SYSTEM_EXTIMAGE))) |
| 3585 | |
| 3586 | check_vintf_compatible_log := $(intermediates)/check_vintf_compatible_log |
| 3587 | check_vintf_all_deps += $(check_vintf_compatible_log) |
| 3588 | |
| 3589 | check_vintf_compatible_args := |
Yifan Hong | af9b070 | 2020-01-21 12:46:57 -0800 | [diff] [blame] | 3590 | check_vintf_compatible_deps := $(check_vintf_common_srcs) |
Yifan Hong | bcd46bc | 2020-01-14 21:35:45 +0000 | [diff] [blame] | 3591 | |
| 3592 | # -- Kernel version and configurations. |
| 3593 | ifeq ($(PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS),true) |
| 3594 | |
Yifan Hong | 605ea04 | 2020-01-14 21:36:00 +0000 | [diff] [blame] | 3595 | BUILT_KERNEL_CONFIGS_FILE := $(intermediates)/kernel_configs.txt |
| 3596 | BUILT_KERNEL_VERSION_FILE := $(intermediates)/kernel_version.txt |
| 3597 | |
| 3598 | my_board_extracted_kernel := |
| 3599 | |
| 3600 | # BOARD_KERNEL_CONFIG_FILE and BOARD_KERNEL_VERSION can be used to override the values extracted |
| 3601 | # from INSTALLED_KERNEL_TARGET. |
| 3602 | ifdef BOARD_KERNEL_CONFIG_FILE |
| 3603 | ifdef BOARD_KERNEL_VERSION |
| 3604 | $(BUILT_KERNEL_CONFIGS_FILE): $(BOARD_KERNEL_CONFIG_FILE) |
| 3605 | cp $< $@ |
| 3606 | $(BUILT_KERNEL_VERSION_FILE): |
| 3607 | echo $(BOARD_KERNEL_VERSION) > $@ |
| 3608 | |
| 3609 | my_board_extracted_kernel := true |
| 3610 | endif # BOARD_KERNEL_VERSION |
| 3611 | endif # BOARD_KERNEL_CONFIG_FILE |
| 3612 | |
| 3613 | ifneq ($(my_board_extracted_kernel),true) |
| 3614 | ifndef INSTALLED_KERNEL_TARGET |
| 3615 | $(warning No INSTALLED_KERNEL_TARGET is defined when PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS \ |
| 3616 | is true. Information about the updated kernel cannot be built into OTA update package. \ |
| 3617 | You can fix this by: (1) setting TARGET_NO_KERNEL to false and installing the built kernel \ |
| 3618 | to $(PRODUCT_OUT)/kernel, so that kernel information will be extracted from the built kernel; \ |
| 3619 | or (2) extracting kernel configuration and defining BOARD_KERNEL_CONFIG_FILE and \ |
| 3620 | BOARD_KERNEL_VERSION manually; or (3) unsetting PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS \ |
| 3621 | manually.) |
| 3622 | else |
| 3623 | |
| 3624 | # Tools for decompression that is not in PATH. |
| 3625 | # Check $(EXTRACT_KERNEL) for decompression algorithms supported by the script. |
| 3626 | # Algorithms that are in the script but not in this list will be found in PATH. |
| 3627 | my_decompress_tools := \ |
| 3628 | lz4:$(HOST_OUT_EXECUTABLES)/lz4 \ |
| 3629 | |
| 3630 | $(BUILT_KERNEL_CONFIGS_FILE): .KATI_IMPLICIT_OUTPUTS := $(BUILT_KERNEL_VERSION_FILE) |
| 3631 | $(BUILT_KERNEL_CONFIGS_FILE): PRIVATE_DECOMPRESS_TOOLS := $(my_decompress_tools) |
| 3632 | $(BUILT_KERNEL_CONFIGS_FILE): $(foreach pair,$(my_decompress_tools),$(call word-colon,2,$(pair))) |
| 3633 | $(BUILT_KERNEL_CONFIGS_FILE): $(EXTRACT_KERNEL) $(INSTALLED_KERNEL_TARGET) |
| 3634 | $< --tools $(PRIVATE_DECOMPRESS_TOOLS) --input $(INSTALLED_KERNEL_TARGET) \ |
| 3635 | --output-configs $@ \ |
| 3636 | --output-version $(BUILT_KERNEL_VERSION_FILE) |
| 3637 | |
| 3638 | my_decompress_tools := |
| 3639 | |
| 3640 | endif # my_board_extracted_kernel |
| 3641 | my_board_extracted_kernel := |
| 3642 | |
| 3643 | endif # INSTALLED_KERNEL_TARGET |
| 3644 | |
Yifan Hong | bcd46bc | 2020-01-14 21:35:45 +0000 | [diff] [blame] | 3645 | check_vintf_compatible_args += --kernel $$(cat $(BUILT_KERNEL_VERSION_FILE)):$(BUILT_KERNEL_CONFIGS_FILE) |
| 3646 | check_vintf_compatible_deps += $(BUILT_KERNEL_CONFIGS_FILE) $(BUILT_KERNEL_VERSION_FILE) |
| 3647 | |
| 3648 | endif # PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS |
| 3649 | |
Yifan Hong | bcd46bc | 2020-01-14 21:35:45 +0000 | [diff] [blame] | 3650 | check_vintf_compatible_args += \ |
| 3651 | --dirmap /system:$(TARGET_OUT) \ |
| 3652 | --dirmap /vendor:$(TARGET_OUT_VENDOR) \ |
| 3653 | --dirmap /odm:$(TARGET_OUT_ODM) \ |
| 3654 | --dirmap /product:$(TARGET_OUT_PRODUCT) \ |
| 3655 | --dirmap /system_ext:$(TARGET_OUT_SYSTEM_EXT) \ |
| 3656 | |
| 3657 | ifdef PRODUCT_SHIPPING_API_LEVEL |
| 3658 | check_vintf_compatible_args += --property ro.product.first_api_level=$(PRODUCT_SHIPPING_API_LEVEL) |
| 3659 | endif # PRODUCT_SHIPPING_API_LEVEL |
| 3660 | |
| 3661 | $(check_vintf_compatible_log): PRIVATE_CHECK_VINTF_ARGS := $(check_vintf_compatible_args) |
| 3662 | $(check_vintf_compatible_log): PRIVATE_CHECK_VINTF_DEPS := $(check_vintf_compatible_deps) |
| 3663 | $(check_vintf_compatible_log): $(HOST_OUT_EXECUTABLES)/checkvintf $(check_vintf_compatible_deps) |
| 3664 | @echo -n -e 'Deps: \n ' > $@ |
| 3665 | @sed 's/ /\n /g' <<< "$(PRIVATE_CHECK_VINTF_DEPS)" >> $@ |
| 3666 | @echo -n -e 'Args: \n ' >> $@ |
| 3667 | @cat <<< "$(PRIVATE_CHECK_VINTF_ARGS)" >> $@ |
| 3668 | @echo -n -e 'For empty SKU:' >> $@ |
| 3669 | @( $< --check-compat $(PRIVATE_CHECK_VINTF_ARGS) >> $@ 2>&1 ) || ( cat $@ && exit 1 ) |
| 3670 | $(foreach sku,$(ODM_MANIFEST_SKUS), \ |
| 3671 | echo "For SKU = $(sku):" >> $@; \ |
| 3672 | ( $< --check-compat $(PRIVATE_CHECK_VINTF_ARGS) \ |
| 3673 | --property ro.boot.product.hardware.sku=$(sku) >> $@ 2>&1 ) || ( cat $@ && exit 1 ); ) |
| 3674 | |
| 3675 | check_vintf_compatible_log := |
| 3676 | check_vintf_compatible_args := |
| 3677 | check_vintf_compatible_deps := |
| 3678 | |
| 3679 | endif # BUILDING_SYSTEM_EXT_IMAGE equals BOARD_USES_SYSTEM_EXTIMAGE |
| 3680 | endif # BUILDING_PRODUCT_IMAGE equals BOARD_USES_PRODUCTIMAGE |
| 3681 | endif # BUILDING_ODM_IMAGE equals BOARD_USES_ODMIMAGE |
Yifan Hong | af9b070 | 2020-01-21 12:46:57 -0800 | [diff] [blame] | 3682 | endif # check_vintf_has_vendor |
| 3683 | endif # check_vintf_has_system |
Yifan Hong | bcd46bc | 2020-01-14 21:35:45 +0000 | [diff] [blame] | 3684 | endif # PRODUCT_ENFORCE_VINTF_MANIFEST |
| 3685 | |
| 3686 | # Add all logs of VINTF checks to dist builds |
| 3687 | droid_targets: $(check_vintf_all_deps) |
| 3688 | $(call dist-for-goals, droid_targets, $(check_vintf_all_deps)) |
| 3689 | |
| 3690 | # Helper alias to check all VINTF of current build. |
| 3691 | .PHONY: check-vintf-all |
| 3692 | check-vintf-all: $(check_vintf_all_deps) |
| 3693 | $(foreach file,$^,echo "$(file)"; cat "$(file)"; echo;) |
| 3694 | |
Yifan Hong | af9b070 | 2020-01-21 12:46:57 -0800 | [diff] [blame] | 3695 | check_vintf_has_vendor := |
| 3696 | check_vintf_has_system := |
| 3697 | check_vintf_common_srcs := |
Yifan Hong | bcd46bc | 2020-01-14 21:35:45 +0000 | [diff] [blame] | 3698 | check_vintf_all_deps := |
| 3699 | intermediates := |
| 3700 | endif # !TARGET_BUILD_APPS |
| 3701 | |
| 3702 | # ----------------------------------------------------------------- |
Yifan Hong | 055e6cf | 2018-11-29 13:51:48 -0800 | [diff] [blame] | 3703 | # Check image sizes <= size of super partition |
| 3704 | |
| 3705 | ifeq (,$(TARGET_BUILD_APPS)) |
| 3706 | # Do not check for apps-only build |
| 3707 | |
| 3708 | ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION)) |
Yifan Hong | 37c0c7c | 2018-07-24 17:45:08 -0700 | [diff] [blame] | 3709 | |
Yifan Hong | 3a7c2ef | 2019-11-01 18:23:19 +0000 | [diff] [blame] | 3710 | # $(1): misc_info.txt |
Yifan Hong | 3091093 | 2019-10-25 20:36:55 -0700 | [diff] [blame] | 3711 | # #(2): optional log file |
Yifan Hong | b43012f | 2018-10-01 17:30:01 -0700 | [diff] [blame] | 3712 | define check-all-partition-sizes-target |
Yifan Hong | 3a7c2ef | 2019-11-01 18:23:19 +0000 | [diff] [blame] | 3713 | mkdir -p $(dir $(1)) |
| 3714 | rm -f $(1) |
| 3715 | $(call dump-super-image-info, $(1)) |
| 3716 | $(foreach partition,$(BOARD_SUPER_PARTITION_PARTITION_LIST), \ |
| 3717 | echo "$(partition)_image="$(call images-for-partitions,$(partition)) >> $(1);) |
Yifan Hong | 3091093 | 2019-10-25 20:36:55 -0700 | [diff] [blame] | 3718 | $(CHECK_PARTITION_SIZES) $(if $(2),--logfile $(2),-v) $(1) |
Yifan Hong | b43012f | 2018-10-01 17:30:01 -0700 | [diff] [blame] | 3719 | endef |
| 3720 | |
Yifan Hong | 3091093 | 2019-10-25 20:36:55 -0700 | [diff] [blame] | 3721 | check_all_partition_sizes_log := $(call intermediates-dir-for,PACKAGING,check-all-partition-sizes)/check_all_partition_sizes_log |
| 3722 | droid_targets: $(check_all_partition_sizes_log) |
| 3723 | $(call dist-for-goals, droid_targets, $(check_all_partition_sizes_log)) |
Colin Cross | 606c9f4 | 2019-05-17 15:51:39 -0700 | [diff] [blame] | 3724 | |
Yifan Hong | 3091093 | 2019-10-25 20:36:55 -0700 | [diff] [blame] | 3725 | $(check_all_partition_sizes_log): \ |
| 3726 | $(CHECK_PARTITION_SIZES) \ |
| 3727 | $(call images-for-partitions,$(BOARD_SUPER_PARTITION_PARTITION_LIST)) |
| 3728 | $(call check-all-partition-sizes-target, \ |
| 3729 | $(call intermediates-dir-for,PACKAGING,check-all-partition-sizes)/misc_info.txt, \ |
| 3730 | $@) |
| 3731 | |
| 3732 | .PHONY: check-all-partition-sizes |
| 3733 | check-all-partition-sizes: $(check_all_partition_sizes_log) |
| 3734 | |
| 3735 | .PHONY: check-all-partition-sizes-nodeps |
Colin Cross | 606c9f4 | 2019-05-17 15:51:39 -0700 | [diff] [blame] | 3736 | check-all-partition-sizes-nodeps: |
Yifan Hong | 3a7c2ef | 2019-11-01 18:23:19 +0000 | [diff] [blame] | 3737 | $(call check-all-partition-sizes-target, \ |
| 3738 | $(call intermediates-dir-for,PACKAGING,check-all-partition-sizes-nodeps)/misc_info.txt) |
Yifan Hong | b43012f | 2018-10-01 17:30:01 -0700 | [diff] [blame] | 3739 | |
Yifan Hong | 2dae572 | 2018-07-31 12:47:27 -0700 | [diff] [blame] | 3740 | endif # PRODUCT_BUILD_SUPER_PARTITION |
Yifan Hong | 17dd45d | 2018-07-20 16:45:57 -0700 | [diff] [blame] | 3741 | |
| 3742 | endif # TARGET_BUILD_APPS |
| 3743 | |
| 3744 | # ----------------------------------------------------------------- |
Greg Hartman | 2ebfef4 | 2014-11-04 21:17:06 -0800 | [diff] [blame] | 3745 | # bring in the installer image generation defines if necessary |
| 3746 | ifeq ($(TARGET_USE_DISKINSTALLER),true) |
| 3747 | include bootable/diskinstaller/config.mk |
| 3748 | endif |
| 3749 | |
| 3750 | # ----------------------------------------------------------------- |
Colin Cross | c312f31 | 2012-04-19 13:54:39 -0700 | [diff] [blame] | 3751 | # host tools needed to build dist and OTA packages |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3752 | |
Ying Wang | bd2d024 | 2015-09-22 11:17:52 -0700 | [diff] [blame] | 3753 | ifeq ($(BUILD_OS),darwin) |
Bowgo Tsai | d6ff897 | 2018-10-09 15:46:25 +0800 | [diff] [blame] | 3754 | build_ota_package := false |
| 3755 | build_otatools_package := false |
| 3756 | else |
Tao Bao | 9be20c7 | 2019-04-08 21:11:59 -0700 | [diff] [blame] | 3757 | # Set build_ota_package, and allow opt-out below. |
Bowgo Tsai | d6ff897 | 2018-10-09 15:46:25 +0800 | [diff] [blame] | 3758 | build_ota_package := true |
| 3759 | ifeq ($(TARGET_SKIP_OTA_PACKAGE),true) |
| 3760 | build_ota_package := false |
| 3761 | endif |
Evgenii Stepanov | 5d06f24 | 2018-11-14 14:12:10 -0800 | [diff] [blame] | 3762 | ifneq (,$(filter address, $(SANITIZE_TARGET))) |
Bowgo Tsai | d6ff897 | 2018-10-09 15:46:25 +0800 | [diff] [blame] | 3763 | build_ota_package := false |
| 3764 | endif |
| 3765 | ifeq ($(TARGET_PRODUCT),sdk) |
| 3766 | build_ota_package := false |
| 3767 | endif |
Bowgo Tsai | d6ff897 | 2018-10-09 15:46:25 +0800 | [diff] [blame] | 3768 | ifeq ($(TARGET_BUILD_PDK),true) |
| 3769 | build_ota_package := false |
| 3770 | endif |
Tao Bao | 9be20c7 | 2019-04-08 21:11:59 -0700 | [diff] [blame] | 3771 | ifneq ($(PRODUCT_BUILD_GENERIC_OTA_PACKAGE),true) |
| 3772 | ifneq ($(filter generic%,$(TARGET_DEVICE)),) |
| 3773 | build_ota_package := false |
| 3774 | endif |
| 3775 | ifeq ($(TARGET_NO_KERNEL),true) |
| 3776 | build_ota_package := false |
| 3777 | endif |
| 3778 | ifeq ($(recovery_fstab),) |
| 3779 | build_ota_package := false |
| 3780 | endif |
| 3781 | endif # PRODUCT_BUILD_GENERIC_OTA_PACKAGE |
Bowgo Tsai | d6ff897 | 2018-10-09 15:46:25 +0800 | [diff] [blame] | 3782 | |
Tao Bao | 9be20c7 | 2019-04-08 21:11:59 -0700 | [diff] [blame] | 3783 | # Set build_otatools_package, and allow opt-out below. |
Bowgo Tsai | d6ff897 | 2018-10-09 15:46:25 +0800 | [diff] [blame] | 3784 | build_otatools_package := true |
| 3785 | ifeq ($(TARGET_SKIP_OTATOOLS_PACKAGE),true) |
| 3786 | build_otatools_package := false |
| 3787 | endif |
Colin Cross | 481cc5a | 2016-02-04 15:09:23 -0800 | [diff] [blame] | 3788 | endif |
Ying Wang | bd2d024 | 2015-09-22 11:17:52 -0700 | [diff] [blame] | 3789 | |
Bowgo Tsai | d6ff897 | 2018-10-09 15:46:25 +0800 | [diff] [blame] | 3790 | ifeq ($(build_otatools_package),true) |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3791 | |
| 3792 | INTERNAL_OTATOOLS_MODULES := \ |
changho.shin | 0f12536 | 2019-07-08 10:59:00 +0900 | [diff] [blame] | 3793 | aapt2 \ |
Tao Bao | c1966a8 | 2019-06-25 11:42:12 -0700 | [diff] [blame] | 3794 | add_img_to_target_files \ |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3795 | append2simg \ |
| 3796 | avbtool \ |
| 3797 | blk_alloc_to_base_fs \ |
| 3798 | boot_signer \ |
| 3799 | brillo_update_payload \ |
| 3800 | brotli \ |
| 3801 | bsdiff \ |
Tao Bao | 2bbb07c | 2019-05-07 13:12:21 -0700 | [diff] [blame] | 3802 | build_image \ |
| 3803 | build_super_image \ |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3804 | build_verity_metadata \ |
| 3805 | build_verity_tree \ |
| 3806 | care_map_generator \ |
Tao Bao | c1966a8 | 2019-06-25 11:42:12 -0700 | [diff] [blame] | 3807 | check_ota_package_signature \ |
| 3808 | check_target_files_signatures \ |
Yifan Hong | e3ba82c | 2019-08-21 13:29:30 -0700 | [diff] [blame] | 3809 | check_target_files_vintf \ |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3810 | checkvintf \ |
| 3811 | delta_generator \ |
| 3812 | e2fsck \ |
| 3813 | e2fsdroid \ |
| 3814 | fc_sort \ |
| 3815 | fec \ |
| 3816 | fs_config \ |
| 3817 | generate_verity_key \ |
| 3818 | img2simg \ |
Tao Bao | c1966a8 | 2019-06-25 11:42:12 -0700 | [diff] [blame] | 3819 | img_from_target_files \ |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3820 | imgdiff \ |
| 3821 | libconscrypt_openjdk_jni \ |
| 3822 | lpmake \ |
Isaac Chen | eec4a7c | 2019-06-25 11:50:58 +0800 | [diff] [blame] | 3823 | lpunpack \ |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3824 | make_f2fs \ |
Tao Bao | c1966a8 | 2019-06-25 11:42:12 -0700 | [diff] [blame] | 3825 | merge_target_files \ |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3826 | minigzip \ |
Isaac Chen | 9e09d47 | 2019-07-05 17:30:41 +0800 | [diff] [blame] | 3827 | mk_combined_img \ |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3828 | mkbootfs \ |
| 3829 | mkbootimg \ |
| 3830 | mke2fs \ |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3831 | mkf2fsuserimg.sh \ |
| 3832 | mksquashfs \ |
| 3833 | mksquashfsimage.sh \ |
| 3834 | mkuserimg_mke2fs \ |
Tao Bao | 8821d64 | 2019-08-05 12:05:45 -0700 | [diff] [blame] | 3835 | ota_from_target_files \ |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3836 | sefcontext_compile \ |
Isaac Chen | 9e09d47 | 2019-07-05 17:30:41 +0800 | [diff] [blame] | 3837 | sgdisk \ |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3838 | shflags \ |
Tao Bao | c1966a8 | 2019-06-25 11:42:12 -0700 | [diff] [blame] | 3839 | sign_apex \ |
| 3840 | sign_target_files_apks \ |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3841 | signapk \ |
| 3842 | simg2img \ |
| 3843 | sload_f2fs \ |
| 3844 | tune2fs \ |
Daniel Mentz | 30652b3 | 2020-01-04 15:18:09 -0800 | [diff] [blame] | 3845 | unpack_bootimg \ |
Tianjie Xu | 4e5591f | 2019-06-11 14:35:59 -0700 | [diff] [blame] | 3846 | update_host_simulator \ |
Tao Bao | c1966a8 | 2019-06-25 11:42:12 -0700 | [diff] [blame] | 3847 | validate_target_files \ |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3848 | verity_signer \ |
| 3849 | verity_verifier \ |
| 3850 | zipalign \ |
Tao Bao | 5e04c38 | 2017-02-22 16:38:19 -0800 | [diff] [blame] | 3851 | |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 3852 | ifeq (true,$(PRODUCT_SUPPORTS_VBOOT)) |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3853 | INTERNAL_OTATOOLS_MODULES += \ |
| 3854 | futility \ |
| 3855 | vboot_signer |
Tao Bao | 5e04c38 | 2017-02-22 16:38:19 -0800 | [diff] [blame] | 3856 | endif |
Tao Bao | f8e6fbe | 2016-01-04 09:57:32 -0800 | [diff] [blame] | 3857 | |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3858 | INTERNAL_OTATOOLS_FILES := \ |
| 3859 | $(filter $(HOST_OUT)/%,$(call module-installed-files,$(INTERNAL_OTATOOLS_MODULES))) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3860 | |
Ying Wang | 0689866 | 2010-06-17 17:52:18 -0700 | [diff] [blame] | 3861 | .PHONY: otatools |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3862 | otatools: $(INTERNAL_OTATOOLS_FILES) |
Ying Wang | 0689866 | 2010-06-17 17:52:18 -0700 | [diff] [blame] | 3863 | |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3864 | # For each module, recursively resolve its host shared library dependencies. Then we have a full |
| 3865 | # list of modules whose installed files need to be packed. |
| 3866 | INTERNAL_OTATOOLS_MODULES_WITH_DEPS := \ |
| 3867 | $(sort $(INTERNAL_OTATOOLS_MODULES) \ |
| 3868 | $(foreach m,$(INTERNAL_OTATOOLS_MODULES),$(call get-all-shared-libs-deps,$(m)))) |
Doug Zongker | f22b0f4 | 2014-08-22 08:04:58 -0700 | [diff] [blame] | 3869 | |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3870 | INTERNAL_OTATOOLS_PACKAGE_FILES := \ |
| 3871 | $(filter $(HOST_OUT)/%,$(call module-installed-files,$(INTERNAL_OTATOOLS_MODULES_WITH_DEPS))) |
| 3872 | |
| 3873 | INTERNAL_OTATOOLS_PACKAGE_FILES += \ |
| 3874 | $(sort $(shell find build/make/target/product/security -type f -name "*.x509.pem" -o \ |
| 3875 | -name "*.pk8" -o -name verity_key)) |
Tao Bao | 93ab844 | 2018-10-12 11:03:04 -0700 | [diff] [blame] | 3876 | |
| 3877 | ifneq (,$(wildcard device)) |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3878 | INTERNAL_OTATOOLS_PACKAGE_FILES += \ |
Dan Willemsen | 60c6644 | 2018-05-01 19:07:27 -0700 | [diff] [blame] | 3879 | $(sort $(shell find device $(wildcard vendor) -type f -name "*.pk8" -o -name "verifiedboot*" -o \ |
Baligh Uddin | df238b4 | 2019-07-29 21:12:37 -0700 | [diff] [blame] | 3880 | -name "*.pem" -o -name "oem*.prop" -o -name "*.avbpubkey")) |
Tao Bao | 93ab844 | 2018-10-12 11:03:04 -0700 | [diff] [blame] | 3881 | endif |
| 3882 | ifneq (,$(wildcard external/avb)) |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3883 | INTERNAL_OTATOOLS_PACKAGE_FILES += \ |
Tao Bao | 93ab844 | 2018-10-12 11:03:04 -0700 | [diff] [blame] | 3884 | $(sort $(shell find external/avb/test/data -type f -name "testkey_*.pem" -o \ |
| 3885 | -name "atx_metadata.bin")) |
| 3886 | endif |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 3887 | ifeq (true,$(PRODUCT_SUPPORTS_VBOOT)) |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3888 | INTERNAL_OTATOOLS_PACKAGE_FILES += \ |
Tao Bao | 5232f09 | 2018-02-10 04:03:32 +0000 | [diff] [blame] | 3889 | $(sort $(shell find external/vboot_reference/tests/devkeys -type f)) |
Tao Bao | e8ef8f70 | 2017-05-17 11:41:50 -0700 | [diff] [blame] | 3890 | endif |
| 3891 | |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3892 | INTERNAL_OTATOOLS_RELEASETOOLS := \ |
| 3893 | $(sort $(shell find build/make/tools/releasetools -name "*.pyc" -prune -o \ |
| 3894 | \( -type f -o -type l \) -print)) |
| 3895 | |
| 3896 | BUILT_OTATOOLS_PACKAGE := $(PRODUCT_OUT)/otatools.zip |
| 3897 | $(BUILT_OTATOOLS_PACKAGE): PRIVATE_ZIP_ROOT := $(call intermediates-dir-for,PACKAGING,otatools)/otatools |
| 3898 | $(BUILT_OTATOOLS_PACKAGE): PRIVATE_OTATOOLS_PACKAGE_FILES := $(INTERNAL_OTATOOLS_PACKAGE_FILES) |
| 3899 | $(BUILT_OTATOOLS_PACKAGE): PRIVATE_OTATOOLS_RELEASETOOLS := $(INTERNAL_OTATOOLS_RELEASETOOLS) |
| 3900 | $(BUILT_OTATOOLS_PACKAGE): $(INTERNAL_OTATOOLS_PACKAGE_FILES) $(INTERNAL_OTATOOLS_RELEASETOOLS) |
Tao Bao | 57f8ed6 | 2019-08-14 23:08:18 -0700 | [diff] [blame] | 3901 | $(BUILT_OTATOOLS_PACKAGE): $(SOONG_ZIP) $(ZIP2ZIP) |
Doug Zongker | f22b0f4 | 2014-08-22 08:04:58 -0700 | [diff] [blame] | 3902 | @echo "Package OTA tools: $@" |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3903 | rm -rf $@ $(PRIVATE_ZIP_ROOT) |
| 3904 | mkdir -p $(dir $@) |
| 3905 | $(call copy-files-with-structure,$(PRIVATE_OTATOOLS_PACKAGE_FILES),$(HOST_OUT)/,$(PRIVATE_ZIP_ROOT)) |
| 3906 | $(call copy-files-with-structure,$(PRIVATE_OTATOOLS_RELEASETOOLS),build/make/tools/,$(PRIVATE_ZIP_ROOT)) |
Tao Bao | 57f8ed6 | 2019-08-14 23:08:18 -0700 | [diff] [blame] | 3907 | cp $(SOONG_ZIP) $(ZIP2ZIP) $(PRIVATE_ZIP_ROOT)/bin/ |
Tao Bao | 96daeeb | 2019-05-01 21:17:13 -0700 | [diff] [blame] | 3908 | $(SOONG_ZIP) -o $@ -C $(PRIVATE_ZIP_ROOT) -D $(PRIVATE_ZIP_ROOT) |
Doug Zongker | f22b0f4 | 2014-08-22 08:04:58 -0700 | [diff] [blame] | 3909 | |
| 3910 | .PHONY: otatools-package |
| 3911 | otatools-package: $(BUILT_OTATOOLS_PACKAGE) |
| 3912 | |
Bowgo Tsai | d6ff897 | 2018-10-09 15:46:25 +0800 | [diff] [blame] | 3913 | endif # build_otatools_package |
Doug Zongker | f22b0f4 | 2014-08-22 08:04:58 -0700 | [diff] [blame] | 3914 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3915 | # ----------------------------------------------------------------- |
Daniel Norman | e1e4808 | 2019-06-27 13:55:23 -0700 | [diff] [blame] | 3916 | # misc_info.txt |
| 3917 | |
| 3918 | INSTALLED_MISC_INFO_TARGET := $(PRODUCT_OUT)/misc_info.txt |
| 3919 | |
| 3920 | ifeq ($(TARGET_RELEASETOOLS_EXTENSIONS),) |
| 3921 | # default to common dir for device vendor |
| 3922 | tool_extensions := $(TARGET_DEVICE_DIR)/../common |
| 3923 | else |
| 3924 | tool_extensions := $(TARGET_RELEASETOOLS_EXTENSIONS) |
| 3925 | endif |
| 3926 | .KATI_READONLY := tool_extensions |
| 3927 | |
| 3928 | $(INSTALLED_MISC_INFO_TARGET): |
| 3929 | rm -f $@ |
| 3930 | $(call pretty,"Target misc_info.txt: $@") |
| 3931 | $(hide) echo "recovery_api_version=$(RECOVERY_API_VERSION)" >> $@ |
| 3932 | $(hide) echo "fstab_version=$(RECOVERY_FSTAB_VERSION)" >> $@ |
| 3933 | ifdef BOARD_FLASH_BLOCK_SIZE |
| 3934 | $(hide) echo "blocksize=$(BOARD_FLASH_BLOCK_SIZE)" >> $@ |
| 3935 | endif |
| 3936 | ifdef BOARD_BOOTIMAGE_PARTITION_SIZE |
| 3937 | $(hide) echo "boot_size=$(BOARD_BOOTIMAGE_PARTITION_SIZE)" >> $@ |
| 3938 | endif |
| 3939 | ifeq ($(INSTALLED_BOOTIMAGE_TARGET),) |
| 3940 | $(hide) echo "no_boot=true" >> $@ |
| 3941 | endif |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 3942 | ifneq ($(INSTALLED_VENDOR_BOOTIMAGE_TARGET),) |
| 3943 | echo "vendor_boot=true" >> $@ |
| 3944 | echo "vendor_boot_size=$(BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE)" >> $@ |
| 3945 | endif |
Daniel Norman | e1e4808 | 2019-06-27 13:55:23 -0700 | [diff] [blame] | 3946 | ifeq ($(INSTALLED_RECOVERYIMAGE_TARGET),) |
| 3947 | $(hide) echo "no_recovery=true" >> $@ |
| 3948 | endif |
| 3949 | ifdef BOARD_INCLUDE_RECOVERY_DTBO |
| 3950 | $(hide) echo "include_recovery_dtbo=true" >> $@ |
| 3951 | endif |
| 3952 | ifdef BOARD_INCLUDE_RECOVERY_ACPIO |
| 3953 | $(hide) echo "include_recovery_acpio=true" >> $@ |
| 3954 | endif |
| 3955 | ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE |
| 3956 | $(hide) echo "recovery_size=$(BOARD_RECOVERYIMAGE_PARTITION_SIZE)" >> $@ |
| 3957 | endif |
| 3958 | ifdef TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS |
| 3959 | @# TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS can be empty to indicate that nothing but defaults should be used. |
| 3960 | $(hide) echo "recovery_mount_options=$(TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS)" >> $@ |
| 3961 | else |
| 3962 | $(hide) echo "recovery_mount_options=$(DEFAULT_TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS)" >> $@ |
| 3963 | endif |
| 3964 | $(hide) echo "tool_extensions=$(tool_extensions)" >> $@ |
| 3965 | $(hide) echo "default_system_dev_certificate=$(DEFAULT_SYSTEM_DEV_CERTIFICATE)" >> $@ |
| 3966 | ifdef PRODUCT_EXTRA_RECOVERY_KEYS |
| 3967 | $(hide) echo "extra_recovery_keys=$(PRODUCT_EXTRA_RECOVERY_KEYS)" >> $@ |
| 3968 | endif |
| 3969 | $(hide) echo 'mkbootimg_args=$(BOARD_MKBOOTIMG_ARGS)' >> $@ |
| 3970 | $(hide) echo 'mkbootimg_version_args=$(INTERNAL_MKBOOTIMG_VERSION_ARGS)' >> $@ |
| 3971 | $(hide) echo "multistage_support=1" >> $@ |
| 3972 | $(hide) echo "blockimgdiff_versions=3,4" >> $@ |
| 3973 | ifeq ($(PRODUCT_BUILD_GENERIC_OTA_PACKAGE),true) |
| 3974 | $(hide) echo "build_generic_ota_package=true" >> $@ |
| 3975 | endif |
| 3976 | ifneq ($(OEM_THUMBPRINT_PROPERTIES),) |
| 3977 | # OTA scripts are only interested in fingerprint related properties |
| 3978 | $(hide) echo "oem_fingerprint_properties=$(OEM_THUMBPRINT_PROPERTIES)" >> $@ |
| 3979 | endif |
| 3980 | ifneq (,$(filter address, $(SANITIZE_TARGET))) |
| 3981 | # We need to create userdata.img with real data because the instrumented libraries are in userdata.img. |
| 3982 | $(hide) echo "userdata_img_with_data=true" >> $@ |
| 3983 | endif |
| 3984 | ifeq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true) |
| 3985 | $(hide) echo "full_recovery_image=true" >> $@ |
| 3986 | endif |
Bill Peckham | e868aec | 2019-09-17 17:06:47 -0700 | [diff] [blame] | 3987 | ifdef BOARD_USES_VENDORIMAGE |
| 3988 | $(hide) echo "board_uses_vendorimage=true" >> $@ |
| 3989 | endif |
Daniel Norman | e1e4808 | 2019-06-27 13:55:23 -0700 | [diff] [blame] | 3990 | ifeq ($(BOARD_AVB_ENABLE),true) |
| 3991 | $(hide) echo "avb_enable=true" >> $@ |
| 3992 | $(hide) echo "avb_vbmeta_key_path=$(BOARD_AVB_KEY_PATH)" >> $@ |
| 3993 | $(hide) echo "avb_vbmeta_algorithm=$(BOARD_AVB_ALGORITHM)" >> $@ |
| 3994 | $(hide) echo "avb_vbmeta_args=$(BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS)" >> $@ |
| 3995 | $(hide) echo "avb_boot_add_hash_footer_args=$(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS)" >> $@ |
| 3996 | ifdef BOARD_AVB_BOOT_KEY_PATH |
| 3997 | $(hide) echo "avb_boot_key_path=$(BOARD_AVB_BOOT_KEY_PATH)" >> $@ |
| 3998 | $(hide) echo "avb_boot_algorithm=$(BOARD_AVB_BOOT_ALGORITHM)" >> $@ |
| 3999 | $(hide) echo "avb_boot_rollback_index_location=$(BOARD_AVB_BOOT_ROLLBACK_INDEX_LOCATION)" >> $@ |
| 4000 | endif # BOARD_AVB_BOOT_KEY_PATH |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4001 | echo "avb_vendor_boot_add_hash_footer_args=$(BOARD_AVB_VENDOR_BOOT_ADD_HASH_FOOTER_ARGS)" >> $@ |
| 4002 | ifdef BOARD_AVB_VENDOR_BOOT_KEY_PATH |
| 4003 | echo "avb_vendor_boot_key_path=$(BOARD_AVB_VENDOR_BOOT_KEY_PATH)" >> $@ |
| 4004 | echo "avb_vendor_boot_algorithm=$(BOARD_AVB_VENDOR_BOOT_ALGORITHM)" >> $@ |
| 4005 | echo "avb_vendor_boot_rollback_index_location=$(BOARD_AVB_VENDOR_BOOT_ROLLBACK_INDEX_LOCATION)" >> $@ |
| 4006 | endif # BOARD_AVB_VENDOR_BOOT_KEY_PATH |
Daniel Norman | e1e4808 | 2019-06-27 13:55:23 -0700 | [diff] [blame] | 4007 | $(hide) echo "avb_recovery_add_hash_footer_args=$(BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS)" >> $@ |
| 4008 | ifdef BOARD_AVB_RECOVERY_KEY_PATH |
| 4009 | $(hide) echo "avb_recovery_key_path=$(BOARD_AVB_RECOVERY_KEY_PATH)" >> $@ |
| 4010 | $(hide) echo "avb_recovery_algorithm=$(BOARD_AVB_RECOVERY_ALGORITHM)" >> $@ |
| 4011 | $(hide) echo "avb_recovery_rollback_index_location=$(BOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION)" >> $@ |
| 4012 | endif # BOARD_AVB_RECOVERY_KEY_PATH |
| 4013 | ifneq (,$(strip $(BOARD_AVB_VBMETA_SYSTEM))) |
| 4014 | $(hide) echo "avb_vbmeta_system=$(BOARD_AVB_VBMETA_SYSTEM)" >> $@ |
| 4015 | $(hide) echo "avb_vbmeta_system_args=$(BOARD_AVB_MAKE_VBMETA_SYSTEM_IMAGE_ARGS)" >> $@ |
| 4016 | $(hide) echo "avb_vbmeta_system_key_path=$(BOARD_AVB_VBMETA_SYSTEM_KEY_PATH)" >> $@ |
| 4017 | $(hide) echo "avb_vbmeta_system_algorithm=$(BOARD_AVB_VBMETA_SYSTEM_ALGORITHM)" >> $@ |
| 4018 | $(hide) echo "avb_vbmeta_system_rollback_index_location=$(BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION)" >> $@ |
| 4019 | endif # BOARD_AVB_VBMETA_SYSTEM |
| 4020 | ifneq (,$(strip $(BOARD_AVB_VBMETA_VENDOR))) |
| 4021 | $(hide) echo "avb_vbmeta_vendor=$(BOARD_AVB_VBMETA_VENDOR)" >> $@ |
| 4022 | $(hide) echo "avb_vbmeta_vendor_args=$(BOARD_AVB_MAKE_VBMETA_SYSTEM_IMAGE_ARGS)" >> $@ |
| 4023 | $(hide) echo "avb_vbmeta_vendor_key_path=$(BOARD_AVB_VBMETA_VENDOR_KEY_PATH)" >> $@ |
| 4024 | $(hide) echo "avb_vbmeta_vendor_algorithm=$(BOARD_AVB_VBMETA_VENDOR_ALGORITHM)" >> $@ |
| 4025 | $(hide) echo "avb_vbmeta_vendor_rollback_index_location=$(BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX_LOCATION)" >> $@ |
| 4026 | endif # BOARD_AVB_VBMETA_VENDOR_KEY_PATH |
| 4027 | endif # BOARD_AVB_ENABLE |
| 4028 | ifdef BOARD_BPT_INPUT_FILES |
| 4029 | $(hide) echo "board_bpt_enable=true" >> $@ |
| 4030 | $(hide) echo "board_bpt_make_table_args=$(BOARD_BPT_MAKE_TABLE_ARGS)" >> $@ |
| 4031 | $(hide) echo "board_bpt_input_files=$(BOARD_BPT_INPUT_FILES)" >> $@ |
| 4032 | endif |
| 4033 | ifdef BOARD_BPT_DISK_SIZE |
| 4034 | $(hide) echo "board_bpt_disk_size=$(BOARD_BPT_DISK_SIZE)" >> $@ |
| 4035 | endif |
| 4036 | $(call generate-userimage-prop-dictionary, $@) |
| 4037 | ifeq ($(AB_OTA_UPDATER),true) |
| 4038 | @# Include the build type in META/misc_info.txt so the server can easily differentiate production builds. |
| 4039 | $(hide) echo "build_type=$(TARGET_BUILD_VARIANT)" >> $@ |
| 4040 | $(hide) echo "ab_update=true" >> $@ |
| 4041 | endif |
| 4042 | ifdef BOARD_PREBUILT_DTBOIMAGE |
| 4043 | $(hide) echo "has_dtbo=true" >> $@ |
| 4044 | ifeq ($(BOARD_AVB_ENABLE),true) |
| 4045 | $(hide) echo "dtbo_size=$(BOARD_DTBOIMG_PARTITION_SIZE)" >> $@ |
| 4046 | $(hide) echo "avb_dtbo_add_hash_footer_args=$(BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS)" >> $@ |
| 4047 | ifdef BOARD_AVB_DTBO_KEY_PATH |
| 4048 | $(hide) echo "avb_dtbo_key_path=$(BOARD_AVB_DTBO_KEY_PATH)" >> $@ |
| 4049 | $(hide) echo "avb_dtbo_algorithm=$(BOARD_AVB_DTBO_ALGORITHM)" >> $@ |
| 4050 | $(hide) echo "avb_dtbo_rollback_index_location=$(BOARD_AVB_DTBO_ROLLBACK_INDEX_LOCATION)" >> $@ |
| 4051 | endif # BOARD_AVB_DTBO_KEY_PATH |
| 4052 | endif # BOARD_AVB_ENABLE |
| 4053 | endif # BOARD_PREBUILT_DTBOIMAGE |
| 4054 | $(call dump-dynamic-partitions-info,$@) |
Yifan Hong | e3ba82c | 2019-08-21 13:29:30 -0700 | [diff] [blame] | 4055 | @# VINTF checks |
| 4056 | ifeq ($(PRODUCT_ENFORCE_VINTF_MANIFEST),true) |
| 4057 | $(hide) echo "vintf_enforce=true" >> $@ |
| 4058 | endif |
| 4059 | ifdef ODM_MANIFEST_SKUS |
| 4060 | $(hide) echo "vintf_odm_manifest_skus=$(ODM_MANIFEST_SKUS)" >> $@ |
| 4061 | endif |
Daniel Norman | e1e4808 | 2019-06-27 13:55:23 -0700 | [diff] [blame] | 4062 | |
| 4063 | .PHONY: misc_info |
| 4064 | misc_info: $(INSTALLED_MISC_INFO_TARGET) |
| 4065 | |
| 4066 | droidcore: $(INSTALLED_MISC_INFO_TARGET) |
| 4067 | |
| 4068 | # ----------------------------------------------------------------- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4069 | # A zip of the directories that map to the target filesystem. |
| 4070 | # This zip can be used to create an OTA package or filesystem image |
| 4071 | # as a post-build step. |
| 4072 | # |
| 4073 | name := $(TARGET_PRODUCT) |
| 4074 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 4075 | name := $(name)_debug |
| 4076 | endif |
| 4077 | name := $(name)-target_files-$(FILE_NAME_TAG) |
| 4078 | |
| 4079 | intermediates := $(call intermediates-dir-for,PACKAGING,target_files) |
| 4080 | BUILT_TARGET_FILES_PACKAGE := $(intermediates)/$(name).zip |
| 4081 | $(BUILT_TARGET_FILES_PACKAGE): intermediates := $(intermediates) |
| 4082 | $(BUILT_TARGET_FILES_PACKAGE): \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4083 | zip_root := $(intermediates)/$(name) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4084 | |
| 4085 | # $(1): Directory to copy |
| 4086 | # $(2): Location to copy it to |
| 4087 | # The "ls -A" is to prevent "acp s/* d" from failing if s is empty. |
| 4088 | define package_files-copy-root |
| 4089 | if [ -d "$(strip $(1))" -a "$$(ls -A $(1))" ]; then \ |
| 4090 | mkdir -p $(2) && \ |
| 4091 | $(ACP) -rd $(strip $(1))/* $(2); \ |
| 4092 | fi |
| 4093 | endef |
| 4094 | |
Tao Bao | a04fca3 | 2015-11-30 12:22:24 -0800 | [diff] [blame] | 4095 | built_ota_tools := |
Ying Wang | e6e544e | 2015-06-22 18:35:35 -0700 | [diff] [blame] | 4096 | |
| 4097 | # We can't build static executables when SANITIZE_TARGET=address |
Evgenii Stepanov | 5d06f24 | 2018-11-14 14:12:10 -0800 | [diff] [blame] | 4098 | ifeq (,$(filter address, $(SANITIZE_TARGET))) |
Ying Wang | e6e544e | 2015-06-22 18:35:35 -0700 | [diff] [blame] | 4099 | built_ota_tools += \ |
Ying Wang | e6e544e | 2015-06-22 18:35:35 -0700 | [diff] [blame] | 4100 | $(call intermediates-dir-for,EXECUTABLES,updater,,,$(TARGET_PREFER_32_BIT))/updater |
| 4101 | endif |
| 4102 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4103 | $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_OTA_TOOLS := $(built_ota_tools) |
| 4104 | |
Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 4105 | tool_extension := $(wildcard $(tool_extensions)/releasetools.py) |
Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 4106 | $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_TOOL_EXTENSION := $(tool_extension) |
Doug Zongker | c18736b | 2009-09-30 09:20:32 -0700 | [diff] [blame] | 4107 | |
Sen Jiang | 4438fd9 | 2016-03-07 16:51:01 -0800 | [diff] [blame] | 4108 | ifeq ($(AB_OTA_UPDATER),true) |
Sen Jiang | 4393563 | 2017-12-19 15:24:43 -0800 | [diff] [blame] | 4109 | updater_dep := system/update_engine/update_engine.conf |
Sen Jiang | 4438fd9 | 2016-03-07 16:51:01 -0800 | [diff] [blame] | 4110 | else |
Steve Fung | 48e49f5 | 2015-10-01 23:53:31 -0700 | [diff] [blame] | 4111 | # Build OTA tools if not using the AB Updater. |
Shinichiro Hamaji | ee2d211 | 2016-05-10 16:40:38 +0900 | [diff] [blame] | 4112 | updater_dep := $(built_ota_tools) |
Steve Fung | 48e49f5 | 2015-10-01 23:53:31 -0700 | [diff] [blame] | 4113 | endif |
Shinichiro Hamaji | ee2d211 | 2016-05-10 16:40:38 +0900 | [diff] [blame] | 4114 | $(BUILT_TARGET_FILES_PACKAGE): $(updater_dep) |
Steve Fung | 48e49f5 | 2015-10-01 23:53:31 -0700 | [diff] [blame] | 4115 | |
Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 4116 | # If we are using recovery as boot, output recovery files to BOOT/. |
| 4117 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) |
| 4118 | $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_RECOVERY_OUT := BOOT |
| 4119 | else |
| 4120 | $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_RECOVERY_OUT := RECOVERY |
| 4121 | endif |
| 4122 | |
Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 4123 | ifeq ($(AB_OTA_UPDATER),true) |
Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 4124 | ifdef OSRELEASED_DIRECTORY |
| 4125 | $(BUILT_TARGET_FILES_PACKAGE): $(TARGET_OUT_OEM)/$(OSRELEASED_DIRECTORY)/product_id |
| 4126 | $(BUILT_TARGET_FILES_PACKAGE): $(TARGET_OUT_OEM)/$(OSRELEASED_DIRECTORY)/product_version |
| 4127 | $(BUILT_TARGET_FILES_PACKAGE): $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)/system_version |
| 4128 | endif |
Tao Bao | a835f38 | 2019-07-18 15:55:30 -0700 | [diff] [blame] | 4129 | |
| 4130 | # Not checking in board_config.mk, since AB_OTA_PARTITIONS may be updated in Android.mk (e.g. to |
| 4131 | # additionally include radio or bootloader partitions). |
| 4132 | ifeq ($(AB_OTA_PARTITIONS),) |
| 4133 | $(error AB_OTA_PARTITIONS must be defined when using AB_OTA_UPDATER) |
| 4134 | endif |
| 4135 | endif |
| 4136 | |
| 4137 | ifneq ($(AB_OTA_PARTITIONS),) |
| 4138 | ifneq ($(AB_OTA_UPDATER),true) |
| 4139 | $(error AB_OTA_UPDATER must be true when defining AB_OTA_PARTITIONS) |
| 4140 | endif |
Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 4141 | endif |
| 4142 | |
Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 4143 | # Run fs_config while creating the target files package |
| 4144 | # $1: root directory |
| 4145 | # $2: add prefix |
| 4146 | define fs_config |
Luis Hector Chavez | 440da2d | 2018-02-07 09:49:52 -0800 | [diff] [blame] | 4147 | (cd $(1); find . -type d | sed 's,$$,/,'; find . \! -type d) | cut -c 3- | sort | sed 's,^,$(2),' | $(HOST_OUT_EXECUTABLES)/fs_config -C -D $(TARGET_OUT) -S $(SELINUX_FC) -R "$(2)" |
Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 4148 | endef |
| 4149 | |
Yifan Hong | 60bfcc4 | 2019-11-01 11:39:45 -0700 | [diff] [blame] | 4150 | # Filter out vendor from the list for AOSP targets. |
| 4151 | # $(1): list |
| 4152 | define filter-out-missing-vendor |
| 4153 | $(if $(INSTALLED_VENDORIMAGE_TARGET),$(1),$(filter-out vendor,$(1))) |
| 4154 | endef |
| 4155 | |
| 4156 | # Information related to dynamic partitions and virtual A/B. This information |
| 4157 | # is needed for building the super image (see dump-super-image-info) and |
| 4158 | # building OTA packages. |
Yifan Hong | 2b891ac | 2018-11-29 12:06:31 -0800 | [diff] [blame] | 4159 | # $(1): file |
| 4160 | define dump-dynamic-partitions-info |
| 4161 | $(if $(filter true,$(PRODUCT_USE_DYNAMIC_PARTITIONS)), \ |
| 4162 | echo "use_dynamic_partitions=true" >> $(1)) |
| 4163 | $(if $(filter true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)), \ |
| 4164 | echo "dynamic_partition_retrofit=true" >> $(1)) |
Yifan Hong | 055e6cf | 2018-11-29 13:51:48 -0800 | [diff] [blame] | 4165 | echo "lpmake=$(notdir $(LPMAKE))" >> $(1) |
| 4166 | $(if $(filter true,$(PRODUCT_BUILD_SUPER_PARTITION)), $(if $(BOARD_SUPER_PARTITION_SIZE), \ |
| 4167 | echo "build_super_partition=true" >> $(1))) |
Tao Bao | 519d182 | 2018-12-27 12:47:23 -0800 | [diff] [blame] | 4168 | $(if $(filter true,$(BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE)), \ |
| 4169 | echo "build_retrofit_dynamic_partitions_ota_package=true" >> $(1)) |
Yifan Hong | 2b891ac | 2018-11-29 12:06:31 -0800 | [diff] [blame] | 4170 | echo "super_metadata_device=$(BOARD_SUPER_PARTITION_METADATA_DEVICE)" >> $(1) |
| 4171 | $(if $(BOARD_SUPER_PARTITION_BLOCK_DEVICES), \ |
| 4172 | echo "super_block_devices=$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)" >> $(1)) |
| 4173 | $(foreach device,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES), \ |
| 4174 | echo "super_$(device)_device_size=$(BOARD_SUPER_PARTITION_$(call to-upper,$(device))_DEVICE_SIZE)" >> $(1);) |
| 4175 | $(if $(BOARD_SUPER_PARTITION_PARTITION_LIST), \ |
Yifan Hong | 60bfcc4 | 2019-11-01 11:39:45 -0700 | [diff] [blame] | 4176 | echo "dynamic_partition_list=$(call filter-out-missing-vendor, $(BOARD_SUPER_PARTITION_PARTITION_LIST))" >> $(1)) |
Yifan Hong | 2b891ac | 2018-11-29 12:06:31 -0800 | [diff] [blame] | 4177 | $(if $(BOARD_SUPER_PARTITION_GROUPS), |
| 4178 | echo "super_partition_groups=$(BOARD_SUPER_PARTITION_GROUPS)" >> $(1)) |
| 4179 | $(foreach group,$(BOARD_SUPER_PARTITION_GROUPS), \ |
| 4180 | echo "super_$(group)_group_size=$(BOARD_$(call to-upper,$(group))_SIZE)" >> $(1); \ |
| 4181 | $(if $(BOARD_$(call to-upper,$(group))_PARTITION_LIST), \ |
Yifan Hong | 60bfcc4 | 2019-11-01 11:39:45 -0700 | [diff] [blame] | 4182 | echo "super_$(group)_partition_list=$(call filter-out-missing-vendor, $(BOARD_$(call to-upper,$(group))_PARTITION_LIST))" >> $(1);)) |
Yifan Hong | cb35bd9 | 2019-04-02 16:29:59 -0700 | [diff] [blame] | 4183 | $(if $(filter true,$(TARGET_USERIMAGES_SPARSE_EXT_DISABLED)), \ |
| 4184 | echo "build_non_sparse_super_partition=true" >> $(1)) |
Alistair Delva | 91238cc | 2019-10-16 10:53:41 -0700 | [diff] [blame] | 4185 | $(if $(filter true,$(TARGET_USERIMAGES_SPARSE_F2FS_DISABLED)), \ |
| 4186 | echo "build_non_sparse_super_partition=true" >> $(1)) |
Yifan Hong | 0e97dbb | 2019-04-17 14:28:52 -0700 | [diff] [blame] | 4187 | $(if $(filter true,$(BOARD_SUPER_IMAGE_IN_UPDATE_PACKAGE)), \ |
| 4188 | echo "super_image_in_update_package=true" >> $(1)) |
Yifan Hong | 3a7c2ef | 2019-11-01 18:23:19 +0000 | [diff] [blame] | 4189 | $(if $(BOARD_SUPER_PARTITION_SIZE), \ |
| 4190 | echo "super_partition_size=$(BOARD_SUPER_PARTITION_SIZE)" >> $(1)) |
| 4191 | $(if $(BOARD_SUPER_PARTITION_ALIGNMENT), \ |
| 4192 | echo "super_partition_alignment=$(BOARD_SUPER_PARTITION_ALIGNMENT)" >> $(1)) |
| 4193 | $(if $(BOARD_SUPER_PARTITION_WARN_LIMIT), \ |
| 4194 | echo "super_partition_warn_limit=$(BOARD_SUPER_PARTITION_WARN_LIMIT)" >> $(1)) |
| 4195 | $(if $(BOARD_SUPER_PARTITION_ERROR_LIMIT), \ |
| 4196 | echo "super_partition_error_limit=$(BOARD_SUPER_PARTITION_ERROR_LIMIT)" >> $(1)) |
Yifan Hong | cb8e275 | 2019-11-01 17:03:57 -0700 | [diff] [blame] | 4197 | $(if $(filter true,$(PRODUCT_VIRTUAL_AB_OTA)), \ |
| 4198 | echo "virtual_ab=true" >> $(1)) |
| 4199 | $(if $(filter true,$(PRODUCT_VIRTUAL_AB_OTA_RETROFIT)), \ |
| 4200 | echo "virtual_ab_retrofit=true" >> $(1)) |
Yifan Hong | 2b891ac | 2018-11-29 12:06:31 -0800 | [diff] [blame] | 4201 | endef |
| 4202 | |
Bill Peckham | d52fd9b | 2019-04-16 10:06:13 -0700 | [diff] [blame] | 4203 | # By conditionally including the dependency of the target files package on the |
| 4204 | # full system image deps, we speed up builds that do not build the system |
| 4205 | # image. |
| 4206 | ifdef BUILDING_SYSTEM_IMAGE |
| 4207 | $(BUILT_TARGET_FILES_PACKAGE): $(FULL_SYSTEMIMAGE_DEPS) |
| 4208 | endif |
| 4209 | |
Isaac Chen | 9e09d47 | 2019-07-05 17:30:41 +0800 | [diff] [blame] | 4210 | ifeq ($(BUILD_QEMU_IMAGES),true) |
| 4211 | MK_VBMETA_BOOT_KERNEL_CMDLINE_SH := device/generic/goldfish/tools/mk_vbmeta_boot_params.sh |
| 4212 | $(BUILT_TARGET_FILES_PACKAGE): $(MK_VBMETA_BOOT_KERNEL_CMDLINE_SH) |
| 4213 | endif |
| 4214 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4215 | # Depending on the various images guarantees that the underlying |
| 4216 | # directories are up-to-date. |
| 4217 | $(BUILT_TARGET_FILES_PACKAGE): \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4218 | $(INSTALLED_RAMDISK_TARGET) \ |
| 4219 | $(INSTALLED_BOOTIMAGE_TARGET) \ |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4220 | $(INSTALLED_VENDOR_BOOTIMAGE_TARGET) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4221 | $(INSTALLED_RADIOIMAGE_TARGET) \ |
| 4222 | $(INSTALLED_RECOVERYIMAGE_TARGET) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4223 | $(INSTALLED_USERDATAIMAGE_TARGET) \ |
| 4224 | $(INSTALLED_CACHEIMAGE_TARGET) \ |
| 4225 | $(INSTALLED_VENDORIMAGE_TARGET) \ |
| 4226 | $(INSTALLED_PRODUCTIMAGE_TARGET) \ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 4227 | $(INSTALLED_SYSTEM_EXTIMAGE_TARGET) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4228 | $(INSTALLED_VBMETAIMAGE_TARGET) \ |
| 4229 | $(INSTALLED_ODMIMAGE_TARGET) \ |
| 4230 | $(INSTALLED_DTBOIMAGE_TARGET) \ |
| 4231 | $(INTERNAL_SYSTEMOTHERIMAGE_FILES) \ |
| 4232 | $(INSTALLED_ANDROID_INFO_TXT_TARGET) \ |
| 4233 | $(INSTALLED_KERNEL_TARGET) \ |
Hridya Valsaraju | 59eaef0 | 2019-05-20 11:10:24 -0700 | [diff] [blame] | 4234 | $(INSTALLED_DTBIMAGE_TARGET) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4235 | $(INSTALLED_2NDBOOTLOADER_TARGET) \ |
| 4236 | $(BOARD_PREBUILT_DTBOIMAGE) \ |
Hridya Valsaraju | a941899 | 2019-02-04 10:35:25 -0800 | [diff] [blame] | 4237 | $(BOARD_PREBUILT_RECOVERY_DTBOIMAGE) \ |
Chen, ZhiminX | 752439b | 2018-09-23 22:10:47 +0800 | [diff] [blame] | 4238 | $(BOARD_RECOVERY_ACPIO) \ |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 4239 | $(PRODUCT_SYSTEM_BASE_FS_PATH) \ |
| 4240 | $(PRODUCT_VENDOR_BASE_FS_PATH) \ |
| 4241 | $(PRODUCT_PRODUCT_BASE_FS_PATH) \ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 4242 | $(PRODUCT_SYSTEM_EXT_BASE_FS_PATH) \ |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 4243 | $(PRODUCT_ODM_BASE_FS_PATH) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4244 | $(LPMAKE) \ |
| 4245 | $(SELINUX_FC) \ |
Daniel Norman | e1e4808 | 2019-06-27 13:55:23 -0700 | [diff] [blame] | 4246 | $(INSTALLED_MISC_INFO_TARGET) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4247 | $(APKCERTS_FILE) \ |
Jiyong Park | bcc8d8a | 2019-02-18 15:21:19 +0900 | [diff] [blame] | 4248 | $(SOONG_APEX_KEYS_FILE) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4249 | $(SOONG_ZIP) \ |
| 4250 | $(HOST_OUT_EXECUTABLES)/fs_config \ |
Tao Bao | c1966a8 | 2019-06-25 11:42:12 -0700 | [diff] [blame] | 4251 | $(ADD_IMG_TO_TARGET_FILES) \ |
Tao Bao | e11a460 | 2019-08-06 23:21:23 -0700 | [diff] [blame] | 4252 | $(MAKE_RECOVERY_PATCH) \ |
Yifan Hong | e3ba82c | 2019-08-21 13:29:30 -0700 | [diff] [blame] | 4253 | $(BUILT_KERNEL_CONFIGS_FILE) \ |
| 4254 | $(BUILT_KERNEL_VERSION_FILE) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4255 | | $(ACP) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4256 | @echo "Package target files: $@" |
Dan Willemsen | f75d7fa | 2017-03-23 13:09:21 -0700 | [diff] [blame] | 4257 | $(call create-system-vendor-symlink) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 4258 | $(call create-system-product-symlink) |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 4259 | $(call create-system-system_ext-symlink) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 4260 | $(call create-vendor-odm-symlink) |
Dan Willemsen | 5e29cad | 2016-08-06 20:15:06 -0700 | [diff] [blame] | 4261 | $(hide) rm -rf $@ $@.list $(zip_root) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4262 | $(hide) mkdir -p $(dir $@) $(zip_root) |
Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 4263 | ifneq (,$(INSTALLED_RECOVERYIMAGE_TARGET)$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT))) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4264 | @# Components of the recovery image |
Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 4265 | $(hide) mkdir -p $(zip_root)/$(PRIVATE_RECOVERY_OUT) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4266 | $(hide) $(call package_files-copy-root, \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4267 | $(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/$(PRIVATE_RECOVERY_OUT)/RAMDISK) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4268 | ifdef INSTALLED_KERNEL_TARGET |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4269 | cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/kernel |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4270 | endif |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4271 | ifdef INSTALLED_VENDOR_BOOTIMAGE_TARGET |
| 4272 | echo "$(GENERIC_KERNEL_CMDLINE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/cmdline |
| 4273 | else # INSTALLED_VENDOR_BOOTIMAGE_TARGET not defined |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4274 | ifdef INSTALLED_2NDBOOTLOADER_TARGET |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4275 | cp $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/second |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4276 | endif |
Hridya Valsaraju | e74a38b | 2018-03-21 12:15:11 -0700 | [diff] [blame] | 4277 | ifdef BOARD_INCLUDE_RECOVERY_DTBO |
Hridya Valsaraju | a941899 | 2019-02-04 10:35:25 -0800 | [diff] [blame] | 4278 | ifdef BOARD_PREBUILT_RECOVERY_DTBOIMAGE |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4279 | cp $(BOARD_PREBUILT_RECOVERY_DTBOIMAGE) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/recovery_dtbo |
Hridya Valsaraju | a941899 | 2019-02-04 10:35:25 -0800 | [diff] [blame] | 4280 | else |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4281 | cp $(BOARD_PREBUILT_DTBOIMAGE) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/recovery_dtbo |
Hridya Valsaraju | e74a38b | 2018-03-21 12:15:11 -0700 | [diff] [blame] | 4282 | endif |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4283 | endif # BOARD_INCLUDE_RECOVERY_DTBO |
Chen, ZhiminX | 752439b | 2018-09-23 22:10:47 +0800 | [diff] [blame] | 4284 | ifdef BOARD_INCLUDE_RECOVERY_ACPIO |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4285 | cp $(BOARD_RECOVERY_ACPIO) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/recovery_acpio |
Chen, ZhiminX | 752439b | 2018-09-23 22:10:47 +0800 | [diff] [blame] | 4286 | endif |
Hridya Valsaraju | 59eaef0 | 2019-05-20 11:10:24 -0700 | [diff] [blame] | 4287 | ifdef INSTALLED_DTBIMAGE_TARGET |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4288 | cp $(INSTALLED_DTBIMAGE_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/dtb |
Hridya Valsaraju | 9683b2f | 2019-01-22 18:08:59 -0800 | [diff] [blame] | 4289 | endif |
Dan Willemsen | c1f17ff | 2016-10-05 16:57:27 -0700 | [diff] [blame] | 4290 | ifdef INTERNAL_KERNEL_CMDLINE |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4291 | echo "$(INTERNAL_KERNEL_CMDLINE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/cmdline |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4292 | endif |
Doug Zongker | 38a649f | 2009-06-17 09:07:09 -0700 | [diff] [blame] | 4293 | ifdef BOARD_KERNEL_BASE |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4294 | echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/base |
Doug Zongker | 38a649f | 2009-06-17 09:07:09 -0700 | [diff] [blame] | 4295 | endif |
Ying Wang | 4de6b5b | 2010-08-25 14:29:34 -0700 | [diff] [blame] | 4296 | ifdef BOARD_KERNEL_PAGESIZE |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4297 | echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/pagesize |
Ying Wang | 4de6b5b | 2010-08-25 14:29:34 -0700 | [diff] [blame] | 4298 | endif |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4299 | endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET not defined |
Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 4300 | endif # INSTALLED_RECOVERYIMAGE_TARGET defined or BOARD_USES_RECOVERY_AS_BOOT is true |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4301 | @# Components of the boot image |
| 4302 | $(hide) mkdir -p $(zip_root)/BOOT |
Tao Bao | 62bd479 | 2015-07-21 18:01:20 -0700 | [diff] [blame] | 4303 | $(hide) mkdir -p $(zip_root)/ROOT |
| 4304 | $(hide) $(call package_files-copy-root, \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4305 | $(TARGET_ROOT_OUT),$(zip_root)/ROOT) |
Tom Cherry | 3871f0f | 2018-11-06 14:23:44 -0800 | [diff] [blame] | 4306 | @# If we are using recovery as boot, this is already done when processing recovery. |
| 4307 | ifneq ($(BOARD_USES_RECOVERY_AS_BOOT),true) |
Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 4308 | ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4309 | $(hide) $(call package_files-copy-root, \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4310 | $(TARGET_RAMDISK_OUT),$(zip_root)/BOOT/RAMDISK) |
Tao Bao | 62bd479 | 2015-07-21 18:01:20 -0700 | [diff] [blame] | 4311 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4312 | ifdef INSTALLED_KERNEL_TARGET |
Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 4313 | $(hide) cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/BOOT/kernel |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4314 | endif |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4315 | ifndef INSTALLED_VENDOR_BOOTIMAGE_TARGET |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4316 | ifdef INSTALLED_2NDBOOTLOADER_TARGET |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4317 | cp $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/BOOT/second |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4318 | endif |
Hridya Valsaraju | 9683b2f | 2019-01-22 18:08:59 -0800 | [diff] [blame] | 4319 | ifdef INSTALLED_DTBIMAGE_TARGET |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4320 | cp $(INSTALLED_DTBIMAGE_TARGET) $(zip_root)/BOOT/dtb |
Hridya Valsaraju | 9683b2f | 2019-01-22 18:08:59 -0800 | [diff] [blame] | 4321 | endif |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4322 | echo "$(INTERNAL_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline |
Doug Zongker | 38a649f | 2009-06-17 09:07:09 -0700 | [diff] [blame] | 4323 | ifdef BOARD_KERNEL_BASE |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4324 | echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/BOOT/base |
Doug Zongker | 38a649f | 2009-06-17 09:07:09 -0700 | [diff] [blame] | 4325 | endif |
Ying Wang | 4de6b5b | 2010-08-25 14:29:34 -0700 | [diff] [blame] | 4326 | ifdef BOARD_KERNEL_PAGESIZE |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4327 | echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/BOOT/pagesize |
Ying Wang | 4de6b5b | 2010-08-25 14:29:34 -0700 | [diff] [blame] | 4328 | endif |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4329 | else # INSTALLED_VENDOR_BOOTIMAGE_TARGET defined |
| 4330 | echo "$(GENERIC_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline |
| 4331 | endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET defined |
| 4332 | endif # BOARD_USES_RECOVERY_AS_BOOT not true |
Doug Zongker | e01100c | 2009-06-19 17:12:18 -0700 | [diff] [blame] | 4333 | $(hide) $(foreach t,$(INSTALLED_RADIOIMAGE_TARGET),\ |
| 4334 | mkdir -p $(zip_root)/RADIO; \ |
Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 4335 | cp $(t) $(zip_root)/RADIO/$(notdir $(t));) |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4336 | ifdef INSTALLED_VENDOR_BOOTIMAGE_TARGET |
| 4337 | mkdir -p $(zip_root)/VENDOR_BOOT |
| 4338 | $(call package_files-copy-root, \ |
| 4339 | $(TARGET_VENDOR_RAMDISK_OUT),$(zip_root)/VENDOR_BOOT/RAMDISK) |
| 4340 | ifdef INSTALLED_DTBIMAGE_TARGET |
| 4341 | cp $(INSTALLED_DTBIMAGE_TARGET) $(zip_root)/VENDOR_BOOT/dtb |
| 4342 | endif |
| 4343 | ifdef BOARD_KERNEL_BASE |
| 4344 | echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/VENDOR_BOOT/base |
| 4345 | endif |
| 4346 | ifdef BOARD_KERNEL_PAGESIZE |
| 4347 | echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/VENDOR_BOOT/pagesize |
| 4348 | endif |
| 4349 | echo "$(INTERNAL_KERNEL_CMDLINE)" > $(zip_root)/VENDOR_BOOT/vendor_cmdline |
| 4350 | endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 4351 | ifdef BUILDING_SYSTEM_IMAGE |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4352 | @# Contents of the system image |
| 4353 | $(hide) $(call package_files-copy-root, \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4354 | $(SYSTEMIMAGE_SOURCE_DIR),$(zip_root)/SYSTEM) |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 4355 | endif |
| 4356 | ifdef BUILDING_USERDATA_IMAGE |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4357 | @# Contents of the data image |
| 4358 | $(hide) $(call package_files-copy-root, \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4359 | $(TARGET_OUT_DATA),$(zip_root)/DATA) |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 4360 | endif |
| 4361 | ifdef BUILDING_VENDOR_IMAGE |
Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 4362 | @# Contents of the vendor image |
| 4363 | $(hide) $(call package_files-copy-root, \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4364 | $(TARGET_OUT_VENDOR),$(zip_root)/VENDOR) |
Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 4365 | endif |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 4366 | ifdef BUILDING_PRODUCT_IMAGE |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 4367 | @# Contents of the product image |
| 4368 | $(hide) $(call package_files-copy-root, \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4369 | $(TARGET_OUT_PRODUCT),$(zip_root)/PRODUCT) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 4370 | endif |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 4371 | ifdef BUILDING_SYSTEM_EXT_IMAGE |
| 4372 | @# Contents of the system_ext image |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 4373 | $(hide) $(call package_files-copy-root, \ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 4374 | $(TARGET_OUT_SYSTEM_EXT),$(zip_root)/SYSTEM_EXT) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 4375 | endif |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 4376 | ifdef BUILDING_ODM_IMAGE |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 4377 | @# Contents of the odm image |
| 4378 | $(hide) $(call package_files-copy-root, \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4379 | $(TARGET_OUT_ODM),$(zip_root)/ODM) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 4380 | endif |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 4381 | ifdef BUILDING_SYSTEM_OTHER_IMAGE |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 4382 | @# Contents of the system_other image |
| 4383 | $(hide) $(call package_files-copy-root, \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4384 | $(TARGET_OUT_SYSTEM_OTHER),$(zip_root)/SYSTEM_OTHER) |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 4385 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4386 | @# Extra contents of the OTA package |
Steve Fung | 48e49f5 | 2015-10-01 23:53:31 -0700 | [diff] [blame] | 4387 | $(hide) mkdir -p $(zip_root)/OTA |
Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 4388 | $(hide) cp $(INSTALLED_ANDROID_INFO_TXT_TARGET) $(zip_root)/OTA/ |
Steve Fung | 48e49f5 | 2015-10-01 23:53:31 -0700 | [diff] [blame] | 4389 | ifneq ($(AB_OTA_UPDATER),true) |
Ying Wang | 03b6e8b | 2015-12-07 10:45:19 -0800 | [diff] [blame] | 4390 | ifneq ($(built_ota_tools),) |
Steve Fung | 48e49f5 | 2015-10-01 23:53:31 -0700 | [diff] [blame] | 4391 | $(hide) mkdir -p $(zip_root)/OTA/bin |
Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 4392 | $(hide) cp $(PRIVATE_OTA_TOOLS) $(zip_root)/OTA/bin/ |
Steve Fung | 48e49f5 | 2015-10-01 23:53:31 -0700 | [diff] [blame] | 4393 | endif |
Ying Wang | 03b6e8b | 2015-12-07 10:45:19 -0800 | [diff] [blame] | 4394 | endif |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 4395 | @# Files that do not end up in any images, but are necessary to |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4396 | @# build them. |
| 4397 | $(hide) mkdir -p $(zip_root)/META |
Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 4398 | $(hide) cp $(APKCERTS_FILE) $(zip_root)/META/apkcerts.txt |
Jiyong Park | bcc8d8a | 2019-02-18 15:21:19 +0900 | [diff] [blame] | 4399 | $(hide) cp $(SOONG_APEX_KEYS_FILE) $(zip_root)/META/apexkeys.txt |
Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 4400 | ifneq ($(tool_extension),) |
| 4401 | $(hide) cp $(PRIVATE_TOOL_EXTENSION) $(zip_root)/META/ |
| 4402 | endif |
Ying Wang | 0eabd4f | 2015-03-24 19:07:40 -0700 | [diff] [blame] | 4403 | $(hide) echo "$(PRODUCT_OTA_PUBLIC_KEYS)" > $(zip_root)/META/otakeys.txt |
Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 4404 | $(hide) cp $(SELINUX_FC) $(zip_root)/META/file_contexts.bin |
Daniel Norman | e1e4808 | 2019-06-27 13:55:23 -0700 | [diff] [blame] | 4405 | $(hide) cp $(INSTALLED_MISC_INFO_TARGET) $(zip_root)/META/misc_info.txt |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 4406 | ifneq ($(PRODUCT_SYSTEM_BASE_FS_PATH),) |
| 4407 | $(hide) cp $(PRODUCT_SYSTEM_BASE_FS_PATH) \ |
| 4408 | $(zip_root)/META/$(notdir $(PRODUCT_SYSTEM_BASE_FS_PATH)) |
Tao Bao | f54216f | 2016-03-29 15:12:37 -0700 | [diff] [blame] | 4409 | endif |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 4410 | ifneq ($(PRODUCT_VENDOR_BASE_FS_PATH),) |
| 4411 | $(hide) cp $(PRODUCT_VENDOR_BASE_FS_PATH) \ |
| 4412 | $(zip_root)/META/$(notdir $(PRODUCT_VENDOR_BASE_FS_PATH)) |
Tao Bao | f54216f | 2016-03-29 15:12:37 -0700 | [diff] [blame] | 4413 | endif |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 4414 | ifneq ($(PRODUCT_PRODUCT_BASE_FS_PATH),) |
| 4415 | $(hide) cp $(PRODUCT_PRODUCT_BASE_FS_PATH) \ |
| 4416 | $(zip_root)/META/$(notdir $(PRODUCT_PRODUCT_BASE_FS_PATH)) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 4417 | endif |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 4418 | ifneq ($(PRODUCT_SYSTEM_EXT_BASE_FS_PATH),) |
| 4419 | $(hide) cp $(PRODUCT_SYSTEM_EXT_BASE_FS_PATH) \ |
| 4420 | $(zip_root)/META/$(notdir $(PRODUCT_SYSTEM_EXT_BASE_FS_PATH)) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 4421 | endif |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 4422 | ifneq ($(PRODUCT_ODM_BASE_FS_PATH),) |
| 4423 | $(hide) cp $(PRODUCT_ODM_BASE_FS_PATH) \ |
| 4424 | $(zip_root)/META/$(notdir $(PRODUCT_ODM_BASE_FS_PATH)) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 4425 | endif |
Bill Peckham | c0f413f | 2019-11-07 11:27:02 -0800 | [diff] [blame] | 4426 | ifneq ($(AB_OTA_UPDATER),true) |
Tao Bao | cbc6dc2 | 2015-08-18 18:03:56 -0700 | [diff] [blame] | 4427 | ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),) |
Tao Bao | cf821fc | 2019-06-24 12:39:10 -0700 | [diff] [blame] | 4428 | $(hide) PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$$PATH MKBOOTIMG=$(MKBOOTIMG) \ |
Tao Bao | e11a460 | 2019-08-06 23:21:23 -0700 | [diff] [blame] | 4429 | $(MAKE_RECOVERY_PATCH) $(zip_root) $(zip_root) |
Tao Bao | cbc6dc2 | 2015-08-18 18:03:56 -0700 | [diff] [blame] | 4430 | endif |
Bill Peckham | c0f413f | 2019-11-07 11:27:02 -0800 | [diff] [blame] | 4431 | endif |
Alex Deymo | 70067ac | 2015-09-29 19:05:37 -0700 | [diff] [blame] | 4432 | ifeq ($(AB_OTA_UPDATER),true) |
| 4433 | @# When using the A/B updater, include the updater config files in the zip. |
Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 4434 | $(hide) cp $(TOPDIR)system/update_engine/update_engine.conf $(zip_root)/META/update_engine_config.txt |
Alex Deymo | 49be2b1 | 2015-10-22 18:15:27 -0700 | [diff] [blame] | 4435 | $(hide) for part in $(AB_OTA_PARTITIONS); do \ |
Alex Deymo | 8925d33 | 2015-10-01 17:38:09 -0700 | [diff] [blame] | 4436 | echo "$${part}" >> $(zip_root)/META/ab_partitions.txt; \ |
| 4437 | done |
Sen Jiang | 8f22e2a | 2015-11-12 13:53:25 -0800 | [diff] [blame] | 4438 | $(hide) for conf in $(AB_OTA_POSTINSTALL_CONFIG); do \ |
| 4439 | echo "$${conf}" >> $(zip_root)/META/postinstall_config.txt; \ |
| 4440 | done |
Bertrand SIMONNET | 4af7259 | 2015-10-08 15:32:40 -0700 | [diff] [blame] | 4441 | ifdef OSRELEASED_DIRECTORY |
Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 4442 | $(hide) cp $(TARGET_OUT_OEM)/$(OSRELEASED_DIRECTORY)/product_id $(zip_root)/META/product_id.txt |
| 4443 | $(hide) cp $(TARGET_OUT_OEM)/$(OSRELEASED_DIRECTORY)/product_version $(zip_root)/META/product_version.txt |
| 4444 | $(hide) cp $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)/system_version $(zip_root)/META/system_version.txt |
Bertrand SIMONNET | 4af7259 | 2015-10-08 15:32:40 -0700 | [diff] [blame] | 4445 | endif |
Alex Deymo | 70067ac | 2015-09-29 19:05:37 -0700 | [diff] [blame] | 4446 | endif |
Steve Fung | dfbab49 | 2015-09-24 18:12:33 -0700 | [diff] [blame] | 4447 | ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true) |
Alex Deymo | 70067ac | 2015-09-29 19:05:37 -0700 | [diff] [blame] | 4448 | @# If breakpad symbols have been generated, add them to the zip. |
Dan Willemsen | 288bedf | 2019-05-28 15:36:47 -0700 | [diff] [blame] | 4449 | $(hide) cp -R $(TARGET_OUT_BREAKPAD) $(zip_root)/BREAKPAD |
Steve Fung | dfbab49 | 2015-09-24 18:12:33 -0700 | [diff] [blame] | 4450 | endif |
Dan Willemsen | 6c3e79b | 2016-06-17 14:07:37 -0700 | [diff] [blame] | 4451 | ifdef BOARD_PREBUILT_VENDORIMAGE |
| 4452 | $(hide) mkdir -p $(zip_root)/IMAGES |
| 4453 | $(hide) cp $(INSTALLED_VENDORIMAGE_TARGET) $(zip_root)/IMAGES/ |
| 4454 | endif |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 4455 | ifdef BOARD_PREBUILT_PRODUCTIMAGE |
| 4456 | $(hide) mkdir -p $(zip_root)/IMAGES |
| 4457 | $(hide) cp $(INSTALLED_PRODUCTIMAGE_TARGET) $(zip_root)/IMAGES/ |
| 4458 | endif |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 4459 | ifdef BOARD_PREBUILT_SYSTEM_EXTIMAGE |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 4460 | $(hide) mkdir -p $(zip_root)/IMAGES |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 4461 | $(hide) cp $(INSTALLED_SYSTEM_EXTIMAGE_TARGET) $(zip_root)/IMAGES/ |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 4462 | endif |
Michael Schwartz | 0dc6f21 | 2017-07-18 10:05:13 -0700 | [diff] [blame] | 4463 | ifdef BOARD_PREBUILT_BOOTIMAGE |
| 4464 | $(hide) mkdir -p $(zip_root)/IMAGES |
| 4465 | $(hide) cp $(INSTALLED_BOOTIMAGE_TARGET) $(zip_root)/IMAGES/ |
| 4466 | endif |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 4467 | ifdef BOARD_PREBUILT_ODMIMAGE |
| 4468 | $(hide) mkdir -p $(zip_root)/IMAGES |
| 4469 | $(hide) cp $(INSTALLED_ODMIMAGE_TARGET) $(zip_root)/IMAGES/ |
| 4470 | endif |
Yueyao Zhu | 889ee5e | 2017-05-12 17:50:46 -0700 | [diff] [blame] | 4471 | ifdef BOARD_PREBUILT_DTBOIMAGE |
Tao Bao | c633ed0 | 2017-05-30 21:46:33 -0700 | [diff] [blame] | 4472 | $(hide) mkdir -p $(zip_root)/PREBUILT_IMAGES |
| 4473 | $(hide) cp $(INSTALLED_DTBOIMAGE_TARGET) $(zip_root)/PREBUILT_IMAGES/ |
Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 4474 | endif # BOARD_PREBUILT_DTBOIMAGE |
Tao Bao | 95a95c3 | 2017-06-16 15:30:23 -0700 | [diff] [blame] | 4475 | @# The radio images in BOARD_PACK_RADIOIMAGES will be additionally copied from RADIO/ into |
| 4476 | @# IMAGES/, which then will be added into <product>-img.zip. Such images must be listed in |
| 4477 | @# INSTALLED_RADIOIMAGE_TARGET. |
| 4478 | $(hide) $(foreach part,$(BOARD_PACK_RADIOIMAGES), \ |
| 4479 | echo $(part) >> $(zip_root)/META/pack_radioimages.txt;) |
Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 4480 | @# Run fs_config on all the system, vendor, boot ramdisk, |
| 4481 | @# and recovery ramdisk files in the zip, and save the output |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 4482 | ifdef BUILDING_SYSTEM_IMAGE |
Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 4483 | $(hide) $(call fs_config,$(zip_root)/SYSTEM,system/) > $(zip_root)/META/filesystem_config.txt |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 4484 | endif |
| 4485 | ifdef BUILDING_VENDOR_IMAGE |
Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 4486 | $(hide) $(call fs_config,$(zip_root)/VENDOR,vendor/) > $(zip_root)/META/vendor_filesystem_config.txt |
| 4487 | endif |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 4488 | ifdef BUILDING_PRODUCT_IMAGE |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 4489 | $(hide) $(call fs_config,$(zip_root)/PRODUCT,product/) > $(zip_root)/META/product_filesystem_config.txt |
| 4490 | endif |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 4491 | ifdef BUILDING_SYSTEM_EXT_IMAGE |
| 4492 | $(hide) $(call fs_config,$(zip_root)/SYSTEM_EXT,system_ext/) > $(zip_root)/META/system_ext_filesystem_config.txt |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 4493 | endif |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 4494 | ifdef BUILDING_ODM_IMAGE |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 4495 | $(hide) $(call fs_config,$(zip_root)/ODM,odm/) > $(zip_root)/META/odm_filesystem_config.txt |
| 4496 | endif |
Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 4497 | @# ROOT always contains the files for the root under normal boot. |
Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 4498 | $(hide) $(call fs_config,$(zip_root)/ROOT,) > $(zip_root)/META/root_filesystem_config.txt |
Tao Bao | da01b21 | 2018-02-28 21:20:08 -0800 | [diff] [blame] | 4499 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) |
Tom Cherry | 2929cad | 2018-09-20 11:04:37 -0700 | [diff] [blame] | 4500 | @# BOOT/RAMDISK exists and contains the ramdisk for recovery if using BOARD_USES_RECOVERY_AS_BOOT. |
Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 4501 | $(hide) $(call fs_config,$(zip_root)/BOOT/RAMDISK,) > $(zip_root)/META/boot_filesystem_config.txt |
Tao Bao | da01b21 | 2018-02-28 21:20:08 -0800 | [diff] [blame] | 4502 | endif |
Steve Muckle | e1b1086 | 2019-07-10 10:49:37 -0700 | [diff] [blame] | 4503 | ifneq ($(INSTALLED_VENDOR_BOOTIMAGE_TARGET),) |
| 4504 | $(call fs_config,$(zip_root)/VENDOR_BOOT/RAMDISK,) > $(zip_root)/META/vendor_boot_filesystem_config.txt |
| 4505 | endif |
Tom Cherry | 2929cad | 2018-09-20 11:04:37 -0700 | [diff] [blame] | 4506 | ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) |
| 4507 | @# BOOT/RAMDISK also exists and contains the first stage ramdisk if not using BOARD_BUILD_SYSTEM_ROOT_IMAGE. |
Tao Bao | da01b21 | 2018-02-28 21:20:08 -0800 | [diff] [blame] | 4508 | $(hide) $(call fs_config,$(zip_root)/BOOT/RAMDISK,) > $(zip_root)/META/boot_filesystem_config.txt |
| 4509 | endif |
Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 4510 | ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),) |
| 4511 | $(hide) $(call fs_config,$(zip_root)/RECOVERY/RAMDISK,) > $(zip_root)/META/recovery_filesystem_config.txt |
| 4512 | endif |
Dan Willemsen | 6749520 | 2019-01-16 12:42:05 -0800 | [diff] [blame] | 4513 | ifdef BUILDING_SYSTEM_OTHER_IMAGE |
Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 4514 | $(hide) $(call fs_config,$(zip_root)/SYSTEM_OTHER,system/) > $(zip_root)/META/system_other_filesystem_config.txt |
| 4515 | endif |
Michael Schwartz | 4d9cb56 | 2017-04-04 13:01:18 -0700 | [diff] [blame] | 4516 | @# Metadata for compatibility verification. |
Yifan Hong | e3ba82c | 2019-08-21 13:29:30 -0700 | [diff] [blame] | 4517 | ifdef BUILT_KERNEL_CONFIGS_FILE |
| 4518 | $(hide) cp $(BUILT_KERNEL_CONFIGS_FILE) $(zip_root)/META/kernel_configs.txt |
| 4519 | endif |
| 4520 | ifdef BUILT_KERNEL_VERSION_FILE |
| 4521 | $(hide) cp $(BUILT_KERNEL_VERSION_FILE) $(zip_root)/META/kernel_version.txt |
| 4522 | endif |
Yifan Hong | cb8e275 | 2019-11-01 17:03:57 -0700 | [diff] [blame] | 4523 | rm -rf $(zip_root)/META/dynamic_partitions_info.txt |
| 4524 | ifeq (true,$(PRODUCT_USE_DYNAMIC_PARTITIONS)) |
| 4525 | $(call dump-dynamic-partitions-info, $(zip_root)/META/dynamic_partitions_info.txt) |
| 4526 | endif |
Tao Bao | cbd6d49 | 2019-10-07 22:46:02 -0700 | [diff] [blame] | 4527 | PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$$PATH MKBOOTIMG=$(MKBOOTIMG) \ |
| 4528 | $(ADD_IMG_TO_TARGET_FILES) -a -v -p $(HOST_OUT) $(zip_root) |
Isaac Chen | 9e09d47 | 2019-07-05 17:30:41 +0800 | [diff] [blame] | 4529 | ifeq ($(BUILD_QEMU_IMAGES),true) |
| 4530 | $(hide) AVBTOOL=$(AVBTOOL) $(MK_VBMETA_BOOT_KERNEL_CMDLINE_SH) $(zip_root)/IMAGES/vbmeta.img \ |
| 4531 | $(zip_root)/IMAGES/system.img $(zip_root)/IMAGES/VerifiedBootParams.textproto |
| 4532 | endif |
Alex Deymo | 92cfd6f | 2016-01-26 18:47:44 -0800 | [diff] [blame] | 4533 | @# Zip everything up, preserving symlinks and placing META/ files first to |
| 4534 | @# help early validation of the .zip file while uploading it. |
Dan Willemsen | 5e29cad | 2016-08-06 20:15:06 -0700 | [diff] [blame] | 4535 | $(hide) find $(zip_root)/META | sort >$@.list |
Nan Zhang | cabecd9 | 2017-03-20 18:22:43 -0700 | [diff] [blame] | 4536 | $(hide) find $(zip_root) -path $(zip_root)/META -prune -o -print | sort >>$@.list |
Dan Willemsen | 5e29cad | 2016-08-06 20:15:06 -0700 | [diff] [blame] | 4537 | $(hide) $(SOONG_ZIP) -d -o $@ -C $(zip_root) -l $@.list |
Doug Zongker | 283e2a1 | 2010-03-15 17:52:32 -0700 | [diff] [blame] | 4538 | |
Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 4539 | .PHONY: target-files-package |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4540 | target-files-package: $(BUILT_TARGET_FILES_PACKAGE) |
| 4541 | |
Ying Wang | 4709d7c | 2014-04-14 17:25:43 -0700 | [diff] [blame] | 4542 | ifneq ($(filter $(MAKECMDGOALS),target-files-package),) |
| 4543 | $(call dist-for-goals, target-files-package, $(BUILT_TARGET_FILES_PACKAGE)) |
| 4544 | endif |
Doug Zongker | 367910f | 2009-06-15 18:56:51 -0700 | [diff] [blame] | 4545 | |
Dan Albert | 4d32333 | 2016-10-14 13:23:06 -0700 | [diff] [blame] | 4546 | # ----------------------------------------------------------------- |
| 4547 | # NDK Sysroot Package |
| 4548 | NDK_SYSROOT_TARGET := $(PRODUCT_OUT)/ndk_sysroot.tar.bz2 |
Dan Willemsen | 14e1026 | 2018-06-17 21:54:21 -0700 | [diff] [blame] | 4549 | $(NDK_SYSROOT_TARGET): $(SOONG_OUT_DIR)/ndk.timestamp |
Dan Albert | 4d32333 | 2016-10-14 13:23:06 -0700 | [diff] [blame] | 4550 | @echo Package NDK sysroot... |
| 4551 | $(hide) tar cjf $@ -C $(SOONG_OUT_DIR) ndk |
| 4552 | |
| 4553 | $(call dist-for-goals,sdk,$(NDK_SYSROOT_TARGET)) |
| 4554 | |
Ying Wang | 09c4b68 | 2015-08-11 11:24:19 -0700 | [diff] [blame] | 4555 | ifeq ($(build_ota_package),true) |
Ying Wang | 09a00a6 | 2010-10-20 14:01:09 -0700 | [diff] [blame] | 4556 | # ----------------------------------------------------------------- |
| 4557 | # OTA update package |
| 4558 | |
Yifan Hong | 50e7954 | 2018-11-08 17:44:12 -0800 | [diff] [blame] | 4559 | # $(1): output file |
| 4560 | # $(2): additional args |
| 4561 | define build-ota-package-target |
Tao Bao | c931547 | 2019-06-25 12:17:08 -0700 | [diff] [blame] | 4562 | PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$$PATH \ |
Tao Bao | 8821d64 | 2019-08-05 12:05:45 -0700 | [diff] [blame] | 4563 | $(OTA_FROM_TARGET_FILES) \ |
| 4564 | --verbose \ |
| 4565 | --extracted_input_target_files $(patsubst %.zip,%,$(BUILT_TARGET_FILES_PACKAGE)) \ |
| 4566 | --path $(HOST_OUT) \ |
| 4567 | $(if $(OEM_OTA_CONFIG), --oem_settings $(OEM_OTA_CONFIG)) \ |
| 4568 | $(2) \ |
| 4569 | $(BUILT_TARGET_FILES_PACKAGE) $(1) |
Yifan Hong | 50e7954 | 2018-11-08 17:44:12 -0800 | [diff] [blame] | 4570 | endef |
| 4571 | |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 4572 | name := $(TARGET_PRODUCT) |
| 4573 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 4574 | name := $(name)_debug |
| 4575 | endif |
| 4576 | name := $(name)-ota-$(FILE_NAME_TAG) |
| 4577 | |
| 4578 | INTERNAL_OTA_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip |
xunchang | 3b548b0 | 2019-02-19 14:52:33 -0800 | [diff] [blame] | 4579 | INTERNAL_OTA_METADATA := $(PRODUCT_OUT)/ota_metadata |
| 4580 | |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 4581 | $(INTERNAL_OTA_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR) |
xunchang | 3b548b0 | 2019-02-19 14:52:33 -0800 | [diff] [blame] | 4582 | $(INTERNAL_OTA_PACKAGE_TARGET): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_OTA_METADATA) |
Tao Bao | 8821d64 | 2019-08-05 12:05:45 -0700 | [diff] [blame] | 4583 | $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(OTA_FROM_TARGET_FILES) |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 4584 | @echo "Package OTA: $@" |
xunchang | 3b548b0 | 2019-02-19 14:52:33 -0800 | [diff] [blame] | 4585 | $(call build-ota-package-target,$@,-k $(KEY_CERT_PAIR) --output_metadata_path $(INTERNAL_OTA_METADATA)) |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 4586 | |
| 4587 | .PHONY: otapackage |
| 4588 | otapackage: $(INTERNAL_OTA_PACKAGE_TARGET) |
| 4589 | |
Tao Bao | 519d182 | 2018-12-27 12:47:23 -0800 | [diff] [blame] | 4590 | ifeq ($(BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE),true) |
Yifan Hong | 50e7954 | 2018-11-08 17:44:12 -0800 | [diff] [blame] | 4591 | name := $(TARGET_PRODUCT) |
| 4592 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 4593 | name := $(name)_debug |
| 4594 | endif |
| 4595 | name := $(name)-ota-retrofit-$(FILE_NAME_TAG) |
| 4596 | |
| 4597 | INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip |
Yifan Hong | 50e7954 | 2018-11-08 17:44:12 -0800 | [diff] [blame] | 4598 | $(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR) |
Tao Bao | 8821d64 | 2019-08-05 12:05:45 -0700 | [diff] [blame] | 4599 | $(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET): \ |
| 4600 | $(BUILT_TARGET_FILES_PACKAGE) \ |
| 4601 | $(OTA_FROM_TARGET_FILES) |
Yifan Hong | 50e7954 | 2018-11-08 17:44:12 -0800 | [diff] [blame] | 4602 | @echo "Package OTA (retrofit dynamic partitions): $@" |
| 4603 | $(call build-ota-package-target,$@,-k $(KEY_CERT_PAIR) --retrofit_dynamic_partitions) |
| 4604 | |
| 4605 | .PHONY: otardppackage |
| 4606 | |
| 4607 | otapackage otardppackage: $(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET) |
| 4608 | |
Tao Bao | 519d182 | 2018-12-27 12:47:23 -0800 | [diff] [blame] | 4609 | endif # BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE |
Yifan Hong | 50e7954 | 2018-11-08 17:44:12 -0800 | [diff] [blame] | 4610 | |
Ying Wang | 09c4b68 | 2015-08-11 11:24:19 -0700 | [diff] [blame] | 4611 | endif # build_ota_package |
Ying Wang | f8824af | 2014-06-03 14:07:27 -0700 | [diff] [blame] | 4612 | |
Ying Wang | 09a00a6 | 2010-10-20 14:01:09 -0700 | [diff] [blame] | 4613 | # ----------------------------------------------------------------- |
Dario Freni | d101127 | 2018-07-23 20:20:15 +0100 | [diff] [blame] | 4614 | # A zip of the appcompat directory containing logs |
| 4615 | APPCOMPAT_ZIP := $(PRODUCT_OUT)/appcompat.zip |
| 4616 | # For apps_only build we'll establish the dependency later in build/make/core/main.mk. |
| 4617 | ifndef TARGET_BUILD_APPS |
Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 4618 | $(APPCOMPAT_ZIP): $(INSTALLED_SYSTEMIMAGE_TARGET) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4619 | $(INSTALLED_RAMDISK_TARGET) \ |
| 4620 | $(INSTALLED_BOOTIMAGE_TARGET) \ |
| 4621 | $(INSTALLED_USERDATAIMAGE_TARGET) \ |
| 4622 | $(INSTALLED_VENDORIMAGE_TARGET) \ |
| 4623 | $(INSTALLED_PRODUCTIMAGE_TARGET) \ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 4624 | $(INSTALLED_SYSTEM_EXTIMAGE_TARGET) |
Dario Freni | d101127 | 2018-07-23 20:20:15 +0100 | [diff] [blame] | 4625 | endif |
| 4626 | $(APPCOMPAT_ZIP): PRIVATE_LIST_FILE := $(call intermediates-dir-for,PACKAGING,appcompat)/filelist |
| 4627 | $(APPCOMPAT_ZIP): $(SOONG_ZIP) |
| 4628 | @echo "appcompat logs: $@" |
| 4629 | $(hide) rm -rf $@ $(PRIVATE_LIST_FILE) |
| 4630 | $(hide) mkdir -p $(dir $@) $(PRODUCT_OUT)/appcompat $(dir $(PRIVATE_LIST_FILE)) |
| 4631 | $(hide) find $(PRODUCT_OUT)/appcompat | sort >$(PRIVATE_LIST_FILE) |
| 4632 | $(hide) $(SOONG_ZIP) -d -o $@ -C $(PRODUCT_OUT)/appcompat -l $(PRIVATE_LIST_FILE) |
| 4633 | |
Dario Freni | d101127 | 2018-07-23 20:20:15 +0100 | [diff] [blame] | 4634 | # ----------------------------------------------------------------- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4635 | # A zip of the symbols directory. Keep the full paths to make it |
| 4636 | # more obvious where these files came from. |
| 4637 | # |
| 4638 | name := $(TARGET_PRODUCT) |
| 4639 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 4640 | name := $(name)_debug |
| 4641 | endif |
| 4642 | name := $(name)-symbols-$(FILE_NAME_TAG) |
| 4643 | |
| 4644 | SYMBOLS_ZIP := $(PRODUCT_OUT)/$(name).zip |
Colin Cross | 6cdc5d2 | 2017-10-20 11:37:33 -0700 | [diff] [blame] | 4645 | # For apps_only build we'll establish the dependency later in build/make/core/main.mk. |
Ying Wang | da3b972 | 2014-10-24 11:36:59 -0700 | [diff] [blame] | 4646 | ifndef TARGET_BUILD_APPS |
Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 4647 | $(SYMBOLS_ZIP): $(INSTALLED_SYSTEMIMAGE_TARGET) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4648 | $(INSTALLED_RAMDISK_TARGET) \ |
| 4649 | $(INSTALLED_BOOTIMAGE_TARGET) \ |
| 4650 | $(INSTALLED_USERDATAIMAGE_TARGET) \ |
| 4651 | $(INSTALLED_VENDORIMAGE_TARGET) \ |
| 4652 | $(INSTALLED_PRODUCTIMAGE_TARGET) \ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 4653 | $(INSTALLED_SYSTEM_EXTIMAGE_TARGET) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4654 | $(INSTALLED_ODMIMAGE_TARGET) \ |
| 4655 | $(updater_dep) |
Ying Wang | da3b972 | 2014-10-24 11:36:59 -0700 | [diff] [blame] | 4656 | endif |
Dan Willemsen | 5e29cad | 2016-08-06 20:15:06 -0700 | [diff] [blame] | 4657 | $(SYMBOLS_ZIP): PRIVATE_LIST_FILE := $(call intermediates-dir-for,PACKAGING,symbols)/filelist |
| 4658 | $(SYMBOLS_ZIP): $(SOONG_ZIP) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4659 | @echo "Package symbols: $@" |
Dan Willemsen | 5e29cad | 2016-08-06 20:15:06 -0700 | [diff] [blame] | 4660 | $(hide) rm -rf $@ $(PRIVATE_LIST_FILE) |
| 4661 | $(hide) mkdir -p $(dir $@) $(TARGET_OUT_UNSTRIPPED) $(dir $(PRIVATE_LIST_FILE)) |
Jiyong Park | 88e0980 | 2019-03-21 15:19:16 +0900 | [diff] [blame] | 4662 | $(hide) find -L $(TARGET_OUT_UNSTRIPPED) -type f | sort >$(PRIVATE_LIST_FILE) |
Colin Cross | 8d34244 | 2019-05-07 11:47:13 -0700 | [diff] [blame] | 4663 | $(hide) $(SOONG_ZIP) --ignore_missing_files -d -o $@ -C $(OUT_DIR)/.. -l $(PRIVATE_LIST_FILE) |
Ryan Campbell | 81c9d29 | 2016-09-12 13:56:50 -0700 | [diff] [blame] | 4664 | # ----------------------------------------------------------------- |
| 4665 | # A zip of the coverage directory. |
| 4666 | # |
Oliver Nguyen | e91ab23 | 2019-04-30 15:14:44 -0700 | [diff] [blame] | 4667 | name := gcov-report-files-all |
Ryan Campbell | 81c9d29 | 2016-09-12 13:56:50 -0700 | [diff] [blame] | 4668 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 4669 | name := $(name)_debug |
| 4670 | endif |
Ryan Campbell | 81c9d29 | 2016-09-12 13:56:50 -0700 | [diff] [blame] | 4671 | COVERAGE_ZIP := $(PRODUCT_OUT)/$(name).zip |
| 4672 | ifndef TARGET_BUILD_APPS |
Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 4673 | $(COVERAGE_ZIP): $(INSTALLED_SYSTEMIMAGE_TARGET) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4674 | $(INSTALLED_RAMDISK_TARGET) \ |
| 4675 | $(INSTALLED_BOOTIMAGE_TARGET) \ |
| 4676 | $(INSTALLED_USERDATAIMAGE_TARGET) \ |
| 4677 | $(INSTALLED_VENDORIMAGE_TARGET) \ |
| 4678 | $(INSTALLED_PRODUCTIMAGE_TARGET) \ |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 4679 | $(INSTALLED_SYSTEM_EXTIMAGE_TARGET) \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4680 | $(INSTALLED_ODMIMAGE_TARGET) |
Ryan Campbell | 81c9d29 | 2016-09-12 13:56:50 -0700 | [diff] [blame] | 4681 | endif |
| 4682 | $(COVERAGE_ZIP): PRIVATE_LIST_FILE := $(call intermediates-dir-for,PACKAGING,coverage)/filelist |
| 4683 | $(COVERAGE_ZIP): $(SOONG_ZIP) |
| 4684 | @echo "Package coverage: $@" |
| 4685 | $(hide) rm -rf $@ $(PRIVATE_LIST_FILE) |
| 4686 | $(hide) mkdir -p $(dir $@) $(TARGET_OUT_COVERAGE) $(dir $(PRIVATE_LIST_FILE)) |
| 4687 | $(hide) find $(TARGET_OUT_COVERAGE) | sort >$(PRIVATE_LIST_FILE) |
| 4688 | $(hide) $(SOONG_ZIP) -d -o $@ -C $(TARGET_OUT_COVERAGE) -l $(PRIVATE_LIST_FILE) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4689 | |
| 4690 | # ----------------------------------------------------------------- |
| 4691 | # A zip of the Android Apps. Not keeping full path so that we don't |
| 4692 | # include product names when distributing |
| 4693 | # |
| 4694 | name := $(TARGET_PRODUCT) |
| 4695 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 4696 | name := $(name)_debug |
| 4697 | endif |
| 4698 | name := $(name)-apps-$(FILE_NAME_TAG) |
| 4699 | |
| 4700 | APPS_ZIP := $(PRODUCT_OUT)/$(name).zip |
Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 4701 | $(APPS_ZIP): $(INSTALLED_SYSTEMIMAGE_TARGET) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4702 | @echo "Package apps: $@" |
| 4703 | $(hide) rm -rf $@ |
| 4704 | $(hide) mkdir -p $(dir $@) |
Gaurav Shah | 67c2ed3 | 2015-08-23 09:40:05 -0700 | [diff] [blame] | 4705 | $(hide) apps_to_zip=`find $(TARGET_OUT_APPS) $(TARGET_OUT_APPS_PRIVILEGED) -mindepth 2 -maxdepth 3 -name "*.apk"`; \ |
| 4706 | if [ -z "$$apps_to_zip" ]; then \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4707 | echo "No apps to zip up. Generating empty apps archive." ; \ |
| 4708 | a=$$(mktemp /tmp/XXXXXXX) && touch $$a && zip $@ $$a && zip -d $@ $$a; \ |
Gaurav Shah | 67c2ed3 | 2015-08-23 09:40:05 -0700 | [diff] [blame] | 4709 | else \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4710 | zip -qjX $@ $$apps_to_zip; \ |
Gaurav Shah | 67c2ed3 | 2015-08-23 09:40:05 -0700 | [diff] [blame] | 4711 | fi |
Guang Zhu | 0198d6e | 2010-04-23 11:54:37 -0700 | [diff] [blame] | 4712 | |
Ying Wang | bc415dd | 2012-08-15 12:22:44 -0700 | [diff] [blame] | 4713 | ifeq (true,$(EMMA_INSTRUMENT)) |
Colin Cross | a6bc3a8 | 2017-09-27 14:28:41 -0700 | [diff] [blame] | 4714 | #------------------------------------------------------------------ |
| 4715 | # An archive of classes for use in generating code-coverage reports |
| 4716 | # These are the uninstrumented versions of any classes that were |
| 4717 | # to be instrumented. |
Colin Cross | 6cdc5d2 | 2017-10-20 11:37:33 -0700 | [diff] [blame] | 4718 | # Any dependencies are set up later in build/make/core/main.mk. |
Jeff Gaston | aaae43c | 2017-04-11 16:36:46 -0700 | [diff] [blame] | 4719 | |
Colin Cross | a6bc3a8 | 2017-09-27 14:28:41 -0700 | [diff] [blame] | 4720 | JACOCO_REPORT_CLASSES_ALL := $(PRODUCT_OUT)/jacoco-report-classes-all.jar |
Jeff Gaston | aaae43c | 2017-04-11 16:36:46 -0700 | [diff] [blame] | 4721 | $(JACOCO_REPORT_CLASSES_ALL) : |
| 4722 | @echo "Collecting uninstrumented classes" |
| 4723 | $(hide) find $(TARGET_COMMON_OUT_ROOT) $(HOST_COMMON_OUT_ROOT) -name "jacoco-report-classes.jar" | \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 4724 | zip -@ -0 -q -X $@ |
Jeff Gaston | aaae43c | 2017-04-11 16:36:46 -0700 | [diff] [blame] | 4725 | # Meaning of these options: |
| 4726 | # -@ scan stdin for file paths to add to the zip |
| 4727 | # -0 don't do any compression |
| 4728 | # -q supress most output |
| 4729 | # -X skip storing extended file attributes |
| 4730 | |
Ying Wang | bc415dd | 2012-08-15 12:22:44 -0700 | [diff] [blame] | 4731 | endif # EMMA_INSTRUMENT=true |
| 4732 | |
Jeff Gaston | aaae43c | 2017-04-11 16:36:46 -0700 | [diff] [blame] | 4733 | |
Ying Wang | ae9115a | 2013-08-22 20:52:47 -0700 | [diff] [blame] | 4734 | #------------------------------------------------------------------ |
| 4735 | # A zip of Proguard obfuscation dictionary files. |
Ying Wang | ae9115a | 2013-08-22 20:52:47 -0700 | [diff] [blame] | 4736 | # |
Ying Wang | c62c92c | 2013-08-28 18:38:25 -0700 | [diff] [blame] | 4737 | PROGUARD_DICT_ZIP := $(PRODUCT_OUT)/$(TARGET_PRODUCT)-proguard-dict-$(FILE_NAME_TAG).zip |
Colin Cross | 114e8df | 2019-09-05 17:19:35 -0700 | [diff] [blame] | 4738 | # For apps_only build we'll establish the dependency later in build/make/core/main.mk. |
| 4739 | ifndef TARGET_BUILD_APPS |
| 4740 | $(PROGUARD_DICT_ZIP): \ |
| 4741 | $(INSTALLED_SYSTEMIMAGE_TARGET) \ |
| 4742 | $(INSTALLED_RAMDISK_TARGET) \ |
| 4743 | $(INSTALLED_BOOTIMAGE_TARGET) \ |
| 4744 | $(INSTALLED_USERDATAIMAGE_TARGET) \ |
| 4745 | $(INSTALLED_VENDORIMAGE_TARGET) \ |
| 4746 | $(INSTALLED_PRODUCTIMAGE_TARGET) \ |
| 4747 | $(INSTALLED_SYSTEM_EXTIMAGE_TARGET) \ |
| 4748 | $(INSTALLED_ODMIMAGE_TARGET) \ |
| 4749 | $(updater_dep) |
| 4750 | endif |
| 4751 | $(PROGUARD_DICT_ZIP): PRIVATE_LIST_FILE := $(call intermediates-dir-for,PACKAGING,proguard)/filelist |
| 4752 | $(PROGUARD_DICT_ZIP): $(SOONG_ZIP) |
Ying Wang | ae9115a | 2013-08-22 20:52:47 -0700 | [diff] [blame] | 4753 | @echo "Packaging Proguard obfuscation dictionary files." |
Colin Cross | 114e8df | 2019-09-05 17:19:35 -0700 | [diff] [blame] | 4754 | mkdir -p $(dir $@) $(TARGET_OUT_COMMON_INTERMEDIATES)/APPS $(dir $(PRIVATE_LIST_FILE)) |
| 4755 | find $(TARGET_OUT_COMMON_INTERMEDIATES)/APPS -name proguard_dictionary | \ |
| 4756 | sed -e 's/\(.*\)\/proguard_dictionary/\0\n\1\/classes.jar/' > $(PRIVATE_LIST_FILE) |
| 4757 | $(SOONG_ZIP) --ignore_missing_files -d -o $@ -C $(OUT_DIR)/.. -l $(PRIVATE_LIST_FILE) |
Ying Wang | ae9115a | 2013-08-22 20:52:47 -0700 | [diff] [blame] | 4758 | |
Tao Bao | 48a2feb | 2019-06-28 11:00:05 -0700 | [diff] [blame] | 4759 | |
| 4760 | ifeq (true,$(PRODUCT_USE_DYNAMIC_PARTITIONS)) |
| 4761 | |
| 4762 | # Dump variables used by build_super_image.py (for building super.img and super_empty.img). |
| 4763 | # $(1): output file |
| 4764 | define dump-super-image-info |
| 4765 | $(call dump-dynamic-partitions-info,$(1)) |
| 4766 | $(if $(filter true,$(AB_OTA_UPDATER)), \ |
| 4767 | echo "ab_update=true" >> $(1)) |
| 4768 | endef |
| 4769 | |
| 4770 | endif # PRODUCT_USE_DYNAMIC_PARTITIONS |
| 4771 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4772 | # ----------------------------------------------------------------- |
Yifan Hong | acd862a | 2019-04-16 15:44:30 -0700 | [diff] [blame] | 4773 | # super partition image (dist) |
Yifan Hong | 2b891ac | 2018-11-29 12:06:31 -0800 | [diff] [blame] | 4774 | |
| 4775 | ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION)) |
| 4776 | |
| 4777 | # BOARD_SUPER_PARTITION_SIZE must be defined to build super image. |
| 4778 | ifneq ($(BOARD_SUPER_PARTITION_SIZE),) |
| 4779 | |
| 4780 | ifneq (true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)) |
Yifan Hong | acd862a | 2019-04-16 15:44:30 -0700 | [diff] [blame] | 4781 | |
| 4782 | # For real devices and for dist builds, build super image from target files to an intermediate directory. |
| 4783 | INTERNAL_SUPERIMAGE_DIST_TARGET := $(call intermediates-dir-for,PACKAGING,super.img)/super.img |
| 4784 | $(INTERNAL_SUPERIMAGE_DIST_TARGET): extracted_input_target_files := $(patsubst %.zip,%,$(BUILT_TARGET_FILES_PACKAGE)) |
| 4785 | $(INTERNAL_SUPERIMAGE_DIST_TARGET): $(LPMAKE) $(BUILT_TARGET_FILES_PACKAGE) $(BUILD_SUPER_IMAGE) |
| 4786 | $(call pretty,"Target super fs image from target files: $@") |
Tao Bao | 403a2f9 | 2018-12-13 10:45:46 -0800 | [diff] [blame] | 4787 | PATH=$(dir $(LPMAKE)):$$PATH \ |
| 4788 | $(BUILD_SUPER_IMAGE) -v $(extracted_input_target_files) $@ |
Yifan Hong | 69e0d61 | 2019-03-11 15:55:33 -0700 | [diff] [blame] | 4789 | |
Yifan Hong | 0e97dbb | 2019-04-17 14:28:52 -0700 | [diff] [blame] | 4790 | # Skip packing it in dist package because it is in update package. |
| 4791 | ifneq (true,$(BOARD_SUPER_IMAGE_IN_UPDATE_PACKAGE)) |
Yifan Hong | acd862a | 2019-04-16 15:44:30 -0700 | [diff] [blame] | 4792 | $(call dist-for-goals,dist_files,$(INTERNAL_SUPERIMAGE_DIST_TARGET)) |
Yifan Hong | 0e97dbb | 2019-04-17 14:28:52 -0700 | [diff] [blame] | 4793 | endif |
Yifan Hong | acd862a | 2019-04-16 15:44:30 -0700 | [diff] [blame] | 4794 | |
| 4795 | .PHONY: superimage_dist |
| 4796 | superimage_dist: $(INTERNAL_SUPERIMAGE_DIST_TARGET) |
Yifan Hong | 69e0d61 | 2019-03-11 15:55:33 -0700 | [diff] [blame] | 4797 | |
| 4798 | endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS != "true" |
Yifan Hong | acd862a | 2019-04-16 15:44:30 -0700 | [diff] [blame] | 4799 | endif # BOARD_SUPER_PARTITION_SIZE != "" |
| 4800 | endif # PRODUCT_BUILD_SUPER_PARTITION == "true" |
Yifan Hong | 2b891ac | 2018-11-29 12:06:31 -0800 | [diff] [blame] | 4801 | |
Yifan Hong | acd862a | 2019-04-16 15:44:30 -0700 | [diff] [blame] | 4802 | # ----------------------------------------------------------------- |
| 4803 | # super partition image for development |
| 4804 | |
| 4805 | ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION)) |
| 4806 | ifneq ($(BOARD_SUPER_PARTITION_SIZE),) |
| 4807 | ifneq (true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)) |
| 4808 | |
| 4809 | # Build super.img by using $(INSTALLED_*IMAGE_TARGET) to $(1) |
| 4810 | # $(1): built image path |
| 4811 | # $(2): misc_info.txt path; its contents should match expectation of build_super_image.py |
| 4812 | define build-superimage-target |
| 4813 | mkdir -p $(dir $(2)) |
| 4814 | rm -rf $(2) |
| 4815 | $(call dump-super-image-info,$(2)) |
| 4816 | $(foreach p,$(BOARD_SUPER_PARTITION_PARTITION_LIST), \ |
| 4817 | echo "$(p)_image=$(INSTALLED_$(call to-upper,$(p))IMAGE_TARGET)" >> $(2);) |
changho.shin | a8f9f11 | 2019-10-15 13:26:19 +0900 | [diff] [blame] | 4818 | $(if $(BUILDING_SYSTEM_OTHER_IMAGE), $(if $(filter system,$(BOARD_SUPER_PARTITION_PARTITION_LIST)), \ |
| 4819 | echo "system_other_image=$(INSTALLED_SYSTEMOTHERIMAGE_TARGET)" >> $(2);)) |
Yifan Hong | acd862a | 2019-04-16 15:44:30 -0700 | [diff] [blame] | 4820 | mkdir -p $(dir $(1)) |
| 4821 | PATH=$(dir $(LPMAKE)):$$PATH \ |
| 4822 | $(BUILD_SUPER_IMAGE) -v $(2) $(1) |
| 4823 | endef |
| 4824 | |
| 4825 | INSTALLED_SUPERIMAGE_TARGET := $(PRODUCT_OUT)/super.img |
| 4826 | INSTALLED_SUPERIMAGE_DEPENDENCIES := $(LPMAKE) $(BUILD_SUPER_IMAGE) \ |
| 4827 | $(foreach p, $(BOARD_SUPER_PARTITION_PARTITION_LIST), $(INSTALLED_$(call to-upper,$(p))IMAGE_TARGET)) |
| 4828 | |
changho.shin | a8f9f11 | 2019-10-15 13:26:19 +0900 | [diff] [blame] | 4829 | ifdef BUILDING_SYSTEM_OTHER_IMAGE |
| 4830 | ifneq ($(filter system,$(BOARD_SUPER_PARTITION_PARTITION_LIST)),) |
| 4831 | INSTALLED_SUPERIMAGE_DEPENDENCIES += $(INSTALLED_SYSTEMOTHERIMAGE_TARGET) |
| 4832 | endif |
| 4833 | endif |
| 4834 | |
Yifan Hong | acd862a | 2019-04-16 15:44:30 -0700 | [diff] [blame] | 4835 | # If BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT is set, super.img is built from images in the |
| 4836 | # $(PRODUCT_OUT) directory, and is built to $(PRODUCT_OUT)/super.img. Also, it will |
| 4837 | # be built for non-dist builds. This is useful for devices that uses super.img directly, e.g. |
| 4838 | # virtual devices. |
| 4839 | ifeq (true,$(BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT)) |
| 4840 | $(INSTALLED_SUPERIMAGE_TARGET): $(INSTALLED_SUPERIMAGE_DEPENDENCIES) |
| 4841 | $(call pretty,"Target super fs image for debug: $@") |
| 4842 | $(call build-superimage-target,$(INSTALLED_SUPERIMAGE_TARGET),\ |
Isaac Chen | 52cc60c | 2019-08-14 18:52:13 +0800 | [diff] [blame] | 4843 | $(call intermediates-dir-for,PACKAGING,superimage_debug)/misc_info.txt) |
Yifan Hong | acd862a | 2019-04-16 15:44:30 -0700 | [diff] [blame] | 4844 | |
| 4845 | droidcore: $(INSTALLED_SUPERIMAGE_TARGET) |
| 4846 | |
| 4847 | # For devices that uses super image directly, the superimage target points to the file in $(PRODUCT_OUT). |
| 4848 | .PHONY: superimage |
| 4849 | superimage: $(INSTALLED_SUPERIMAGE_TARGET) |
Isaac Chen | 52cc60c | 2019-08-14 18:52:13 +0800 | [diff] [blame] | 4850 | |
| 4851 | $(call dist-for-goals,dist_files,$(INSTALLED_MISC_INFO_TARGET):super_misc_info.txt) |
Yifan Hong | acd862a | 2019-04-16 15:44:30 -0700 | [diff] [blame] | 4852 | endif # BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT |
| 4853 | |
| 4854 | # Build $(PRODUCT_OUT)/super.img without dependencies. |
| 4855 | .PHONY: superimage-nodeps supernod |
| 4856 | superimage-nodeps supernod: intermediates := |
| 4857 | superimage-nodeps supernod: | $(INSTALLED_SUPERIMAGE_DEPENDENCIES) |
| 4858 | $(call pretty,"make $(INSTALLED_SUPERIMAGE_TARGET): ignoring dependencies") |
| 4859 | $(call build-superimage-target,$(INSTALLED_SUPERIMAGE_TARGET),\ |
| 4860 | $(call intermediates-dir-for,PACKAGING,superimage-nodeps)/misc_info.txt) |
| 4861 | |
| 4862 | endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS != "true" |
| 4863 | endif # BOARD_SUPER_PARTITION_SIZE != "" |
| 4864 | endif # PRODUCT_BUILD_SUPER_PARTITION == "true" |
| 4865 | |
| 4866 | # ----------------------------------------------------------------- |
| 4867 | # super empty image |
| 4868 | |
Tao Bao | 48a2feb | 2019-06-28 11:00:05 -0700 | [diff] [blame] | 4869 | ifeq (true,$(PRODUCT_USE_DYNAMIC_PARTITIONS)) |
Yifan Hong | acd862a | 2019-04-16 15:44:30 -0700 | [diff] [blame] | 4870 | ifneq ($(BOARD_SUPER_PARTITION_SIZE),) |
Yifan Hong | 2b891ac | 2018-11-29 12:06:31 -0800 | [diff] [blame] | 4871 | |
Yifan Hong | 8b79d16 | 2018-11-29 12:32:00 -0800 | [diff] [blame] | 4872 | INSTALLED_SUPERIMAGE_EMPTY_TARGET := $(PRODUCT_OUT)/super_empty.img |
| 4873 | $(INSTALLED_SUPERIMAGE_EMPTY_TARGET): intermediates := $(call intermediates-dir-for,PACKAGING,super_empty) |
| 4874 | $(INSTALLED_SUPERIMAGE_EMPTY_TARGET): $(LPMAKE) $(BUILD_SUPER_IMAGE) |
| 4875 | $(call pretty,"Target empty super fs image: $@") |
| 4876 | mkdir -p $(intermediates) |
| 4877 | rm -rf $(intermediates)/misc_info.txt |
Yifan Hong | 69e0d61 | 2019-03-11 15:55:33 -0700 | [diff] [blame] | 4878 | $(call dump-super-image-info,$(intermediates)/misc_info.txt) |
Tao Bao | 403a2f9 | 2018-12-13 10:45:46 -0800 | [diff] [blame] | 4879 | PATH=$(dir $(LPMAKE)):$$PATH \ |
| 4880 | $(BUILD_SUPER_IMAGE) -v $(intermediates)/misc_info.txt $@ |
Yifan Hong | 8b79d16 | 2018-11-29 12:32:00 -0800 | [diff] [blame] | 4881 | |
| 4882 | $(call dist-for-goals,dist_files,$(INSTALLED_SUPERIMAGE_EMPTY_TARGET)) |
| 4883 | |
Yifan Hong | 2b891ac | 2018-11-29 12:06:31 -0800 | [diff] [blame] | 4884 | endif # BOARD_SUPER_PARTITION_SIZE != "" |
Tao Bao | 48a2feb | 2019-06-28 11:00:05 -0700 | [diff] [blame] | 4885 | endif # PRODUCT_USE_DYNAMIC_PARTITIONS == "true" |
Yifan Hong | 2b891ac | 2018-11-29 12:06:31 -0800 | [diff] [blame] | 4886 | |
Yifan Hong | 0e97dbb | 2019-04-17 14:28:52 -0700 | [diff] [blame] | 4887 | |
| 4888 | # ----------------------------------------------------------------- |
| 4889 | # The update package |
| 4890 | |
| 4891 | name := $(TARGET_PRODUCT) |
| 4892 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 4893 | name := $(name)_debug |
| 4894 | endif |
| 4895 | name := $(name)-img-$(FILE_NAME_TAG) |
| 4896 | |
| 4897 | INTERNAL_UPDATE_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip |
| 4898 | |
Tao Bao | 57f8ed6 | 2019-08-14 23:08:18 -0700 | [diff] [blame] | 4899 | $(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(IMG_FROM_TARGET_FILES) |
| 4900 | $(call pretty,"Package: $@") |
| 4901 | PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$(dir $(ZIP2ZIP)):$$PATH \ |
| 4902 | $(IMG_FROM_TARGET_FILES) \ |
| 4903 | --additional IMAGES/VerifiedBootParams.textproto:VerifiedBootParams.textproto \ |
| 4904 | $(BUILT_TARGET_FILES_PACKAGE) $@ |
Yifan Hong | 0e97dbb | 2019-04-17 14:28:52 -0700 | [diff] [blame] | 4905 | |
| 4906 | .PHONY: updatepackage |
| 4907 | updatepackage: $(INTERNAL_UPDATE_PACKAGE_TARGET) |
Dan Willemsen | 9ae6495 | 2019-08-05 14:45:11 -0700 | [diff] [blame] | 4908 | $(call dist-for-goals,updatepackage,$(INTERNAL_UPDATE_PACKAGE_TARGET)) |
Yifan Hong | 0e97dbb | 2019-04-17 14:28:52 -0700 | [diff] [blame] | 4909 | |
| 4910 | |
Yifan Hong | 2b891ac | 2018-11-29 12:06:31 -0800 | [diff] [blame] | 4911 | # ----------------------------------------------------------------- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4912 | # dalvik something |
| 4913 | .PHONY: dalvikfiles |
| 4914 | dalvikfiles: $(INTERNAL_DALVIK_MODULES) |
| 4915 | |
Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 4916 | ifeq ($(BUILD_QEMU_IMAGES),true) |
Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 4917 | MK_QEMU_IMAGE_SH := device/generic/goldfish/tools/mk_qemu_image.sh |
Isaac Chen | 9e09d47 | 2019-07-05 17:30:41 +0800 | [diff] [blame] | 4918 | MK_COMBINE_QEMU_IMAGE := $(HOST_OUT_EXECUTABLES)/mk_combined_img |
Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 4919 | SGDISK_HOST := $(HOST_OUT_EXECUTABLES)/sgdisk |
Roman Kiryanov | e64998f | 2019-02-14 16:45:33 -0800 | [diff] [blame] | 4920 | |
| 4921 | ifdef INSTALLED_SYSTEMIMAGE_TARGET |
| 4922 | INSTALLED_QEMU_SYSTEMIMAGE := $(PRODUCT_OUT)/system-qemu.img |
bohu | 9492ee3 | 2019-03-07 10:03:41 -0800 | [diff] [blame] | 4923 | INSTALLED_SYSTEM_QEMU_CONFIG := $(PRODUCT_OUT)/system-qemu-config.txt |
| 4924 | $(INSTALLED_SYSTEM_QEMU_CONFIG): $(INSTALLED_SUPERIMAGE_TARGET) $(INSTALLED_VBMETAIMAGE_TARGET) |
| 4925 | @echo "$(PRODUCT_OUT)/vbmeta.img vbmeta 1" > $@ |
| 4926 | @echo "$(INSTALLED_SUPERIMAGE_TARGET) super 2" >> $@ |
Isaac Chen | 9e09d47 | 2019-07-05 17:30:41 +0800 | [diff] [blame] | 4927 | $(INSTALLED_QEMU_SYSTEMIMAGE): $(INSTALLED_VBMETAIMAGE_TARGET) $(MK_COMBINE_QEMU_IMAGE) $(SGDISK_HOST) $(SIMG2IMG) \ |
bohu | 9492ee3 | 2019-03-07 10:03:41 -0800 | [diff] [blame] | 4928 | $(INSTALLED_SUPERIMAGE_TARGET) $(INSTALLED_SYSTEM_QEMU_CONFIG) |
| 4929 | @echo Create system-qemu.img now |
| 4930 | (export SGDISK=$(SGDISK_HOST) SIMG2IMG=$(SIMG2IMG); \ |
Isaac Chen | 9e09d47 | 2019-07-05 17:30:41 +0800 | [diff] [blame] | 4931 | $(MK_COMBINE_QEMU_IMAGE) -i $(INSTALLED_SYSTEM_QEMU_CONFIG) -o $@) |
Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 4932 | |
| 4933 | systemimage: $(INSTALLED_QEMU_SYSTEMIMAGE) |
| 4934 | droidcore: $(INSTALLED_QEMU_SYSTEMIMAGE) |
Roman Kiryanov | e64998f | 2019-02-14 16:45:33 -0800 | [diff] [blame] | 4935 | endif |
Anton Hansson | 32c76fe | 2018-12-13 14:34:18 +0000 | [diff] [blame] | 4936 | ifdef INSTALLED_VENDORIMAGE_TARGET |
Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 4937 | INSTALLED_QEMU_VENDORIMAGE := $(PRODUCT_OUT)/vendor-qemu.img |
Isaac Chen | b9b51b1 | 2018-08-03 18:34:55 +0000 | [diff] [blame] | 4938 | $(INSTALLED_QEMU_VENDORIMAGE): $(INSTALLED_VENDORIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) $(SIMG2IMG) |
Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 4939 | @echo Create vendor-qemu.img |
Roman Kiryanov | 4985cc8 | 2019-02-15 10:22:45 -0800 | [diff] [blame] | 4940 | (export SGDISK=$(SGDISK_HOST) SIMG2IMG=$(SIMG2IMG); $(MK_QEMU_IMAGE_SH) $(INSTALLED_VENDORIMAGE_TARGET)) |
Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 4941 | |
| 4942 | vendorimage: $(INSTALLED_QEMU_VENDORIMAGE) |
| 4943 | droidcore: $(INSTALLED_QEMU_VENDORIMAGE) |
| 4944 | endif |
Anton Hansson | 32c76fe | 2018-12-13 14:34:18 +0000 | [diff] [blame] | 4945 | ifdef INSTALLED_PRODUCTIMAGE_TARGET |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 4946 | INSTALLED_QEMU_PRODUCTIMAGE := $(PRODUCT_OUT)/product-qemu.img |
Isaac Chen | b9b51b1 | 2018-08-03 18:34:55 +0000 | [diff] [blame] | 4947 | $(INSTALLED_QEMU_PRODUCTIMAGE): $(INSTALLED_PRODUCTIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) $(SIMG2IMG) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 4948 | @echo Create product-qemu.img |
Roman Kiryanov | 4985cc8 | 2019-02-15 10:22:45 -0800 | [diff] [blame] | 4949 | (export SGDISK=$(SGDISK_HOST) SIMG2IMG=$(SIMG2IMG); $(MK_QEMU_IMAGE_SH) $(INSTALLED_PRODUCTIMAGE_TARGET)) |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 4950 | |
| 4951 | productimage: $(INSTALLED_QEMU_PRODUCTIMAGE) |
| 4952 | droidcore: $(INSTALLED_QEMU_PRODUCTIMAGE) |
| 4953 | endif |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 4954 | ifdef INSTALLED_SYSTEM_EXTIMAGE_TARGET |
| 4955 | INSTALLED_QEMU_SYSTEM_EXTIMAGE := $(PRODUCT_OUT)/system_ext-qemu.img |
| 4956 | $(INSTALLED_QEMU_SYSTEM_EXTIMAGE): $(INSTALLED_SYSTEM_EXTIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) $(SIMG2IMG) |
| 4957 | @echo Create system_ext-qemu.img |
| 4958 | (export SGDISK=$(SGDISK_HOST) SIMG2IMG=$(SIMG2IMG); $(MK_QEMU_IMAGE_SH) $(INSTALLED_SYSTEM_EXTIMAGE_TARGET)) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 4959 | |
Justin Yun | 6151e3f | 2019-06-25 15:58:13 +0900 | [diff] [blame] | 4960 | systemextimage: $(INSTALLED_QEMU_SYSTEM_EXTIMAGE) |
| 4961 | droidcore: $(INSTALLED_QEMU_SYSTEM_EXTIMAGE) |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 4962 | endif |
Anton Hansson | 32c76fe | 2018-12-13 14:34:18 +0000 | [diff] [blame] | 4963 | ifdef INSTALLED_ODMIMAGE_TARGET |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 4964 | INSTALLED_QEMU_ODMIMAGE := $(PRODUCT_OUT)/odm-qemu.img |
| 4965 | $(INSTALLED_QEMU_ODMIMAGE): $(INSTALLED_ODMIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) |
| 4966 | @echo Create odm-qemu.img |
Roman Kiryanov | 4985cc8 | 2019-02-15 10:22:45 -0800 | [diff] [blame] | 4967 | (export SGDISK=$(SGDISK_HOST); $(MK_QEMU_IMAGE_SH) $(INSTALLED_ODMIMAGE_TARGET)) |
Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 4968 | |
| 4969 | odmimage: $(INSTALLED_QEMU_ODMIMAGE) |
| 4970 | droidcore: $(INSTALLED_QEMU_ODMIMAGE) |
| 4971 | endif |
Matt Wachowski | 9e4d515 | 2018-08-07 16:29:22 -0700 | [diff] [blame] | 4972 | |
Matt Wachowski | 9e4d515 | 2018-08-07 16:29:22 -0700 | [diff] [blame] | 4973 | QEMU_VERIFIED_BOOT_PARAMS := $(PRODUCT_OUT)/VerifiedBootParams.textproto |
bohu | 9492ee3 | 2019-03-07 10:03:41 -0800 | [diff] [blame] | 4974 | $(QEMU_VERIFIED_BOOT_PARAMS): $(INSTALLED_VBMETAIMAGE_TARGET) $(INSTALLED_SYSTEMIMAGE_TARGET) \ |
| 4975 | $(MK_VBMETA_BOOT_KERNEL_CMDLINE_SH) $(AVBTOOL) |
Matt Wachowski | 9e4d515 | 2018-08-07 16:29:22 -0700 | [diff] [blame] | 4976 | @echo Creating $@ |
bohu | 9492ee3 | 2019-03-07 10:03:41 -0800 | [diff] [blame] | 4977 | (export AVBTOOL=$(AVBTOOL); $(MK_VBMETA_BOOT_KERNEL_CMDLINE_SH) $(INSTALLED_VBMETAIMAGE_TARGET) \ |
| 4978 | $(INSTALLED_SYSTEMIMAGE_TARGET) $(QEMU_VERIFIED_BOOT_PARAMS)) |
Matt Wachowski | 9e4d515 | 2018-08-07 16:29:22 -0700 | [diff] [blame] | 4979 | |
| 4980 | systemimage: $(QEMU_VERIFIED_BOOT_PARAMS) |
| 4981 | droidcore: $(QEMU_VERIFIED_BOOT_PARAMS) |
bohu | 9492ee3 | 2019-03-07 10:03:41 -0800 | [diff] [blame] | 4982 | |
Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 4983 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4984 | # ----------------------------------------------------------------- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4985 | # The emulator package |
Ying Wang | 7d8c535 | 2012-07-26 10:15:21 -0700 | [diff] [blame] | 4986 | ifeq ($(BUILD_EMULATOR),true) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4987 | INTERNAL_EMULATOR_PACKAGE_FILES += \ |
| 4988 | $(HOST_OUT_EXECUTABLES)/emulator$(HOST_EXECUTABLE_SUFFIX) \ |
Jean-Baptiste Queru | 5ea72ef | 2012-01-06 16:44:06 -0800 | [diff] [blame] | 4989 | prebuilts/qemu-kernel/$(TARGET_ARCH)/kernel-qemu \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4990 | $(INSTALLED_RAMDISK_TARGET) \ |
Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 4991 | $(INSTALLED_SYSTEMIMAGE_TARGET) \ |
| 4992 | $(INSTALLED_USERDATAIMAGE_TARGET) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4993 | |
| 4994 | name := $(TARGET_PRODUCT)-emulator-$(FILE_NAME_TAG) |
| 4995 | |
| 4996 | INTERNAL_EMULATOR_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip |
| 4997 | |
Ying Wang | 5d88770 | 2015-11-04 10:06:25 -0800 | [diff] [blame] | 4998 | $(INTERNAL_EMULATOR_PACKAGE_TARGET): $(INTERNAL_EMULATOR_PACKAGE_FILES) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4999 | @echo "Package: $@" |
Dan Willemsen | 48a621c | 2015-10-29 16:33:05 -0700 | [diff] [blame] | 5000 | $(hide) zip -qjX $@ $(INTERNAL_EMULATOR_PACKAGE_FILES) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5001 | |
Ying Wang | 7d8c535 | 2012-07-26 10:15:21 -0700 | [diff] [blame] | 5002 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5003 | # ----------------------------------------------------------------- |
Keun young Park | 7fc7aad | 2012-02-27 15:49:23 -0800 | [diff] [blame] | 5004 | # Old PDK stuffs, retired |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5005 | # The pdk package (Platform Development Kit) |
| 5006 | |
Keun young Park | 7fc7aad | 2012-02-27 15:49:23 -0800 | [diff] [blame] | 5007 | #ifneq (,$(filter pdk,$(MAKECMDGOALS))) |
| 5008 | # include development/pdk/Pdk.mk |
| 5009 | #endif |
| 5010 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5011 | |
| 5012 | # ----------------------------------------------------------------- |
| 5013 | # The SDK |
| 5014 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5015 | # The SDK includes host-specific components, so it belongs under HOST_OUT. |
Ying Wang | d7af176 | 2014-06-02 16:16:53 -0700 | [diff] [blame] | 5016 | sdk_dir := $(HOST_OUT)/sdk/$(TARGET_PRODUCT) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5017 | |
| 5018 | # Build a name that looks like: |
| 5019 | # |
| 5020 | # linux-x86 --> android-sdk_12345_linux-x86 |
| 5021 | # darwin-x86 --> android-sdk_12345_mac-x86 |
| 5022 | # windows-x86 --> android-sdk_12345_windows |
| 5023 | # |
| 5024 | sdk_name := android-sdk_$(FILE_NAME_TAG) |
| 5025 | ifeq ($(HOST_OS),darwin) |
Joe Onorato | 03fbe40 | 2009-04-13 08:31:16 -0700 | [diff] [blame] | 5026 | INTERNAL_SDK_HOST_OS_NAME := mac |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5027 | else |
Joe Onorato | 03fbe40 | 2009-04-13 08:31:16 -0700 | [diff] [blame] | 5028 | INTERNAL_SDK_HOST_OS_NAME := $(HOST_OS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5029 | endif |
| 5030 | ifneq ($(HOST_OS),windows) |
Ying Wang | 2713fce | 2014-06-09 12:31:12 -0700 | [diff] [blame] | 5031 | INTERNAL_SDK_HOST_OS_NAME := $(INTERNAL_SDK_HOST_OS_NAME)-$(SDK_HOST_ARCH) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5032 | endif |
Joe Onorato | 03fbe40 | 2009-04-13 08:31:16 -0700 | [diff] [blame] | 5033 | sdk_name := $(sdk_name)_$(INTERNAL_SDK_HOST_OS_NAME) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5034 | |
| 5035 | sdk_dep_file := $(sdk_dir)/sdk_deps.mk |
| 5036 | |
| 5037 | ATREE_FILES := |
| 5038 | -include $(sdk_dep_file) |
| 5039 | |
| 5040 | # if we don't have a real list, then use "everything" |
| 5041 | ifeq ($(strip $(ATREE_FILES)),) |
| 5042 | ATREE_FILES := \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5043 | $(ALL_DEFAULT_INSTALLED_MODULES) \ |
| 5044 | $(INSTALLED_RAMDISK_TARGET) \ |
| 5045 | $(ALL_DOCS) \ |
Nan Zhang | cb0a688 | 2018-08-07 15:26:32 -0700 | [diff] [blame] | 5046 | $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/api-stubs-docs_annotations.zip \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5047 | $(ALL_SDK_FILES) |
| 5048 | endif |
| 5049 | |
| 5050 | atree_dir := development/build |
| 5051 | |
David 'Digit' Turner | 74b0c36 | 2011-03-23 11:20:14 +0100 | [diff] [blame] | 5052 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5053 | sdk_atree_files := \ |
| 5054 | $(atree_dir)/sdk.exclude.atree \ |
Ying Wang | 2713fce | 2014-06-09 12:31:12 -0700 | [diff] [blame] | 5055 | $(atree_dir)/sdk-$(HOST_OS)-$(SDK_HOST_ARCH).atree |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5056 | |
David 'Digit' Turner | 77ec16a | 2011-06-23 12:49:02 +0200 | [diff] [blame] | 5057 | # development/build/sdk-android-<abi>.atree is used to differentiate |
| 5058 | # between architecture models (e.g. ARMv5TE versus ARMv7) when copying |
| 5059 | # files like the kernel image. We use TARGET_CPU_ABI because we don't |
| 5060 | # have a better way to distinguish between CPU models. |
| 5061 | ifneq (,$(strip $(wildcard $(atree_dir)/sdk-android-$(TARGET_CPU_ABI).atree))) |
| 5062 | sdk_atree_files += $(atree_dir)/sdk-android-$(TARGET_CPU_ABI).atree |
| 5063 | endif |
| 5064 | |
Anton Hansson | 8dab0a6 | 2019-03-28 15:45:40 +0000 | [diff] [blame] | 5065 | ifneq ($(PRODUCT_SDK_ATREE_FILES),) |
| 5066 | sdk_atree_files += $(PRODUCT_SDK_ATREE_FILES) |
Griff Hazen | 433febb | 2014-02-28 08:45:59 -0800 | [diff] [blame] | 5067 | else |
| 5068 | sdk_atree_files += $(atree_dir)/sdk.atree |
| 5069 | endif |
| 5070 | |
Deepanshu Gupta | 7a864ea | 2014-08-11 15:20:02 -0700 | [diff] [blame] | 5071 | include $(BUILD_SYSTEM)/sdk_font.mk |
Deepanshu Gupta | 4e5e582 | 2014-08-01 10:14:15 -0700 | [diff] [blame] | 5072 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5073 | deps := \ |
| 5074 | $(target_notice_file_txt) \ |
| 5075 | $(tools_notice_file_txt) \ |
| 5076 | $(OUT_DOCS)/offline-sdk-timestamp \ |
Jerome Gaillard | a0171af | 2019-10-10 19:35:08 +0100 | [diff] [blame] | 5077 | $(SDK_METADATA_FILES) \ |
Ying Wang | 139e332 | 2010-03-31 17:29:04 -0700 | [diff] [blame] | 5078 | $(SYMBOLS_ZIP) \ |
Ryan Campbell | 81c9d29 | 2016-09-12 13:56:50 -0700 | [diff] [blame] | 5079 | $(COVERAGE_ZIP) \ |
Dario Freni | d101127 | 2018-07-23 20:20:15 +0100 | [diff] [blame] | 5080 | $(APPCOMPAT_ZIP) \ |
Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 5081 | $(INSTALLED_SYSTEMIMAGE_TARGET) \ |
Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 5082 | $(INSTALLED_QEMU_SYSTEMIMAGE) \ |
bohu | 18d1868 | 2017-08-14 14:52:20 -0700 | [diff] [blame] | 5083 | $(INSTALLED_QEMU_VENDORIMAGE) \ |
Matt Wachowski | 9e4d515 | 2018-08-07 16:29:22 -0700 | [diff] [blame] | 5084 | $(QEMU_VERIFIED_BOOT_PARAMS) \ |
Doug Zongker | dddd957 | 2009-06-15 21:25:32 -0700 | [diff] [blame] | 5085 | $(INSTALLED_USERDATAIMAGE_TARGET) \ |
| 5086 | $(INSTALLED_RAMDISK_TARGET) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5087 | $(INSTALLED_SDK_BUILD_PROP_TARGET) \ |
Ying Wang | 139e332 | 2010-03-31 17:29:04 -0700 | [diff] [blame] | 5088 | $(INSTALLED_BUILD_PROP_TARGET) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5089 | $(ATREE_FILES) \ |
Ying Wang | 0c0a4ce | 2014-02-18 14:29:59 -0800 | [diff] [blame] | 5090 | $(sdk_atree_files) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5091 | $(HOST_OUT_EXECUTABLES)/atree \ |
Deepanshu Gupta | 4e5e582 | 2014-08-01 10:14:15 -0700 | [diff] [blame] | 5092 | $(HOST_OUT_EXECUTABLES)/line_endings \ |
Deepanshu Gupta | 7a864ea | 2014-08-11 15:20:02 -0700 | [diff] [blame] | 5093 | $(SDK_FONT_DEPS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5094 | |
| 5095 | INTERNAL_SDK_TARGET := $(sdk_dir)/$(sdk_name).zip |
| 5096 | $(INTERNAL_SDK_TARGET): PRIVATE_NAME := $(sdk_name) |
| 5097 | $(INTERNAL_SDK_TARGET): PRIVATE_DIR := $(sdk_dir)/$(sdk_name) |
| 5098 | $(INTERNAL_SDK_TARGET): PRIVATE_DEP_FILE := $(sdk_dep_file) |
| 5099 | $(INTERNAL_SDK_TARGET): PRIVATE_INPUT_FILES := $(sdk_atree_files) |
| 5100 | |
| 5101 | # Set SDK_GNU_ERROR to non-empty to fail when a GNU target is built. |
| 5102 | # |
| 5103 | #SDK_GNU_ERROR := true |
| 5104 | |
Ying Wang | 5d88770 | 2015-11-04 10:06:25 -0800 | [diff] [blame] | 5105 | $(INTERNAL_SDK_TARGET): $(deps) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5106 | @echo "Package SDK: $@" |
| 5107 | $(hide) rm -rf $(PRIVATE_DIR) $@ |
| 5108 | $(hide) for f in $(target_gnu_MODULES); do \ |
| 5109 | if [ -f $$f ]; then \ |
| 5110 | echo SDK: $(if $(SDK_GNU_ERROR),ERROR:,warning:) \ |
| 5111 | including GNU target $$f >&2; \ |
| 5112 | FAIL=$(SDK_GNU_ERROR); \ |
| 5113 | fi; \ |
| 5114 | done; \ |
| 5115 | if [ $$FAIL ]; then exit 1; fi |
Deepanshu Gupta | 88a307e | 2014-08-12 10:23:58 -0700 | [diff] [blame] | 5116 | $(hide) echo $(notdir $(SDK_FONT_DEPS)) | tr " " "\n" > $(SDK_FONT_TEMP)/fontsInSdk.txt |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5117 | $(hide) ( \ |
Anton Hansson | 6d81498 | 2018-11-26 18:12:05 +0000 | [diff] [blame] | 5118 | ATREE_STRIP="$(HOST_STRIP) -x" \ |
| 5119 | $(HOST_OUT_EXECUTABLES)/atree \ |
| 5120 | $(addprefix -f ,$(PRIVATE_INPUT_FILES)) \ |
| 5121 | -m $(PRIVATE_DEP_FILE) \ |
| 5122 | -I . \ |
| 5123 | -I $(PRODUCT_OUT) \ |
| 5124 | -I $(HOST_OUT) \ |
| 5125 | -I $(TARGET_COMMON_OUT_ROOT) \ |
| 5126 | -v "PLATFORM_NAME=android-$(PLATFORM_VERSION)" \ |
| 5127 | -v "OUT_DIR=$(OUT_DIR)" \ |
| 5128 | -v "HOST_OUT=$(HOST_OUT)" \ |
| 5129 | -v "TARGET_ARCH=$(TARGET_ARCH)" \ |
| 5130 | -v "TARGET_CPU_ABI=$(TARGET_CPU_ABI)" \ |
| 5131 | -v "DLL_EXTENSION=$(HOST_SHLIB_SUFFIX)" \ |
| 5132 | -v "FONT_OUT=$(SDK_FONT_TEMP)" \ |
| 5133 | -o $(PRIVATE_DIR) && \ |
| 5134 | cp -f $(target_notice_file_txt) \ |
| 5135 | $(PRIVATE_DIR)/system-images/android-$(PLATFORM_VERSION)/$(TARGET_CPU_ABI)/NOTICE.txt && \ |
| 5136 | cp -f $(tools_notice_file_txt) $(PRIVATE_DIR)/platform-tools/NOTICE.txt && \ |
| 5137 | HOST_OUT_EXECUTABLES=$(HOST_OUT_EXECUTABLES) HOST_OS=$(HOST_OS) \ |
| 5138 | development/build/tools/sdk_clean.sh $(PRIVATE_DIR) && \ |
| 5139 | chmod -R ug+rwX $(PRIVATE_DIR) && \ |
| 5140 | cd $(dir $@) && zip -rqX $(notdir $@) $(PRIVATE_NAME) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5141 | ) || ( rm -rf $(PRIVATE_DIR) $@ && exit 44 ) |
| 5142 | |
Raphael | 3d224a0 | 2010-04-16 17:50:09 -0700 | [diff] [blame] | 5143 | |
| 5144 | # Is a Windows SDK requested? If so, we need some definitions from here |
| 5145 | # in order to find the Linux SDK used to create the Windows one. |
Raphael | c4d4731 | 2011-02-15 16:09:36 -0800 | [diff] [blame] | 5146 | MAIN_SDK_NAME := $(sdk_name) |
| 5147 | MAIN_SDK_DIR := $(sdk_dir) |
| 5148 | MAIN_SDK_ZIP := $(INTERNAL_SDK_TARGET) |
Ying Wang | ff1fe68 | 2015-01-27 12:47:10 -0800 | [diff] [blame] | 5149 | ifneq ($(filter win_sdk winsdk-tools,$(MAKECMDGOALS)),) |
Raphael | 3d224a0 | 2010-04-16 17:50:09 -0700 | [diff] [blame] | 5150 | include $(TOPDIR)development/build/tools/windows_sdk.mk |
| 5151 | endif |
| 5152 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5153 | # ----------------------------------------------------------------- |
| 5154 | # Findbugs |
| 5155 | INTERNAL_FINDBUGS_XML_TARGET := $(PRODUCT_OUT)/findbugs.xml |
| 5156 | INTERNAL_FINDBUGS_HTML_TARGET := $(PRODUCT_OUT)/findbugs.html |
| 5157 | $(INTERNAL_FINDBUGS_XML_TARGET): $(ALL_FINDBUGS_FILES) |
| 5158 | @echo UnionBugs: $@ |
Yuncheol Heo | 623d706 | 2014-05-20 17:04:16 +0900 | [diff] [blame] | 5159 | $(hide) $(FINDBUGS_DIR)/unionBugs $(ALL_FINDBUGS_FILES) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5160 | > $@ |
| 5161 | $(INTERNAL_FINDBUGS_HTML_TARGET): $(INTERNAL_FINDBUGS_XML_TARGET) |
| 5162 | @echo ConvertXmlToText: $@ |
Yuncheol Heo | 623d706 | 2014-05-20 17:04:16 +0900 | [diff] [blame] | 5163 | $(hide) $(FINDBUGS_DIR)/convertXmlToText -html:fancy.xsl \ |
Ying Wang | ad7fd29 | 2013-08-08 16:34:29 -0700 | [diff] [blame] | 5164 | $(INTERNAL_FINDBUGS_XML_TARGET) > $@ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5165 | |
| 5166 | # ----------------------------------------------------------------- |
| 5167 | # Findbugs |
| 5168 | |
| 5169 | # ----------------------------------------------------------------- |
| 5170 | # These are some additional build tasks that need to be run. |
Ying Wang | ad7fd29 | 2013-08-08 16:34:29 -0700 | [diff] [blame] | 5171 | ifneq ($(dont_bother),true) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5172 | include $(sort $(wildcard $(BUILD_SYSTEM)/tasks/*.mk)) |
Claes Elgemark | e22ad67 | 2010-11-12 15:46:00 +0100 | [diff] [blame] | 5173 | -include $(sort $(wildcard vendor/*/build/tasks/*.mk)) |
Andrew Boie | f34a9ba | 2012-04-16 10:03:16 -0700 | [diff] [blame] | 5174 | -include $(sort $(wildcard device/*/build/tasks/*.mk)) |
Lee Campbell | 04ba312 | 2015-08-20 15:39:56 -0700 | [diff] [blame] | 5175 | -include $(sort $(wildcard product/*/build/tasks/*.mk)) |
Ying Wang | 66c78e4 | 2014-09-05 17:47:34 -0700 | [diff] [blame] | 5176 | # Also the project-specific tasks |
| 5177 | -include $(sort $(wildcard vendor/*/*/build/tasks/*.mk)) |
| 5178 | -include $(sort $(wildcard device/*/*/build/tasks/*.mk)) |
Lee Campbell | 04ba312 | 2015-08-20 15:39:56 -0700 | [diff] [blame] | 5179 | -include $(sort $(wildcard product/*/*/build/tasks/*.mk)) |
Guang Zhu | 8322be7 | 2016-06-20 22:03:24 -0700 | [diff] [blame] | 5180 | # Also add test specifc tasks |
| 5181 | include $(sort $(wildcard platform_testing/build/tasks/*.mk)) |
Keun Soo Yim | 199a710 | 2016-08-31 09:20:51 -0700 | [diff] [blame] | 5182 | include $(sort $(wildcard test/vts/tools/build/tasks/*.mk)) |
Ying Wang | ad7fd29 | 2013-08-08 16:34:29 -0700 | [diff] [blame] | 5183 | endif |
Raphael | c4d4731 | 2011-02-15 16:09:36 -0800 | [diff] [blame] | 5184 | |
Ying Wang | 67132ba | 2015-10-28 16:42:39 -0700 | [diff] [blame] | 5185 | include $(BUILD_SYSTEM)/product-graph.mk |
| 5186 | |
Raphael | c4d4731 | 2011-02-15 16:09:36 -0800 | [diff] [blame] | 5187 | # ----------------------------------------------------------------- |
| 5188 | # Create SDK repository packages. Must be done after tasks/* since |
| 5189 | # we need the addon rules defined. |
| 5190 | ifneq ($(sdk_repo_goal),) |
| 5191 | include $(TOPDIR)development/build/tools/sdk_repo.mk |
| 5192 | endif |
Mitch Phillips | ceefc44 | 2019-09-26 16:37:59 -0700 | [diff] [blame] | 5193 | |
| 5194 | # ----------------------------------------------------------------- |
Mitch Phillips | 3adbcb3 | 2019-10-17 19:24:46 -0700 | [diff] [blame] | 5195 | # Soong generates the list of all shared libraries that are depended on by fuzz |
| 5196 | # targets. It saves this list as a source:destination pair to |
| 5197 | # FUZZ_TARGET_SHARED_DEPS_INSTALL_PAIRS, where the source is the path to the |
| 5198 | # build of the unstripped shared library, and the destination is the |
| 5199 | # /data/fuzz/$ARCH/lib (for device) or /fuzz/$ARCH/lib (for host) directory |
| 5200 | # where fuzz target shared libraries are to be "reinstalled". The |
| 5201 | # copy-many-files below generates the rules to copy the unstripped shared |
| 5202 | # libraries to the device or host "reinstallation" directory. These rules are |
| 5203 | # depended on by each module in soong_cc_prebuilt.mk, where the module will have |
| 5204 | # a dependency on each shared library that it needs to be "reinstalled". |
| 5205 | FUZZ_SHARED_DEPS := $(call copy-many-files,$(strip $(FUZZ_TARGET_SHARED_DEPS_INSTALL_PAIRS))) |
| 5206 | |
| 5207 | # ----------------------------------------------------------------- |
Mitch Phillips | ceefc44 | 2019-09-26 16:37:59 -0700 | [diff] [blame] | 5208 | # The rule to build all fuzz targets, and package them. |
| 5209 | # Note: The packages are created in Soong, and in a perfect world, |
| 5210 | # we'd be able to create the phony rule there. But, if we want to |
| 5211 | # have dist goals for the fuzz target, we need to have the PHONY |
| 5212 | # target defined in make. MakeVarsContext.DistForGoal doesn't take |
| 5213 | # into account that a PHONY rule create by Soong won't be available |
| 5214 | # during make, and such will fail with `writing to readonly |
Kris Alder | 8c8c2b9 | 2019-11-26 12:03:39 -0800 | [diff] [blame] | 5215 | # directory`, because kati will see 'haiku' as being a file, not a |
Mitch Phillips | ceefc44 | 2019-09-26 16:37:59 -0700 | [diff] [blame] | 5216 | # phony target. |
Kris Alder | 8c8c2b9 | 2019-11-26 12:03:39 -0800 | [diff] [blame] | 5217 | .PHONY: haiku |
| 5218 | haiku: $(SOONG_FUZZ_PACKAGING_ARCH_MODULES) $(ALL_FUZZ_TARGETS) |
| 5219 | $(call dist-for-goals,haiku,$(SOONG_FUZZ_PACKAGING_ARCH_MODULES)) |