| 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 \ | 
|  | 19 | Prebuilt apk found in PRODUCT_COPY_FILES: $(1), use BUILD_PREBUILT instead!))) | 
| Ying Wang | 6886410 | 2011-09-29 13:23:25 -0700 | [diff] [blame] | 20 | endef | 
| Ying Wang | 619fccf | 2012-09-05 18:08:29 -0700 | [diff] [blame] | 21 | # filter out the duplicate <source file>:<dest file> pairs. | 
|  | 22 | unique_product_copy_files_pairs := | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 23 | $(foreach cf,$(PRODUCT_COPY_FILES), \ | 
| Ying Wang | 619fccf | 2012-09-05 18:08:29 -0700 | [diff] [blame] | 24 | $(if $(filter $(unique_product_copy_files_pairs),$(cf)),,\ | 
|  | 25 | $(eval unique_product_copy_files_pairs += $(cf)))) | 
|  | 26 | unique_product_copy_files_destinations := | 
| Dan Willemsen | 403b98a | 2017-11-15 11:13:23 -0800 | [diff] [blame] | 27 | product_copy_files_ignored := | 
| Ying Wang | 619fccf | 2012-09-05 18:08:29 -0700 | [diff] [blame] | 28 | $(foreach cf,$(unique_product_copy_files_pairs), \ | 
| Ying Wang | 462d26b | 2010-11-02 21:31:47 -0700 | [diff] [blame] | 29 | $(eval _src := $(call word-colon,1,$(cf))) \ | 
|  | 30 | $(eval _dest := $(call word-colon,2,$(cf))) \ | 
| Dan Willemsen | 7d957c9 | 2018-04-30 16:01:33 -0700 | [diff] [blame] | 31 | $(call check-product-copy-files,$(cf),$(_dest)) \ | 
| Ying Wang | 193010c | 2011-12-16 11:54:25 -0800 | [diff] [blame] | 32 | $(if $(filter $(unique_product_copy_files_destinations),$(_dest)), \ | 
| Dan Willemsen | 403b98a | 2017-11-15 11:13:23 -0800 | [diff] [blame] | 33 | $(eval product_copy_files_ignored += $(cf)), \ | 
| Ying Wang | 462d26b | 2010-11-02 21:31:47 -0700 | [diff] [blame] | 34 | $(eval _fulldest := $(call append-path,$(PRODUCT_OUT),$(_dest))) \ | 
| Ying Wang | 3ceecfa | 2012-05-14 14:39:00 -0700 | [diff] [blame] | 35 | $(if $(filter %.xml,$(_dest)),\ | 
|  | 36 | $(eval $(call copy-xml-file-checked,$(_src),$(_fulldest))),\ | 
| Nicolas Geoffray | a95fbd1 | 2017-09-19 13:10:31 +0100 | [diff] [blame] | 37 | $(if $(and $(filter %.jar,$(_dest)),$(filter $(basename $(notdir $(_dest))),$(PRODUCT_LOADED_BY_PRIVILEGED_MODULES))),\ | 
|  | 38 | $(eval $(call copy-and-uncompress-dexs,$(_src),$(_fulldest))), \ | 
| Tom Cherry | fc97764 | 2018-06-13 14:51:05 -0700 | [diff] [blame] | 39 | $(if $(filter init%rc,$(notdir $(_dest)))$(filter %/etc/init,$(dir $(_dest))),\ | 
|  | 40 | $(eval $(call copy-init-script-file-checked,$(_src),$(_fulldest))),\ | 
|  | 41 | $(eval $(call copy-one-file,$(_src),$(_fulldest)))))) \ | 
| Ying Wang | 7e8d442 | 2011-06-17 17:05:35 -0700 | [diff] [blame] | 42 | $(eval unique_product_copy_files_destinations += $(_dest)))) | 
| Dan Willemsen | 403b98a | 2017-11-15 11:13:23 -0800 | [diff] [blame] | 43 |  | 
|  | 44 | # Dump a list of overriden (and ignored PRODUCT_COPY_FILES entries) | 
|  | 45 | $(file >$(PRODUCT_OUT)/product_copy_files_ignored.txt,$(subst $(space),$(newline),$(strip $(product_copy_files_ignored)))) | 
|  | 46 | ifdef dist_goal | 
|  | 47 | $(file >$(DIST_DIR)/logs/product_copy_files_ignored.txt,$(subst $(space),$(newline),$(strip $(product_copy_files_ignored)))) | 
|  | 48 | endif | 
|  | 49 |  | 
|  | 50 | product_copy_files_ignored := | 
| Ying Wang | 619fccf | 2012-09-05 18:08:29 -0700 | [diff] [blame] | 51 | unique_product_copy_files_pairs := | 
| Ying Wang | 7e8d442 | 2011-06-17 17:05:35 -0700 | [diff] [blame] | 52 | unique_product_copy_files_destinations := | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 53 |  | 
|  | 54 | # ----------------------------------------------------------------- | 
| Bowgo Tsai | 03b9c8e | 2017-11-17 15:22:37 +0800 | [diff] [blame] | 55 | # Returns the max allowed size for an image suitable for hash verification | 
|  | 56 | # (e.g., boot.img, recovery.img, etc). | 
|  | 57 | # The value 69632 derives from MAX_VBMETA_SIZE + MAX_FOOTER_SIZE in $(AVBTOOL). | 
|  | 58 | # $(1): partition size to flash the image | 
|  | 59 | define get-hash-image-max-size | 
|  | 60 | $(if $(1), \ | 
|  | 61 | $(if $(filter true,$(BOARD_AVB_ENABLE)), \ | 
|  | 62 | $(eval _hash_meta_size := 69632), \ | 
|  | 63 | $(eval _hash_meta_size := 0)) \ | 
|  | 64 | $(1)-$(_hash_meta_size)) | 
|  | 65 | endef | 
|  | 66 |  | 
|  | 67 | # ----------------------------------------------------------------- | 
| Dan Willemsen | 6f60f02 | 2016-02-23 13:40:07 -0800 | [diff] [blame] | 68 | # Define rules to copy headers defined in copy_headers.mk | 
|  | 69 | # If more than one makefile declared a header, print a warning, | 
|  | 70 | # then copy the last one defined. This matches the previous make | 
|  | 71 | # behavior. | 
| Dan Willemsen | 7f9bd56 | 2018-08-15 14:28:01 -0700 | [diff] [blame] | 72 | has_dup_copy_headers := | 
| Dan Willemsen | 6f60f02 | 2016-02-23 13:40:07 -0800 | [diff] [blame] | 73 | $(foreach dest,$(ALL_COPIED_HEADERS), \ | 
|  | 74 | $(eval _srcs := $(ALL_COPIED_HEADERS.$(dest).SRC)) \ | 
|  | 75 | $(eval _src := $(word $(words $(_srcs)),$(_srcs))) \ | 
|  | 76 | $(if $(call streq,$(_src),$(_srcs)),, \ | 
|  | 77 | $(warning Duplicate header copy: $(dest)) \ | 
| Dan Willemsen | 7f9bd56 | 2018-08-15 14:28:01 -0700 | [diff] [blame] | 78 | $(warning Defined in: $(ALL_COPIED_HEADERS.$(dest).MAKEFILE)) \ | 
|  | 79 | $(eval has_dup_copy_headers := true)) \ | 
| Dan Willemsen | 6f60f02 | 2016-02-23 13:40:07 -0800 | [diff] [blame] | 80 | $(eval $(call copy-one-header,$(_src),$(dest)))) | 
|  | 81 | all_copied_headers: $(ALL_COPIED_HEADERS) | 
|  | 82 |  | 
| Dan Willemsen | 7f9bd56 | 2018-08-15 14:28:01 -0700 | [diff] [blame] | 83 | ifdef has_dup_copy_headers | 
|  | 84 | has_dup_copy_headers := | 
|  | 85 | ifneq ($(BUILD_BROKEN_DUP_COPY_HEADERS),true) | 
|  | 86 | $(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) | 
|  | 87 | endif | 
|  | 88 | endif | 
|  | 89 |  | 
| Dan Willemsen | 6f60f02 | 2016-02-23 13:40:07 -0800 | [diff] [blame] | 90 | # ----------------------------------------------------------------- | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 91 | # docs/index.html | 
| Ying Wang | 3f45b3c | 2012-04-02 18:21:36 -0700 | [diff] [blame] | 92 | ifeq (,$(TARGET_BUILD_APPS)) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 93 | gen := $(OUT_DOCS)/index.html | 
|  | 94 | ALL_DOCS += $(gen) | 
|  | 95 | $(gen): frameworks/base/docs/docs-redirect-index.html | 
|  | 96 | @mkdir -p $(dir $@) | 
|  | 97 | @cp -f $< $@ | 
| Ying Wang | 3f45b3c | 2012-04-02 18:21:36 -0700 | [diff] [blame] | 98 | endif | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 99 |  | 
| Dan Albert | 303e603 | 2017-10-04 10:20:20 -0700 | [diff] [blame] | 100 | ndk_doxygen_out := $(OUT_NDK_DOCS) | 
|  | 101 | ndk_headers := $(SOONG_OUT_DIR)/ndk/sysroot/usr/include | 
|  | 102 | ndk_docs_src_dir := frameworks/native/docs | 
|  | 103 | ndk_doxyfile := $(ndk_docs_src_dir)/Doxyfile | 
|  | 104 | ifneq ($(wildcard $(ndk_docs_src_dir)),) | 
|  | 105 | ndk_docs_srcs := $(addprefix $(ndk_docs_src_dir)/,\ | 
|  | 106 | $(call find-files-in-subdirs,$(ndk_docs_src_dir),"*",.)) | 
|  | 107 | $(ndk_doxygen_out)/index.html: $(ndk_docs_srcs) $(SOONG_OUT_DIR)/ndk.timestamp | 
|  | 108 | @mkdir -p $(ndk_doxygen_out) | 
|  | 109 | @echo "Generating NDK docs to $(ndk_doxygen_out)" | 
|  | 110 | @( cat $(ndk_doxyfile); \ | 
|  | 111 | echo "INPUT=$(ndk_headers)"; \ | 
|  | 112 | echo "HTML_OUTPUT=$(ndk_doxygen_out)" \ | 
|  | 113 | ) | doxygen - | 
|  | 114 |  | 
|  | 115 | # Note: Not a part of the docs target because we don't have doxygen available. | 
|  | 116 | # You can run this target locally if you have doxygen installed. | 
|  | 117 | ndk-docs: $(ndk_doxygen_out)/index.html | 
|  | 118 | .PHONY: ndk-docs | 
|  | 119 | endif | 
|  | 120 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 121 | # ----------------------------------------------------------------- | 
| Jaekyun Seok | fbc07f9 | 2017-03-03 12:40:21 +0900 | [diff] [blame] | 122 | # property_overrides_split_enabled | 
|  | 123 | property_overrides_split_enabled := | 
|  | 124 | ifeq ($(BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED), true) | 
|  | 125 | property_overrides_split_enabled := true | 
| Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 126 | endif | 
|  | 127 |  | 
|  | 128 | # ----------------------------------------------------------------- | 
| Jaekyun Seok | c227ce7 | 2018-02-08 07:19:55 +0900 | [diff] [blame] | 129 | # FINAL_VENDOR_DEFAULT_PROPERTIES will be installed in vendor/default.prop if | 
|  | 130 | # property_overrides_split_enabled is true. Otherwise it will be installed in | 
|  | 131 | # ROOT/default.prop. | 
|  | 132 | ifdef BOARD_VNDK_VERSION | 
|  | 133 | ifeq ($(BOARD_VNDK_VERSION),current) | 
|  | 134 | FINAL_VENDOR_DEFAULT_PROPERTIES := ro.vndk.version=$(PLATFORM_VNDK_VERSION) | 
|  | 135 | else | 
|  | 136 | FINAL_VENDOR_DEFAULT_PROPERTIES := ro.vndk.version=$(BOARD_VNDK_VERSION) | 
|  | 137 | endif | 
| Logan Chien | d73b94c | 2018-05-04 19:33:17 +0800 | [diff] [blame] | 138 | ifdef BOARD_VNDK_RUNTIME_DISABLE | 
|  | 139 | FINAL_VENDOR_DEFAULT_PROPERTIES += ro.vndk.lite=true | 
|  | 140 | endif | 
| Jaekyun Seok | c227ce7 | 2018-02-08 07:19:55 +0900 | [diff] [blame] | 141 | else | 
| Logan Chien | d73b94c | 2018-05-04 19:33:17 +0800 | [diff] [blame] | 142 | FINAL_VENDOR_DEFAULT_PROPERTIES := ro.vndk.version=$(PLATFORM_VNDK_VERSION) | 
|  | 143 | FINAL_VENDOR_DEFAULT_PROPERTIES += ro.vndk.lite=true | 
| Jaekyun Seok | c227ce7 | 2018-02-08 07:19:55 +0900 | [diff] [blame] | 144 | endif | 
|  | 145 | FINAL_VENDOR_DEFAULT_PROPERTIES += \ | 
|  | 146 | $(call collapse-pairs, $(PRODUCT_DEFAULT_PROPERTY_OVERRIDES)) | 
| Tao Bao | 5f99923 | 2018-09-04 11:42:53 -0700 | [diff] [blame] | 147 |  | 
|  | 148 | # Although these variables are prefixed with TARGET_RECOVERY_, they are also needed under charger | 
|  | 149 | # mode (via libminui). | 
|  | 150 | ifdef TARGET_RECOVERY_DEFAULT_ROTATION | 
|  | 151 | FINAL_VENDOR_DEFAULT_PROPERTIES += \ | 
|  | 152 | ro.minui.default_rotation=$(TARGET_RECOVERY_DEFAULT_ROTATION) | 
|  | 153 | endif | 
|  | 154 | ifdef TARGET_RECOVERY_OVERSCAN_PERCENT | 
|  | 155 | FINAL_VENDOR_DEFAULT_PROPERTIES += \ | 
|  | 156 | ro.minui.overscan_percent=$(TARGET_RECOVERY_OVERSCAN_PERCENT) | 
|  | 157 | endif | 
|  | 158 | ifdef TARGET_RECOVERY_PIXEL_FORMAT | 
|  | 159 | FINAL_VENDOR_DEFAULT_PROPERTIES += \ | 
|  | 160 | ro.minui.pixel_format=$(TARGET_RECOVERY_PIXEL_FORMAT) | 
|  | 161 | endif | 
| Jaekyun Seok | c227ce7 | 2018-02-08 07:19:55 +0900 | [diff] [blame] | 162 | FINAL_VENDOR_DEFAULT_PROPERTIES := $(call uniq-pairs-by-first-component, \ | 
|  | 163 | $(FINAL_VENDOR_DEFAULT_PROPERTIES),=) | 
|  | 164 |  | 
|  | 165 | # ----------------------------------------------------------------- | 
| Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 166 | # prop.default | 
| Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 167 |  | 
|  | 168 | BUILDINFO_SH := build/make/tools/buildinfo.sh | 
|  | 169 | BUILDINFO_COMMON_SH := build/make/tools/buildinfo_common.sh | 
|  | 170 | # Generates a set of common build system properties to a file. | 
|  | 171 | # $(1): Partition name | 
|  | 172 | # $(2): Output file name | 
|  | 173 | define generate-common-build-props | 
|  | 174 | BUILD_FINGERPRINT="$(BUILD_FINGERPRINT_FROM_FILE)" \ | 
|  | 175 | BUILD_ID="$(BUILD_ID)" \ | 
|  | 176 | BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \ | 
|  | 177 | BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \ | 
|  | 178 | DATE="$(DATE_FROM_FILE)" \ | 
|  | 179 | PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \ | 
|  | 180 | PLATFORM_VERSION="$(PLATFORM_VERSION)" \ | 
|  | 181 | PRODUCT_BRAND="$(PRODUCT_BRAND)" \ | 
|  | 182 | PRODUCT_MANUFACTURER="$(PRODUCT_MANUFACTURER)" \ | 
|  | 183 | PRODUCT_MODEL="$(PRODUCT_MODEL)" \ | 
|  | 184 | PRODUCT_NAME="$(TARGET_PRODUCT)" \ | 
|  | 185 | TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \ | 
|  | 186 | TARGET_DEVICE="$(TARGET_DEVICE)" \ | 
|  | 187 | bash $(BUILDINFO_COMMON_SH) "$(1)" >> $(2) | 
|  | 188 | endef | 
|  | 189 |  | 
| Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 190 | ifdef property_overrides_split_enabled | 
|  | 191 | INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_OUT)/etc/prop.default | 
| Hung-ying Tyan | b260f0d | 2017-07-13 17:04:10 +0800 | [diff] [blame] | 192 | INSTALLED_DEFAULT_PROP_OLD_TARGET := $(TARGET_ROOT_OUT)/default.prop | 
|  | 193 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_DEFAULT_PROP_OLD_TARGET) | 
|  | 194 | $(INSTALLED_DEFAULT_PROP_OLD_TARGET): $(INSTALLED_DEFAULT_PROP_TARGET) | 
| Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 195 | else | 
|  | 196 | # legacy path | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 197 | INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_ROOT_OUT)/default.prop | 
| Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 198 | endif | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 199 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_DEFAULT_PROP_TARGET) | 
| Jaekyun Seok | 294286d | 2017-01-20 13:17:12 +0900 | [diff] [blame] | 200 | FINAL_DEFAULT_PROPERTIES := \ | 
| Jaekyun Seok | b31b9ba | 2017-11-03 15:18:55 +0900 | [diff] [blame] | 201 | $(call collapse-pairs, $(ADDITIONAL_DEFAULT_PROPERTIES)) \ | 
|  | 202 | $(call collapse-pairs, $(PRODUCT_SYSTEM_DEFAULT_PROPERTIES)) | 
| Jaekyun Seok | fbc07f9 | 2017-03-03 12:40:21 +0900 | [diff] [blame] | 203 | ifndef property_overrides_split_enabled | 
| Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 204 | FINAL_DEFAULT_PROPERTIES += \ | 
| Jaekyun Seok | c227ce7 | 2018-02-08 07:19:55 +0900 | [diff] [blame] | 205 | $(call collapse-pairs, $(FINAL_VENDOR_DEFAULT_PROPERTIES)) | 
| Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 206 | endif | 
| Jaekyun Seok | 294286d | 2017-01-20 13:17:12 +0900 | [diff] [blame] | 207 | FINAL_DEFAULT_PROPERTIES := $(call uniq-pairs-by-first-component, \ | 
|  | 208 | $(FINAL_DEFAULT_PROPERTIES),=) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 209 |  | 
| Andres Morales | b8876e1 | 2015-05-06 20:44:22 -0700 | [diff] [blame] | 210 | intermediate_system_build_prop := $(call intermediates-dir-for,ETC,system_build_prop)/build.prop | 
|  | 211 |  | 
| Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 212 | $(INSTALLED_DEFAULT_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(intermediate_system_build_prop) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 213 | @echo Target buildinfo: $@ | 
|  | 214 | @mkdir -p $(dir $@) | 
| Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 215 | @rm -f $@ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 216 | $(hide) echo "#" > $@; \ | 
|  | 217 | echo "# ADDITIONAL_DEFAULT_PROPERTIES" >> $@; \ | 
|  | 218 | echo "#" >> $@; | 
| Jaekyun Seok | 294286d | 2017-01-20 13:17:12 +0900 | [diff] [blame] | 219 | $(hide) $(foreach line,$(FINAL_DEFAULT_PROPERTIES), \ | 
| Jean-Baptiste Queru | 0545c91 | 2010-09-07 10:51:12 -0700 | [diff] [blame] | 220 | echo "$(line)" >> $@;) | 
| Andres Morales | b8876e1 | 2015-05-06 20:44:22 -0700 | [diff] [blame] | 221 | $(hide) echo "#" >> $@; \ | 
|  | 222 | echo "# BOOTIMAGE_BUILD_PROPERTIES" >> $@; \ | 
|  | 223 | echo "#" >> $@; | 
| Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 224 | $(hide) $(call generate-common-build-props,bootimage,$@) | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 225 | $(hide) build/make/tools/post_process_props.py $@ | 
| Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 226 | ifdef property_overrides_split_enabled | 
|  | 227 | $(hide) mkdir -p $(TARGET_ROOT_OUT) | 
| Hung-ying Tyan | b260f0d | 2017-07-13 17:04:10 +0800 | [diff] [blame] | 228 | $(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] | 229 | endif | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 230 |  | 
|  | 231 | # ----------------------------------------------------------------- | 
| Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 232 | # vendor default.prop | 
|  | 233 | INSTALLED_VENDOR_DEFAULT_PROP_TARGET := | 
| Jaekyun Seok | fbc07f9 | 2017-03-03 12:40:21 +0900 | [diff] [blame] | 234 | ifdef property_overrides_split_enabled | 
| Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 235 | INSTALLED_VENDOR_DEFAULT_PROP_TARGET := $(TARGET_OUT_VENDOR)/default.prop | 
|  | 236 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_VENDOR_DEFAULT_PROP_TARGET) | 
|  | 237 |  | 
| Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 238 | $(INSTALLED_VENDOR_DEFAULT_PROP_TARGET): $(INSTALLED_DEFAULT_PROP_TARGET) | 
|  | 239 | @echo Target buildinfo: $@ | 
|  | 240 | @mkdir -p $(dir $@) | 
|  | 241 | $(hide) echo "#" > $@; \ | 
|  | 242 | echo "# ADDITIONAL VENDOR DEFAULT PROPERTIES" >> $@; \ | 
|  | 243 | echo "#" >> $@; | 
|  | 244 | $(hide) $(foreach line,$(FINAL_VENDOR_DEFAULT_PROPERTIES), \ | 
|  | 245 | echo "$(line)" >> $@;) | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 246 | $(hide) build/make/tools/post_process_props.py $@ | 
| Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 247 |  | 
| Jaekyun Seok | fbc07f9 | 2017-03-03 12:40:21 +0900 | [diff] [blame] | 248 | endif  # property_overrides_split_enabled | 
| Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 249 |  | 
|  | 250 | # ----------------------------------------------------------------- | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 251 | # build.prop | 
|  | 252 | INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop | 
|  | 253 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_BUILD_PROP_TARGET) | 
| Jaekyun Seok | 294286d | 2017-01-20 13:17:12 +0900 | [diff] [blame] | 254 | FINAL_BUILD_PROPERTIES := \ | 
| Ying Wang | 7e8d442 | 2011-06-17 17:05:35 -0700 | [diff] [blame] | 255 | $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES)) | 
| Jaekyun Seok | 294286d | 2017-01-20 13:17:12 +0900 | [diff] [blame] | 256 | FINAL_BUILD_PROPERTIES := $(call uniq-pairs-by-first-component, \ | 
|  | 257 | $(FINAL_BUILD_PROPERTIES),=) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 258 |  | 
|  | 259 | # A list of arbitrary tags describing the build configuration. | 
|  | 260 | # Force ":=" so we can use += | 
|  | 261 | BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS) | 
|  | 262 | ifeq ($(TARGET_BUILD_TYPE),debug) | 
|  | 263 | BUILD_VERSION_TAGS += debug | 
|  | 264 | endif | 
| Doug Zongker | 49c6a2b | 2011-10-05 12:41:56 -0700 | [diff] [blame] | 265 | # The "test-keys" tag marks builds signed with the old test keys, | 
|  | 266 | # which are available in the SDK.  "dev-keys" marks builds signed with | 
|  | 267 | # non-default dev keys (usually private keys from a vendor directory). | 
|  | 268 | # Both of these tags will be removed and replaced with "release-keys" | 
|  | 269 | # when the target-files is signed in a post-build step. | 
|  | 270 | ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/target/product/security/testkey) | 
| Doug Zongker | a8608a7 | 2013-07-23 11:51:04 -0700 | [diff] [blame] | 271 | BUILD_KEYS := test-keys | 
| Doug Zongker | 49c6a2b | 2011-10-05 12:41:56 -0700 | [diff] [blame] | 272 | else | 
| Doug Zongker | a8608a7 | 2013-07-23 11:51:04 -0700 | [diff] [blame] | 273 | BUILD_KEYS := dev-keys | 
| Doug Zongker | 49c6a2b | 2011-10-05 12:41:56 -0700 | [diff] [blame] | 274 | endif | 
| Doug Zongker | a8608a7 | 2013-07-23 11:51:04 -0700 | [diff] [blame] | 275 | BUILD_VERSION_TAGS += $(BUILD_KEYS) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 276 | BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS))) | 
|  | 277 |  | 
|  | 278 | # A human-readable string that descibes this build in detail. | 
| Colin Cross | f37b455 | 2015-07-16 17:15:19 -0700 | [diff] [blame] | 279 | 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] | 280 | $(intermediate_system_build_prop): PRIVATE_BUILD_DESC := $(build_desc) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 281 |  | 
| Jeff Sharkey | 26e1a28 | 2014-03-21 16:20:05 -0700 | [diff] [blame] | 282 | # 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] | 283 | ifeq (,$(strip $(BUILD_FINGERPRINT))) | 
| Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 284 | ifeq ($(strip $(HAS_BUILD_NUMBER)),false) | 
|  | 285 | BF_BUILD_NUMBER := $(USER)$$($(DATE_FROM_FILE) +%m%d%H%M) | 
| Ying Wang | 50367cc | 2014-06-12 18:42:53 -0700 | [diff] [blame] | 286 | else | 
| Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 287 | BF_BUILD_NUMBER := $(file <$(BUILD_NUMBER_FILE)) | 
| Ying Wang | 50367cc | 2014-06-12 18:42:53 -0700 | [diff] [blame] | 288 | endif | 
|  | 289 | 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] | 290 | endif | 
| Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 291 | # unset it for safety. | 
|  | 292 | BF_BUILD_NUMBER := | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 293 |  | 
| Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 294 | BUILD_FINGERPRINT_FILE := $(PRODUCT_OUT)/build_fingerprint.txt | 
|  | 295 | ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_FINGERPRINT) >$(BUILD_FINGERPRINT_FILE) && grep " " $(BUILD_FINGERPRINT_FILE))) | 
|  | 296 | $(error BUILD_FINGERPRINT cannot contain spaces: "$(file <$(BUILD_FINGERPRINT_FILE))") | 
|  | 297 | endif | 
|  | 298 | BUILD_FINGERPRINT_FROM_FILE := $$(cat $(BUILD_FINGERPRINT_FILE)) | 
|  | 299 | # unset it for safety. | 
|  | 300 | BUILD_FINGERPRINT := | 
| Colin Cross | f37b455 | 2015-07-16 17:15:19 -0700 | [diff] [blame] | 301 |  | 
| Jeff Sharkey | 26e1a28 | 2014-03-21 16:20:05 -0700 | [diff] [blame] | 302 | # The string used to uniquely identify the system build; used by the OTA server. | 
|  | 303 | # This purposefully excludes any product-specific variables. | 
|  | 304 | ifeq (,$(strip $(BUILD_THUMBPRINT))) | 
| Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 305 | 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] | 306 | endif | 
| Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 307 |  | 
|  | 308 | BUILD_THUMBPRINT_FILE := $(PRODUCT_OUT)/build_thumbprint.txt | 
|  | 309 | ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_THUMBPRINT) >$(BUILD_THUMBPRINT_FILE) && grep " " $(BUILD_THUMBPRINT_FILE))) | 
|  | 310 | $(error BUILD_THUMBPRINT cannot contain spaces: "$(file <$(BUILD_THUMBPRINT_FILE))") | 
| Jeff Sharkey | 26e1a28 | 2014-03-21 16:20:05 -0700 | [diff] [blame] | 311 | endif | 
| Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 312 | BUILD_THUMBPRINT_FROM_FILE := $$(cat $(BUILD_THUMBPRINT_FILE)) | 
|  | 313 | # unset it for safety. | 
|  | 314 | BUILD_THUMBPRINT := | 
| Jeff Sharkey | 26e1a28 | 2014-03-21 16:20:05 -0700 | [diff] [blame] | 315 |  | 
| Ying Wang | e24e17a | 2014-10-07 18:42:11 -0700 | [diff] [blame] | 316 | KNOWN_OEM_THUMBPRINT_PROPERTIES := \ | 
|  | 317 | ro.product.brand \ | 
|  | 318 | ro.product.name \ | 
|  | 319 | ro.product.device | 
|  | 320 | OEM_THUMBPRINT_PROPERTIES := $(filter $(KNOWN_OEM_THUMBPRINT_PROPERTIES),\ | 
|  | 321 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OEM_PROPERTIES)) | 
|  | 322 |  | 
| Sriram Raman | 7b64124 | 2009-03-24 22:40:59 -0700 | [diff] [blame] | 323 | # Display parameters shown under Settings -> About Phone | 
|  | 324 | ifeq ($(TARGET_BUILD_VARIANT),user) | 
|  | 325 | # User builds should show: | 
|  | 326 | # release build number or branch.buld_number non-release builds | 
|  | 327 |  | 
|  | 328 | # Dev. branches should have DISPLAY_BUILD_NUMBER set | 
| Colin Cross | 63fe36a | 2017-02-21 17:23:02 -0800 | [diff] [blame] | 329 | ifeq (true,$(DISPLAY_BUILD_NUMBER)) | 
| Colin Cross | f37b455 | 2015-07-16 17:15:19 -0700 | [diff] [blame] | 330 | BUILD_DISPLAY_ID := $(BUILD_ID).$(BUILD_NUMBER_FROM_FILE) $(BUILD_KEYS) | 
| Sriram Raman | 7b64124 | 2009-03-24 22:40:59 -0700 | [diff] [blame] | 331 | else | 
| Doug Zongker | a8608a7 | 2013-07-23 11:51:04 -0700 | [diff] [blame] | 332 | BUILD_DISPLAY_ID := $(BUILD_ID) $(BUILD_KEYS) | 
| Sriram Raman | 7b64124 | 2009-03-24 22:40:59 -0700 | [diff] [blame] | 333 | endif | 
|  | 334 | else | 
|  | 335 | # Non-user builds should show detailed build information | 
|  | 336 | BUILD_DISPLAY_ID := $(build_desc) | 
|  | 337 | endif | 
|  | 338 |  | 
| Narayan Kamath | baf3eb9 | 2015-01-15 18:16:24 +0000 | [diff] [blame] | 339 | # Accepts a whitespace separated list of product locales such as | 
|  | 340 | # (en_US en_AU en_GB...) and returns the first locale in the list with | 
|  | 341 | # underscores replaced with hyphens. In the example above, this will | 
|  | 342 | # return "en-US". | 
|  | 343 | define get-default-product-locale | 
|  | 344 | $(strip $(subst _,-, $(firstword $(1)))) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 345 | endef | 
|  | 346 |  | 
| Vishwath Mohan | 9ebc278 | 2017-05-09 09:54:49 -0700 | [diff] [blame] | 347 | # TARGET_BUILD_FLAVOR and ro.build.flavor are used only by the test | 
|  | 348 | # harness to distinguish builds. Only add _asan for a sanitized build | 
|  | 349 | # if it isn't already a part of the flavor (via a dedicated lunch | 
|  | 350 | # config for example). | 
| Ying Wang | 21ec03d | 2015-10-28 18:45:03 -0700 | [diff] [blame] | 351 | TARGET_BUILD_FLAVOR := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) | 
| Ivan Lozano | 0f71db3 | 2017-08-14 07:57:37 -0700 | [diff] [blame] | 352 | ifneq (, $(filter address, $(SANITIZE_TARGET))) | 
| Vishwath Mohan | 9ebc278 | 2017-05-09 09:54:49 -0700 | [diff] [blame] | 353 | ifeq (,$(findstring _asan,$(TARGET_BUILD_FLAVOR))) | 
| Ying Wang | 21ec03d | 2015-10-28 18:45:03 -0700 | [diff] [blame] | 354 | TARGET_BUILD_FLAVOR := $(TARGET_BUILD_FLAVOR)_asan | 
|  | 355 | endif | 
| Vishwath Mohan | 9ebc278 | 2017-05-09 09:54:49 -0700 | [diff] [blame] | 356 | endif | 
| Ying Wang | 21ec03d | 2015-10-28 18:45:03 -0700 | [diff] [blame] | 357 |  | 
| Andrew Boie | fa61ff0 | 2012-09-28 09:33:45 -0700 | [diff] [blame] | 358 | ifdef TARGET_SYSTEM_PROP | 
|  | 359 | system_prop_file := $(TARGET_SYSTEM_PROP) | 
|  | 360 | else | 
|  | 361 | system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop) | 
|  | 362 | endif | 
| Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 363 | $(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) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 364 | @echo Target buildinfo: $@ | 
|  | 365 | @mkdir -p $(dir $@) | 
| Jeff Sharkey | 26d22f7 | 2014-03-18 17:20:10 -0700 | [diff] [blame] | 366 | $(hide) echo > $@ | 
|  | 367 | ifneq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OEM_PROPERTIES),) | 
|  | 368 | $(hide) echo "#" >> $@; \ | 
|  | 369 | echo "# PRODUCT_OEM_PROPERTIES" >> $@; \ | 
| Jeff Sharkey | 26e1a28 | 2014-03-21 16:20:05 -0700 | [diff] [blame] | 370 | echo "#" >> $@; | 
| Jeff Sharkey | 26d22f7 | 2014-03-18 17:20:10 -0700 | [diff] [blame] | 371 | $(hide) $(foreach prop,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_OEM_PROPERTIES), \ | 
|  | 372 | echo "import /oem/oem.prop $(prop)" >> $@;) | 
|  | 373 | endif | 
| Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 374 | $(hide) $(call generate-common-build-props,system,$@) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 375 | $(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \ | 
| Ying Wang | 21ec03d | 2015-10-28 18:45:03 -0700 | [diff] [blame] | 376 | TARGET_BUILD_FLAVOR="$(TARGET_BUILD_FLAVOR)" \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 377 | TARGET_DEVICE="$(TARGET_DEVICE)" \ | 
|  | 378 | PRODUCT_NAME="$(TARGET_PRODUCT)" \ | 
|  | 379 | PRODUCT_BRAND="$(PRODUCT_BRAND)" \ | 
| Narayan Kamath | baf3eb9 | 2015-01-15 18:16:24 +0000 | [diff] [blame] | 380 | PRODUCT_DEFAULT_LOCALE="$(call get-default-product-locale,$(PRODUCT_LOCALES))" \ | 
| Robert Greenwalt | fbd10d9 | 2009-05-20 13:37:35 -0700 | [diff] [blame] | 381 | PRODUCT_DEFAULT_WIFI_CHANNELS="$(PRODUCT_DEFAULT_WIFI_CHANNELS)" \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 382 | PRODUCT_MODEL="$(PRODUCT_MODEL)" \ | 
|  | 383 | PRODUCT_MANUFACTURER="$(PRODUCT_MANUFACTURER)" \ | 
|  | 384 | PRIVATE_BUILD_DESC="$(PRIVATE_BUILD_DESC)" \ | 
|  | 385 | BUILD_ID="$(BUILD_ID)" \ | 
|  | 386 | BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \ | 
| Dan Willemsen | ccc933e | 2015-08-11 15:25:12 -0700 | [diff] [blame] | 387 | DATE="$(DATE_FROM_FILE)" \ | 
| Colin Cross | f37b455 | 2015-07-16 17:15:19 -0700 | [diff] [blame] | 388 | BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \ | 
| Daniel Rosenberg | 59156a6 | 2015-06-29 17:20:43 -0700 | [diff] [blame] | 389 | BOARD_BUILD_SYSTEM_ROOT_IMAGE="$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)" \ | 
| Tao Bao | 532fdf4 | 2015-11-11 10:22:48 -0800 | [diff] [blame] | 390 | AB_OTA_UPDATER="$(AB_OTA_UPDATER)" \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 391 | PLATFORM_VERSION="$(PLATFORM_VERSION)" \ | 
| Dianne Hackborn | e593e5c | 2015-08-12 16:11:20 -0700 | [diff] [blame] | 392 | PLATFORM_SECURITY_PATCH="$(PLATFORM_SECURITY_PATCH)" \ | 
|  | 393 | PLATFORM_BASE_OS="$(PLATFORM_BASE_OS)" \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 394 | PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \ | 
| Adam Powell | bdd5e8e | 2015-05-21 13:49:05 -0700 | [diff] [blame] | 395 | PLATFORM_PREVIEW_SDK_VERSION="$(PLATFORM_PREVIEW_SDK_VERSION)" \ | 
| Dianne Hackborn | 9537884 | 2009-05-08 12:06:17 -0700 | [diff] [blame] | 396 | PLATFORM_VERSION_CODENAME="$(PLATFORM_VERSION_CODENAME)" \ | 
| Dianne Hackborn | 6ee3c43 | 2014-04-24 16:19:14 -0700 | [diff] [blame] | 397 | PLATFORM_VERSION_ALL_CODENAMES="$(PLATFORM_VERSION_ALL_CODENAMES)" \ | 
| Przemyslaw Szczepaniak | e554015 | 2017-12-05 10:27:52 +0000 | [diff] [blame] | 398 | PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION="$(PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION)" \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 399 | BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \ | 
| Colin Cross | f37b455 | 2015-07-16 17:15:19 -0700 | [diff] [blame] | 400 | BUILD_FINGERPRINT="$(BUILD_FINGERPRINT_FROM_FILE)" \ | 
| Nan Zhang | 0abdb58 | 2018-02-20 17:00:39 -0800 | [diff] [blame] | 401 | $(if $(OEM_THUMBPRINT_PROPERTIES),BUILD_THUMBPRINT="$(BUILD_THUMBPRINT_FROM_FILE)") \ | 
| Narayan Kamath | 1a43b37 | 2014-03-26 17:33:55 +0000 | [diff] [blame] | 402 | TARGET_CPU_ABI_LIST="$(TARGET_CPU_ABI_LIST)" \ | 
| Narayan Kamath | 7303ebd | 2014-04-07 11:01:54 +0100 | [diff] [blame] | 403 | TARGET_CPU_ABI_LIST_32_BIT="$(TARGET_CPU_ABI_LIST_32_BIT)" \ | 
|  | 404 | TARGET_CPU_ABI_LIST_64_BIT="$(TARGET_CPU_ABI_LIST_64_BIT)" \ | 
| Dianne Hackborn | ecc70d7 | 2009-05-21 15:45:30 -0700 | [diff] [blame] | 405 | TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \ | 
| David 'Digit' Turner | 2edfb71 | 2009-11-06 15:12:00 -0800 | [diff] [blame] | 406 | TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \ | 
| Joe Onorato | 25939e2 | 2010-11-09 08:53:01 -0800 | [diff] [blame] | 407 | TARGET_AAPT_CHARACTERISTICS="$(TARGET_AAPT_CHARACTERISTICS)" \ | 
| Jeff Sharkey | 26d22f7 | 2014-03-18 17:20:10 -0700 | [diff] [blame] | 408 | bash $(BUILDINFO_SH) >> $@ | 
| Johan Redestig | 674a27d | 2012-04-12 17:00:58 +0200 | [diff] [blame] | 409 | $(hide) $(foreach file,$(system_prop_file), \ | 
|  | 410 | if [ -f "$(file)" ]; then \ | 
|  | 411 | echo "#" >> $@; \ | 
|  | 412 | echo Target buildinfo from: "$(file)"; \ | 
|  | 413 | echo "# from $(file)" >> $@; \ | 
|  | 414 | echo "#" >> $@; \ | 
|  | 415 | cat $(file) >> $@; \ | 
|  | 416 | fi;) | 
| Jaekyun Seok | 294286d | 2017-01-20 13:17:12 +0900 | [diff] [blame] | 417 | $(if $(FINAL_BUILD_PROPERTIES), \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 418 | $(hide) echo >> $@; \ | 
|  | 419 | echo "#" >> $@; \ | 
|  | 420 | echo "# ADDITIONAL_BUILD_PROPERTIES" >> $@; \ | 
|  | 421 | echo "#" >> $@; ) | 
| Jaekyun Seok | 294286d | 2017-01-20 13:17:12 +0900 | [diff] [blame] | 422 | $(hide) $(foreach line,$(FINAL_BUILD_PROPERTIES), \ | 
| Jean-Baptiste Queru | 0545c91 | 2010-09-07 10:51:12 -0700 | [diff] [blame] | 423 | echo "$(line)" >> $@;) | 
| Andres Morales | 085a0ce | 2015-02-06 10:12:55 -0800 | [diff] [blame] | 424 | $(hide) cat $(INSTALLED_ANDROID_INFO_TXT_TARGET) | grep 'require version-' | sed -e 's/require version-/ro.build.expect./g' >> $@ | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 425 | $(hide) build/make/tools/post_process_props.py $@ $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_PROPERTY_BLACKLIST) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 426 |  | 
|  | 427 | build_desc := | 
|  | 428 |  | 
| Andres Morales | b8876e1 | 2015-05-06 20:44:22 -0700 | [diff] [blame] | 429 | ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY))) | 
|  | 430 | INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img | 
|  | 431 | else | 
|  | 432 | INSTALLED_RECOVERYIMAGE_TARGET := | 
|  | 433 | endif | 
|  | 434 |  | 
|  | 435 | $(INSTALLED_BUILD_PROP_TARGET): $(intermediate_system_build_prop) $(INSTALLED_RECOVERYIMAGE_TARGET) | 
|  | 436 | @echo "Target build info: $@" | 
| Steven Moreland | ec08265 | 2017-10-22 02:11:47 -0700 | [diff] [blame] | 437 | $(hide) grep -v 'ro.product.first_api_level' $(intermediate_system_build_prop) > $@ | 
| Andres Morales | b8876e1 | 2015-05-06 20:44:22 -0700 | [diff] [blame] | 438 | ifdef INSTALLED_RECOVERYIMAGE_TARGET | 
|  | 439 | $(hide) echo ro.expect.recovery_id=`cat $(RECOVERYIMAGE_ID_FILE)` >> $@ | 
|  | 440 | endif | 
|  | 441 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 442 | # ----------------------------------------------------------------- | 
| Daniel Rosenberg | 40b61ca | 2014-07-21 17:21:20 -0700 | [diff] [blame] | 443 | # vendor build.prop | 
|  | 444 | # | 
| Alex Naidis | 47e24e9 | 2016-01-10 14:18:54 +0000 | [diff] [blame] | 445 | # For verifying that the vendor build is what we think it is | 
| Daniel Rosenberg | 40b61ca | 2014-07-21 17:21:20 -0700 | [diff] [blame] | 446 | INSTALLED_VENDOR_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR)/build.prop | 
|  | 447 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_VENDOR_BUILD_PROP_TARGET) | 
| Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 448 |  | 
| Jaekyun Seok | fbc07f9 | 2017-03-03 12:40:21 +0900 | [diff] [blame] | 449 | ifdef property_overrides_split_enabled | 
| Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 450 | FINAL_VENDOR_BUILD_PROPERTIES += \ | 
|  | 451 | $(call collapse-pairs, $(PRODUCT_PROPERTY_OVERRIDES)) | 
|  | 452 | FINAL_VENDOR_BUILD_PROPERTIES := $(call uniq-pairs-by-first-component, \ | 
|  | 453 | $(FINAL_VENDOR_BUILD_PROPERTIES),=) | 
| Jaekyun Seok | fbc07f9 | 2017-03-03 12:40:21 +0900 | [diff] [blame] | 454 | endif  # property_overrides_split_enabled | 
| Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 455 |  | 
| Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 456 | $(INSTALLED_VENDOR_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(intermediate_system_build_prop) | 
| Daniel Rosenberg | 40b61ca | 2014-07-21 17:21:20 -0700 | [diff] [blame] | 457 | @echo Target vendor buildinfo: $@ | 
|  | 458 | @mkdir -p $(dir $@) | 
|  | 459 | $(hide) echo > $@ | 
| Sandeep Patil | 127f501 | 2017-10-23 19:47:43 -0700 | [diff] [blame] | 460 | $(hide) grep 'ro.product.first_api_level' $(intermediate_system_build_prop) >> $@ || true | 
| Max Bires | a174998 | 2018-03-28 15:48:13 -0700 | [diff] [blame] | 461 | $(hide) echo ro.vendor.build.security_patch="$(VENDOR_SECURITY_PATCH)">>$@ | 
| Isaac Chen | 8d11feb | 2018-01-31 14:27:37 +0800 | [diff] [blame] | 462 | $(hide) echo ro.vendor.product.cpu.abilist="$(TARGET_CPU_ABI_LIST)">>$@ | 
|  | 463 | $(hide) echo ro.vendor.product.cpu.abilist32="$(TARGET_CPU_ABI_LIST_32_BIT)">>$@ | 
|  | 464 | $(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] | 465 | $(hide) echo ro.product.board="$(TARGET_BOOTLOADER_BOARD_NAME)">>$@ | 
|  | 466 | $(hide) echo ro.board.platform="$(TARGET_BOARD_PLATFORM)">>$@ | 
|  | 467 | $(hide) $(call generate-common-build-props,vendor,$@) | 
| Jaekyun Seok | f9af5fa | 2017-10-25 12:08:32 +0900 | [diff] [blame] | 468 | ifdef property_overrides_split_enabled | 
| Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 469 | $(hide) echo "#" >> $@; \ | 
|  | 470 | echo "# ADDITIONAL VENDOR BUILD PROPERTIES" >> $@; \ | 
|  | 471 | echo "#" >> $@; | 
|  | 472 | $(hide) $(foreach line,$(FINAL_VENDOR_BUILD_PROPERTIES), \ | 
|  | 473 | echo "$(line)" >> $@;) | 
| Jaekyun Seok | fbc07f9 | 2017-03-03 12:40:21 +0900 | [diff] [blame] | 474 | endif  # property_overrides_split_enabled | 
| Ivan Podogov | d572632 | 2018-03-29 15:22:33 +0100 | [diff] [blame] | 475 | $(hide) build/make/tools/post_process_props.py $@ $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_PROPERTY_BLACKLIST) | 
| Daniel Rosenberg | 40b61ca | 2014-07-21 17:21:20 -0700 | [diff] [blame] | 476 |  | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 477 | # ----------------------------------------------------------------- | 
|  | 478 | # product build.prop | 
|  | 479 | INSTALLED_PRODUCT_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT)/build.prop | 
|  | 480 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_PRODUCT_BUILD_PROP_TARGET) | 
|  | 481 |  | 
|  | 482 | FINAL_PRODUCT_PROPERTIES += \ | 
| Yifan Hong | af9e7f0 | 2018-07-27 13:11:50 -0700 | [diff] [blame] | 483 | $(call collapse-pairs, $(PRODUCT_PRODUCT_PROPERTIES) $(ADDITIONAL_PRODUCT_PROPERTIES)) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 484 | FINAL_PRODUCT_PROPERTIES := $(call uniq-pairs-by-first-component, \ | 
|  | 485 | $(FINAL_PRODUCT_PROPERTIES),=) | 
|  | 486 |  | 
| Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 487 | $(INSTALLED_PRODUCT_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 488 | @echo Target product buildinfo: $@ | 
|  | 489 | @mkdir -p $(dir $@) | 
|  | 490 | $(hide) echo > $@ | 
|  | 491 | ifdef BOARD_USES_PRODUCTIMAGE | 
| Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 492 | $(hide) $(call generate-common-build-props,product,$@) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 493 | endif  # BOARD_USES_PRODUCTIMAGE | 
|  | 494 | $(hide) echo "#" >> $@; \ | 
|  | 495 | echo "# ADDITIONAL PRODUCT PROPERTIES" >> $@; \ | 
|  | 496 | echo "#" >> $@; | 
|  | 497 | $(hide) $(foreach line,$(FINAL_PRODUCT_PROPERTIES), \ | 
|  | 498 | echo "$(line)" >> $@;) | 
|  | 499 | $(hide) build/make/tools/post_process_props.py $@ | 
|  | 500 |  | 
| Andres Morales | 9c820f8 | 2015-01-13 15:30:34 -0800 | [diff] [blame] | 501 | # ---------------------------------------------------------------- | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 502 | # odm build.prop | 
|  | 503 | INSTALLED_ODM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM)/build.prop | 
|  | 504 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_ODM_BUILD_PROP_TARGET) | 
|  | 505 |  | 
|  | 506 | FINAL_ODM_BUILD_PROPERTIES += \ | 
|  | 507 | $(call collapse-pairs, $(PRODUCT_ODM_PROPERTIES)) | 
|  | 508 | FINAL_ODM_BUILD_PROPERTIES := $(call uniq-pairs-by-first-component, \ | 
|  | 509 | $(FINAL_ODM_BUILD_PROPERTIES),=) | 
|  | 510 |  | 
| Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 511 | $(INSTALLED_ODM_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 512 | @echo Target odm buildinfo: $@ | 
|  | 513 | @mkdir -p $(dir $@) | 
|  | 514 | $(hide) echo > $@ | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 515 | $(hide) echo ro.odm.product.cpu.abilist="$(TARGET_CPU_ABI_LIST)">>$@ | 
|  | 516 | $(hide) echo ro.odm.product.cpu.abilist32="$(TARGET_CPU_ABI_LIST_32_BIT)">>$@ | 
|  | 517 | $(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] | 518 | $(hide) $(call generate-common-build-props,odm,$@) | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 519 | $(hide) echo "#" >> $@; \ | 
|  | 520 | echo "# ADDITIONAL ODM BUILD PROPERTIES" >> $@; \ | 
|  | 521 | echo "#" >> $@; | 
|  | 522 | $(hide) $(foreach line,$(FINAL_ODM_BUILD_PROPERTIES), \ | 
|  | 523 | echo "$(line)" >> $@;) | 
|  | 524 | $(hide) build/make/tools/post_process_props.py $@ | 
| Andres Morales | 9c820f8 | 2015-01-13 15:30:34 -0800 | [diff] [blame] | 525 |  | 
| Daniel Rosenberg | 40b61ca | 2014-07-21 17:21:20 -0700 | [diff] [blame] | 526 | # ----------------------------------------------------------------- | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 527 | # product_services build.prop | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 528 | INSTALLED_PRODUCT_SERVICES_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT_SERVICES)/build.prop | 
|  | 529 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_PRODUCT_SERVICES_BUILD_PROP_TARGET) | 
|  | 530 |  | 
|  | 531 | FINAL_PRODUCT_SERVICES_PROPERTIES += \ | 
|  | 532 | $(call collapse-pairs, $(PRODUCT_PRODUCT_SERVICES_PROPERTIES)) | 
|  | 533 | FINAL_PRODUCT_SERVICES_PROPERTIES := $(call uniq-pairs-by-first-component, \ | 
|  | 534 | $(FINAL_PRODUCT_SERVICES_PROPERTIES),=) | 
|  | 535 |  | 
| Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 536 | $(INSTALLED_PRODUCT_SERVICES_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 537 | @echo Target product_services buildinfo: $@ | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 538 | @mkdir -p $(dir $@) | 
|  | 539 | $(hide) echo > $@ | 
|  | 540 | ifdef BOARD_USES_PRODUCT_SERVICESIMAGE | 
| Anton Hansson | 1f8729e | 2018-08-15 12:11:55 +0100 | [diff] [blame] | 541 | $(hide) $(call generate-common-build-props,product_services,$@) | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 542 | endif  # BOARD_USES_PRODUCT_SERVICESIMAGE | 
|  | 543 | $(hide) echo "#" >> $@; \ | 
|  | 544 | echo "# ADDITIONAL PRODUCT_SERVICES PROPERTIES" >> $@; \ | 
|  | 545 | echo "#" >> $@; | 
|  | 546 | $(hide) $(foreach line,$(FINAL_PRODUCT_SERVICES_PROPERTIES), \ | 
|  | 547 | echo "$(line)" >> $@;) | 
|  | 548 | $(hide) build/make/tools/post_process_props.py $@ | 
|  | 549 |  | 
|  | 550 | # ---------------------------------------------------------------- | 
|  | 551 |  | 
|  | 552 | # ----------------------------------------------------------------- | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 553 | # sdk-build.prop | 
|  | 554 | # | 
|  | 555 | # There are certain things in build.prop that we don't want to | 
|  | 556 | # ship with the sdk; remove them. | 
|  | 557 |  | 
|  | 558 | # This must be a list of entire property keys followed by | 
|  | 559 | # "=" characters, without any internal spaces. | 
|  | 560 | sdk_build_prop_remove := \ | 
|  | 561 | ro.build.user= \ | 
|  | 562 | ro.build.host= \ | 
|  | 563 | ro.product.brand= \ | 
|  | 564 | ro.product.manufacturer= \ | 
|  | 565 | ro.product.device= | 
|  | 566 | # TODO: Remove this soon-to-be obsolete property | 
|  | 567 | sdk_build_prop_remove += ro.build.product= | 
|  | 568 | INSTALLED_SDK_BUILD_PROP_TARGET := $(PRODUCT_OUT)/sdk/sdk-build.prop | 
|  | 569 | $(INSTALLED_SDK_BUILD_PROP_TARGET): $(INSTALLED_BUILD_PROP_TARGET) | 
|  | 570 | @echo SDK buildinfo: $@ | 
|  | 571 | @mkdir -p $(dir $@) | 
|  | 572 | $(hide) grep -v "$(subst $(space),\|,$(strip \ | 
|  | 573 | $(sdk_build_prop_remove)))" $< > $@.tmp | 
|  | 574 | $(hide) for x in $(sdk_build_prop_remove); do \ | 
|  | 575 | echo "$$x"generic >> $@.tmp; done | 
|  | 576 | $(hide) mv $@.tmp $@ | 
|  | 577 |  | 
|  | 578 | # ----------------------------------------------------------------- | 
|  | 579 | # package stats | 
|  | 580 | PACKAGE_STATS_FILE := $(PRODUCT_OUT)/package-stats.txt | 
|  | 581 | PACKAGES_TO_STAT := \ | 
|  | 582 | $(sort $(filter $(TARGET_OUT)/% $(TARGET_OUT_DATA)/%, \ | 
|  | 583 | $(filter %.jar %.apk, $(ALL_DEFAULT_INSTALLED_MODULES)))) | 
|  | 584 | $(PACKAGE_STATS_FILE): $(PACKAGES_TO_STAT) | 
|  | 585 | @echo Package stats: $@ | 
|  | 586 | @mkdir -p $(dir $@) | 
|  | 587 | $(hide) rm -f $@ | 
| Gaurav Shah | 67c2ed3 | 2015-08-23 09:40:05 -0700 | [diff] [blame] | 588 | ifeq ($(PACKAGES_TO_STAT),) | 
|  | 589 | # Create empty package stats file if target builds no jar(s) or apk(s). | 
|  | 590 | $(hide) touch $@ | 
|  | 591 | else | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 592 | $(hide) build/make/tools/dump-package-stats $^ > $@ | 
| Gaurav Shah | 67c2ed3 | 2015-08-23 09:40:05 -0700 | [diff] [blame] | 593 | endif | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 594 |  | 
|  | 595 | .PHONY: package-stats | 
|  | 596 | package-stats: $(PACKAGE_STATS_FILE) | 
|  | 597 |  | 
|  | 598 | # ----------------------------------------------------------------- | 
|  | 599 | # Cert-to-package mapping.  Used by the post-build signing tools. | 
| Ying Wang | d9a88d5 | 2012-10-26 09:21:28 -0700 | [diff] [blame] | 600 | # Use a macro to add newline to each echo command | 
| Narayan Kamath | 6a4bd69 | 2017-08-14 10:53:50 +0100 | [diff] [blame] | 601 | define _apkcerts_write_line | 
|  | 602 | $(hide) echo -n 'name="$(1).apk" certificate="$2" private_key="$3"' >> $5 | 
|  | 603 | $(if $(4), $(hide) echo -n ' compressed="$4"' >> $5) | 
|  | 604 | $(hide) echo '' >> $5 | 
| Ying Wang | d9a88d5 | 2012-10-26 09:21:28 -0700 | [diff] [blame] | 605 |  | 
|  | 606 | endef | 
|  | 607 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 608 | name := $(TARGET_PRODUCT) | 
|  | 609 | ifeq ($(TARGET_BUILD_TYPE),debug) | 
|  | 610 | name := $(name)_debug | 
|  | 611 | endif | 
|  | 612 | name := $(name)-apkcerts-$(FILE_NAME_TAG) | 
|  | 613 | intermediates := \ | 
|  | 614 | $(call intermediates-dir-for,PACKAGING,apkcerts) | 
|  | 615 | APKCERTS_FILE := $(intermediates)/$(name).txt | 
| Ying Wang | 15e487a | 2011-02-15 10:56:18 -0800 | [diff] [blame] | 616 | # We don't need to really build all the modules. | 
|  | 617 | # TODO: rebuild APKCERTS_FILE if any app change its cert. | 
| Ying Wang | efb2168 | 2010-07-23 16:42:13 -0700 | [diff] [blame] | 618 | $(APKCERTS_FILE): | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 619 | @echo APK certs list: $@ | 
|  | 620 | @mkdir -p $(dir $@) | 
|  | 621 | @rm -f $@ | 
| Ying Wang | d9a88d5 | 2012-10-26 09:21:28 -0700 | [diff] [blame] | 622 | $(foreach p,$(PACKAGES),\ | 
|  | 623 | $(if $(PACKAGES.$(p).EXTERNAL_KEY),\ | 
| Narayan Kamath | 6a4bd69 | 2017-08-14 10:53:50 +0100 | [diff] [blame] | 624 | $(call _apkcerts_write_line,$(p),"EXTERNAL","",$(PACKAGES.$(p).COMPRESSED),$@),\ | 
|  | 625 | $(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] | 626 | # In case value of PACKAGES is empty. | 
| Ying Wang | f272cd6 | 2011-09-26 12:05:06 -0700 | [diff] [blame] | 627 | $(hide) touch $@ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 628 |  | 
|  | 629 | .PHONY: apkcerts-list | 
|  | 630 | apkcerts-list: $(APKCERTS_FILE) | 
|  | 631 |  | 
| Ying Wang | 15e487a | 2011-02-15 10:56:18 -0800 | [diff] [blame] | 632 | ifneq (,$(TARGET_BUILD_APPS)) | 
|  | 633 | $(call dist-for-goals, apps_only, $(APKCERTS_FILE):apkcerts.txt) | 
|  | 634 | endif | 
| Ying Wang | efb2168 | 2010-07-23 16:42:13 -0700 | [diff] [blame] | 635 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 636 | # ----------------------------------------------------------------- | 
| Dan Willemsen | 3bf15e7 | 2016-07-25 16:03:53 -0700 | [diff] [blame] | 637 | # build system stats | 
|  | 638 | BUILD_SYSTEM_STATS := $(PRODUCT_OUT)/build_system_stats.txt | 
|  | 639 | $(BUILD_SYSTEM_STATS): | 
|  | 640 | @rm -f $@ | 
|  | 641 | @$(foreach s,$(STATS.MODULE_TYPE),echo "modules_type_make,$(s),$(words $(STATS.MODULE_TYPE.$(s)))" >>$@;) | 
|  | 642 | @$(foreach s,$(STATS.SOONG_MODULE_TYPE),echo "modules_type_soong,$(s),$(STATS.SOONG_MODULE_TYPE.$(s))" >>$@;) | 
|  | 643 | $(call dist-for-goals,droidcore,$(BUILD_SYSTEM_STATS)) | 
| Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 644 |  | 
| Dan Willemsen | 3bf15e7 | 2016-07-25 16:03:53 -0700 | [diff] [blame] | 645 | # ----------------------------------------------------------------- | 
| Dan Willemsen | fc92fb2 | 2016-08-26 13:27:13 -0700 | [diff] [blame] | 646 | # Modules ready to be converted to Soong, ordered by how many | 
|  | 647 | # modules depend on them. | 
|  | 648 | SOONG_CONV := $(sort $(SOONG_CONV)) | 
|  | 649 | SOONG_CONV_DATA := $(call intermediates-dir-for,PACKAGING,soong_conversion)/soong_conv_data | 
|  | 650 | $(SOONG_CONV_DATA): | 
|  | 651 | @rm -f $@ | 
| Colin Cross | 3277ba3 | 2017-12-06 14:37:06 -0800 | [diff] [blame] | 652 | @$(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] | 653 |  | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 654 | SOONG_TO_CONVERT_SCRIPT := build/make/tools/soong_to_convert.py | 
| Dan Willemsen | fc92fb2 | 2016-08-26 13:27:13 -0700 | [diff] [blame] | 655 | SOONG_TO_CONVERT := $(PRODUCT_OUT)/soong_to_convert.txt | 
|  | 656 | $(SOONG_TO_CONVERT): $(SOONG_CONV_DATA) $(SOONG_TO_CONVERT_SCRIPT) | 
|  | 657 | @rm -f $@ | 
|  | 658 | $(hide) $(SOONG_TO_CONVERT_SCRIPT) $< >$@ | 
|  | 659 | $(call dist-for-goals,droidcore,$(SOONG_TO_CONVERT)) | 
|  | 660 |  | 
|  | 661 | # ----------------------------------------------------------------- | 
| Chih-Hung Hsieh | 1876acd | 2017-11-06 10:47:24 -0800 | [diff] [blame] | 662 | # Modules use -Wno-error, or added default -Wall -Werror | 
|  | 663 | WALL_WERROR := $(PRODUCT_OUT)/wall_werror.txt | 
|  | 664 | $(WALL_WERROR): | 
|  | 665 | @rm -f $@ | 
|  | 666 | echo "# Modules using -Wno-error" >> $@ | 
|  | 667 | 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] | 668 | echo "# Modules added default -Wall" >> $@ | 
|  | 669 | for m in $(sort $(SOONG_MODULES_ADDED_WALL) $(MODULES_ADDED_WALL)); do echo $$m >> $@; done | 
|  | 670 |  | 
|  | 671 | $(call dist-for-goals,droidcore,$(WALL_WERROR)) | 
|  | 672 |  | 
|  | 673 | # ----------------------------------------------------------------- | 
| Pirama Arumuga Nainar | ae95956 | 2018-01-29 09:22:24 -0800 | [diff] [blame] | 674 | # Modules missing profile files | 
|  | 675 | PGO_PROFILE_MISSING := $(PRODUCT_OUT)/pgo_profile_file_missing.txt | 
|  | 676 | $(PGO_PROFILE_MISSING): | 
|  | 677 | @rm -f $@ | 
|  | 678 | echo "# Modules missing PGO profile files" >> $@ | 
|  | 679 | for m in $(SOONG_MODULES_MISSING_PGO_PROFILE_FILE); do echo $$m >> $@; done | 
|  | 680 |  | 
|  | 681 | $(call dist-for-goals,droidcore,$(PGO_PROFILE_MISSING)) | 
|  | 682 |  | 
|  | 683 | # ----------------------------------------------------------------- | 
| Ying Wang | 3c21fe5 | 2011-10-04 10:50:08 -0700 | [diff] [blame] | 684 | # 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] | 685 | # for future OTA packages installed by this system.  Actual product | 
|  | 686 | # deliverables will be re-signed by hand.  We expect this file to | 
|  | 687 | # exist with the suffixes ".x509.pem" and ".pk8". | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 688 | DEFAULT_KEY_CERT_PAIR := $(DEFAULT_SYSTEM_DEV_CERTIFICATE) | 
| Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 689 |  | 
|  | 690 |  | 
| Jeff Brown | e33ba4c | 2011-07-11 22:11:46 -0700 | [diff] [blame] | 691 | # 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] | 692 | # if they don't do anything. | 
|  | 693 | .PHONY: systemimage | 
|  | 694 | systemimage: | 
|  | 695 |  | 
| Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 696 | # ----------------------------------------------------------------- | 
|  | 697 |  | 
|  | 698 | .PHONY: event-log-tags | 
|  | 699 |  | 
| Joe Onorato | b751053 | 2010-07-14 10:22:54 -0700 | [diff] [blame] | 700 | # Produce an event logs tag file for everything we know about, in order | 
|  | 701 | # to properly allocate numbers.  Then produce a file that's filtered | 
|  | 702 | # for what's going to be installed. | 
|  | 703 |  | 
|  | 704 | all_event_log_tags_file := $(TARGET_OUT_COMMON_INTERMEDIATES)/all-event-log-tags.txt | 
|  | 705 |  | 
| Colin Cross | dc8f8e4 | 2012-04-12 13:25:54 -0700 | [diff] [blame] | 706 | event_log_tags_file := $(TARGET_OUT)/etc/event-log-tags | 
|  | 707 |  | 
| Joe Onorato | b751053 | 2010-07-14 10:22:54 -0700 | [diff] [blame] | 708 | # Include tags from all packages that we know about | 
|  | 709 | all_event_log_tags_src := \ | 
|  | 710 | $(sort $(foreach m, $(ALL_MODULES), $(ALL_MODULES.$(m).EVENT_LOG_TAGS))) | 
|  | 711 |  | 
| Colin Cross | dc8f8e4 | 2012-04-12 13:25:54 -0700 | [diff] [blame] | 712 | # PDK builds will already have a full list of tags that needs to get merged | 
|  | 713 | # in with the ones from source | 
|  | 714 | pdk_fusion_log_tags_file := $(patsubst $(PRODUCT_OUT)/%,$(_pdk_fusion_intermediates)/%,$(filter $(event_log_tags_file),$(ALL_PDK_FUSION_FILES))) | 
|  | 715 |  | 
|  | 716 | $(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] | 717 | $(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] | 718 | $(hide) mkdir -p $(dir $@) | 
| Shinichiro Hamaji | d3ce14c | 2016-03-29 03:29:21 +0900 | [diff] [blame] | 719 | $(hide) $(MERGETAGS) -o $@ $(PRIVATE_SRC_FILES) | 
| Joe Onorato | b751053 | 2010-07-14 10:22:54 -0700 | [diff] [blame] | 720 |  | 
| Doug Zongker | a34fa95 | 2011-02-23 12:17:29 -0800 | [diff] [blame] | 721 | # Include tags from all packages included in this product, plus all | 
|  | 722 | # tags that are part of the system (ie, not in a vendor/ or device/ | 
|  | 723 | # directory). | 
| Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 724 | event_log_tags_src := \ | 
|  | 725 | $(sort $(foreach m,\ | 
|  | 726 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES) \ | 
|  | 727 | $(call module-names-for-tag-list,user), \ | 
| Doug Zongker | a34fa95 | 2011-02-23 12:17:29 -0800 | [diff] [blame] | 728 | $(ALL_MODULES.$(m).EVENT_LOG_TAGS)) \ | 
|  | 729 | $(filter-out vendor/% device/% out/%,$(all_event_log_tags_src))) | 
| Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 730 |  | 
| Colin Cross | dc8f8e4 | 2012-04-12 13:25:54 -0700 | [diff] [blame] | 731 | $(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] | 732 | $(event_log_tags_file): PRIVATE_MERGED_FILE := $(all_event_log_tags_file) | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 733 | $(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] | 734 | $(hide) mkdir -p $(dir $@) | 
| Shinichiro Hamaji | d3ce14c | 2016-03-29 03:29:21 +0900 | [diff] [blame] | 735 | $(hide) $(MERGETAGS) -o $@ -m $(PRIVATE_MERGED_FILE) $(PRIVATE_SRC_FILES) | 
| Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 736 |  | 
|  | 737 | event-log-tags: $(event_log_tags_file) | 
|  | 738 |  | 
|  | 739 | ALL_DEFAULT_INSTALLED_MODULES += $(event_log_tags_file) | 
|  | 740 |  | 
| Joe Onorato | b751053 | 2010-07-14 10:22:54 -0700 | [diff] [blame] | 741 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 742 | # ################################################################# | 
|  | 743 | # Targets for boot/OS images | 
|  | 744 | # ################################################################# | 
| Ying Wang | c634974 | 2014-01-13 16:14:20 -0800 | [diff] [blame] | 745 | ifneq ($(strip $(TARGET_NO_BOOTLOADER)),true) | 
|  | 746 | INSTALLED_BOOTLOADER_MODULE := $(PRODUCT_OUT)/bootloader | 
|  | 747 | ifeq ($(strip $(TARGET_BOOTLOADER_IS_2ND)),true) | 
|  | 748 | INSTALLED_2NDBOOTLOADER_TARGET := $(PRODUCT_OUT)/2ndbootloader | 
|  | 749 | else | 
|  | 750 | INSTALLED_2NDBOOTLOADER_TARGET := | 
|  | 751 | endif | 
|  | 752 | else | 
|  | 753 | INSTALLED_BOOTLOADER_MODULE := | 
|  | 754 | INSTALLED_2NDBOOTLOADER_TARGET := | 
|  | 755 | endif # TARGET_NO_BOOTLOADER | 
|  | 756 | ifneq ($(strip $(TARGET_NO_KERNEL)),true) | 
|  | 757 | INSTALLED_KERNEL_TARGET := $(PRODUCT_OUT)/kernel | 
|  | 758 | else | 
|  | 759 | INSTALLED_KERNEL_TARGET := | 
|  | 760 | endif | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 761 |  | 
|  | 762 | # ----------------------------------------------------------------- | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 763 | # the root dir | 
|  | 764 | INTERNAL_ROOT_FILES := $(filter $(TARGET_ROOT_OUT)/%, \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 765 | $(ALL_GENERATED_SOURCES) \ | 
|  | 766 | $(ALL_DEFAULT_INSTALLED_MODULES)) | 
|  | 767 |  | 
| Luis Hector Chavez | ff48993 | 2018-07-03 15:41:40 -0700 | [diff] [blame] | 768 | INSTALLED_FILES_FILE_ROOT := $(PRODUCT_OUT)/installed-files-root.txt | 
|  | 769 | INSTALLED_FILES_JSON_ROOT := $(INSTALLED_FILES_FILE_ROOT:.txt=.json) | 
|  | 770 | $(INSTALLED_FILES_FILE_ROOT): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_ROOT) | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 771 | $(INSTALLED_FILES_FILE_ROOT) : $(INTERNAL_ROOT_FILES) $(FILESLIST) | 
| Luis Hector Chavez | ff48993 | 2018-07-03 15:41:40 -0700 | [diff] [blame] | 772 | @echo Installed file list: $@ | 
|  | 773 | @mkdir -p $(dir $@) | 
|  | 774 | @rm -f $@ | 
|  | 775 | $(hide) $(FILESLIST) $(TARGET_ROOT_OUT) > $(@:.txt=.json) | 
|  | 776 | $(hide) build/make/tools/fileslist_util.py -c $(@:.txt=.json) > $@ | 
|  | 777 |  | 
|  | 778 | $(call dist-for-goals, sdk win_sdk sdk_addon, $(INSTALLED_FILES_FILE_ROOT)) | 
|  | 779 |  | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 780 | # ----------------------------------------------------------------- | 
|  | 781 | # the ramdisk | 
|  | 782 | INTERNAL_RAMDISK_FILES := $(filter $(TARGET_RAMDISK_OUT)/%, \ | 
|  | 783 | $(ALL_GENERATED_SOURCES) \ | 
|  | 784 | $(ALL_DEFAULT_INSTALLED_MODULES)) | 
|  | 785 |  | 
|  | 786 | INSTALLED_FILES_FILE_RAMDISK := $(PRODUCT_OUT)/installed-files-ramdisk.txt | 
|  | 787 | INSTALLED_FILES_JSON_RAMDISK := $(INSTALLED_FILES_FILE_RAMDISK:.txt=.json) | 
|  | 788 | $(INSTALLED_FILES_FILE_RAMDISK): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_RAMDISK) | 
|  | 789 | $(INSTALLED_FILES_FILE_RAMDISK) : $(INTERNAL_RAMDISK_FILES) $(FILESLIST) | 
|  | 790 | @echo Installed file list: $@ | 
|  | 791 | @mkdir -p $(dir $@) | 
|  | 792 | @rm -f $@ | 
|  | 793 | $(hide) $(FILESLIST) $(TARGET_RAMDISK_OUT) > $(@:.txt=.json) | 
|  | 794 | $(hide) build/make/tools/fileslist_util.py -c $(@:.txt=.json) > $@ | 
|  | 795 |  | 
|  | 796 | $(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] | 797 | BUILT_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.img | 
|  | 798 |  | 
|  | 799 | # We just build this directly to the install location. | 
|  | 800 | INSTALLED_RAMDISK_TARGET := $(BUILT_RAMDISK_TARGET) | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 801 | $(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] | 802 | $(call pretty,"Target ram disk: $@") | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 803 | $(hide) $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RAMDISK_OUT) | $(MINIGZIP) > $@ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 804 |  | 
| Ying Wang | ad7fd29 | 2013-08-08 16:34:29 -0700 | [diff] [blame] | 805 | .PHONY: ramdisk-nodeps | 
|  | 806 | ramdisk-nodeps: $(MKBOOTFS) | $(MINIGZIP) | 
|  | 807 | @echo "make $@: ignoring dependencies" | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 808 | $(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] | 809 |  | 
| Michael Schwartz | 0dc6f21 | 2017-07-18 10:05:13 -0700 | [diff] [blame] | 810 | INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img | 
|  | 811 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 812 | ifneq ($(strip $(TARGET_NO_KERNEL)),true) | 
|  | 813 |  | 
|  | 814 | # ----------------------------------------------------------------- | 
|  | 815 | # the boot image, which is a collection of other images. | 
|  | 816 | INTERNAL_BOOTIMAGE_ARGS := \ | 
|  | 817 | $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \ | 
| Rom Lemarchand | f9c9266 | 2015-04-08 15:11:47 -0700 | [diff] [blame] | 818 | --kernel $(INSTALLED_KERNEL_TARGET) | 
|  | 819 |  | 
|  | 820 | ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) | 
|  | 821 | INTERNAL_BOOTIMAGE_ARGS += --ramdisk $(INSTALLED_RAMDISK_TARGET) | 
|  | 822 | endif | 
|  | 823 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 824 | INTERNAL_BOOTIMAGE_FILES := $(filter-out --%,$(INTERNAL_BOOTIMAGE_ARGS)) | 
|  | 825 |  | 
| Dima Zavin | 1e0847c | 2009-05-07 19:43:08 -0700 | [diff] [blame] | 826 | ifdef BOARD_KERNEL_BASE | 
|  | 827 | INTERNAL_BOOTIMAGE_ARGS += --base $(BOARD_KERNEL_BASE) | 
|  | 828 | endif | 
|  | 829 |  | 
| Ying Wang | ffff002 | 2010-08-23 12:56:25 -0700 | [diff] [blame] | 830 | ifdef BOARD_KERNEL_PAGESIZE | 
|  | 831 | INTERNAL_BOOTIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE) | 
|  | 832 | endif | 
|  | 833 |  | 
| Badhri Jagan Sridharan | f380da3 | 2016-05-27 09:49:49 -0700 | [diff] [blame] | 834 | ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true) | 
|  | 835 | ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) | 
|  | 836 | VERITY_KEYID := veritykeyid=id:`openssl x509 -in $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).x509.pem -text \ | 
|  | 837 | | grep keyid | sed 's/://g' | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]' | sed 's/keyid//g'` | 
|  | 838 | endif | 
|  | 839 | endif | 
|  | 840 |  | 
| Dan Willemsen | c1f17ff | 2016-10-05 16:57:27 -0700 | [diff] [blame] | 841 | INTERNAL_KERNEL_CMDLINE := $(strip $(BOARD_KERNEL_CMDLINE) buildvariant=$(TARGET_BUILD_VARIANT) $(VERITY_KEYID)) | 
|  | 842 | ifdef INTERNAL_KERNEL_CMDLINE | 
|  | 843 | INTERNAL_BOOTIMAGE_ARGS += --cmdline "$(INTERNAL_KERNEL_CMDLINE)" | 
| Badhri Jagan Sridharan | f380da3 | 2016-05-27 09:49:49 -0700 | [diff] [blame] | 844 | endif | 
| Badhri Jagan Sridharan | f380da3 | 2016-05-27 09:49:49 -0700 | [diff] [blame] | 845 |  | 
| Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 846 | INTERNAL_MKBOOTIMG_VERSION_ARGS := \ | 
|  | 847 | --os_version $(PLATFORM_VERSION) \ | 
|  | 848 | --os_patch_level $(PLATFORM_SECURITY_PATCH) | 
|  | 849 |  | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 850 | # BOARD_USES_RECOVERY_AS_BOOT = true must have BOARD_BUILD_SYSTEM_ROOT_IMAGE = true. | 
|  | 851 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) | 
|  | 852 | ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) | 
|  | 853 | $(error BOARD_BUILD_SYSTEM_ROOT_IMAGE must be enabled for BOARD_USES_RECOVERY_AS_BOOT.) | 
|  | 854 | endif | 
|  | 855 | endif | 
|  | 856 |  | 
|  | 857 | # We build recovery as boot image if BOARD_USES_RECOVERY_AS_BOOT is true. | 
|  | 858 | ifneq ($(BOARD_USES_RECOVERY_AS_BOOT),true) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 859 | ifeq ($(TARGET_BOOTIMAGE_USE_EXT2),true) | 
| JP Abgrall | 7bb75e4 | 2015-02-11 15:04:59 -0800 | [diff] [blame] | 860 | $(error TARGET_BOOTIMAGE_USE_EXT2 is not supported anymore) | 
| David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 861 |  | 
|  | 862 | else ifeq (true,$(BOARD_AVB_ENABLE)) # TARGET_BOOTIMAGE_USE_EXT2 != true | 
|  | 863 |  | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 864 | $(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] | 865 | $(call pretty,"Target boot image: $@") | 
|  | 866 | $(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] | 867 | $(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] | 868 | $(hide) $(AVBTOOL) add_hash_footer \ | 
|  | 869 | --image $@ \ | 
|  | 870 | --partition_size $(BOARD_BOOTIMAGE_PARTITION_SIZE) \ | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 871 | --partition_name boot $(INTERNAL_AVB_BOOT_SIGNING_ARGS) \ | 
| David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 872 | $(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS) | 
|  | 873 |  | 
|  | 874 | .PHONY: bootimage-nodeps | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 875 | bootimage-nodeps: $(MKBOOTIMG) $(AVBTOOL) $(BOARD_AVB_BOOT_KEY_PATH) | 
| David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 876 | @echo "make $@: ignoring dependencies" | 
|  | 877 | $(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] | 878 | $(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] | 879 | $(hide) $(AVBTOOL) add_hash_footer \ | 
| Bowgo Tsai | 03b9c8e | 2017-11-17 15:22:37 +0800 | [diff] [blame] | 880 | --image $(INSTALLED_BOOTIMAGE_TARGET) \ | 
| David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 881 | --partition_size $(BOARD_BOOTIMAGE_PARTITION_SIZE) \ | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 882 | --partition_name boot $(INTERNAL_AVB_BOOT_SIGNING_ARGS) \ | 
| David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 883 | $(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS) | 
|  | 884 |  | 
|  | 885 | else ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_BOOT_SIGNER)) # BOARD_AVB_ENABLE != true | 
| Geremy Condra | 740b663 | 2014-07-08 20:07:41 -0700 | [diff] [blame] | 886 |  | 
|  | 887 | $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(BOOT_SIGNER) | 
|  | 888 | $(call pretty,"Target boot image: $@") | 
| Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 889 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ | 
| Sami Tolvanen | 72d90eb | 2014-11-06 20:38:00 -0800 | [diff] [blame] | 890 | $(BOOT_SIGNER) /boot $@ $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).x509.pem $@ | 
| Geremy Condra | 740b663 | 2014-07-08 20:07:41 -0700 | [diff] [blame] | 891 | $(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE)) | 
|  | 892 |  | 
|  | 893 | .PHONY: bootimage-nodeps | 
|  | 894 | bootimage-nodeps: $(MKBOOTIMG) $(BOOT_SIGNER) | 
|  | 895 | @echo "make $@: ignoring dependencies" | 
| Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 896 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(INSTALLED_BOOTIMAGE_TARGET) | 
| Sami Tolvanen | 72d90eb | 2014-11-06 20:38:00 -0800 | [diff] [blame] | 897 | $(BOOT_SIGNER) /boot $(INSTALLED_BOOTIMAGE_TARGET) $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).x509.pem $(INSTALLED_BOOTIMAGE_TARGET) | 
| Geremy Condra | 740b663 | 2014-07-08 20:07:41 -0700 | [diff] [blame] | 898 | $(hide) $(call assert-max-image-size,$(INSTALLED_BOOTIMAGE_TARGET),$(BOARD_BOOTIMAGE_PARTITION_SIZE)) | 
|  | 899 |  | 
| Sami Tolvanen | 8b3f08b | 2015-04-07 15:08:59 +0100 | [diff] [blame] | 900 | else ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT)) # PRODUCT_SUPPORTS_BOOT_SIGNER != true | 
| David Riley | 17be3d3 | 2015-03-03 08:54:11 -0800 | [diff] [blame] | 901 |  | 
| Tao Bao | 4b57741 | 2017-02-22 22:54:39 -0800 | [diff] [blame] | 902 | $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(VBOOT_SIGNER) $(FUTILITY) | 
| David Riley | 17be3d3 | 2015-03-03 08:54:11 -0800 | [diff] [blame] | 903 | $(call pretty,"Target boot image: $@") | 
| Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 904 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@.unsigned | 
| Furquan Shaikh | e8c2122 | 2015-08-07 11:58:05 -0700 | [diff] [blame] | 905 | $(VBOOT_SIGNER) $(FUTILITY) $@.unsigned $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VBOOT_SIGNING_KEY).vbpubk $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VBOOT_SIGNING_KEY).vbprivk $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VBOOT_SIGNING_SUBKEY).vbprivk $@.keyblock $@ | 
| David Riley | 17be3d3 | 2015-03-03 08:54:11 -0800 | [diff] [blame] | 906 | $(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE)) | 
|  | 907 |  | 
|  | 908 | .PHONY: bootimage-nodeps | 
| Tao Bao | 4b57741 | 2017-02-22 22:54:39 -0800 | [diff] [blame] | 909 | bootimage-nodeps: $(MKBOOTIMG) $(VBOOT_SIGNER) $(FUTILITY) | 
| David Riley | 17be3d3 | 2015-03-03 08:54:11 -0800 | [diff] [blame] | 910 | @echo "make $@: ignoring dependencies" | 
| Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 911 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(INSTALLED_BOOTIMAGE_TARGET).unsigned | 
| Furquan Shaikh | e8c2122 | 2015-08-07 11:58:05 -0700 | [diff] [blame] | 912 | $(VBOOT_SIGNER) $(FUTILITY) $(INSTALLED_BOOTIMAGE_TARGET).unsigned $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VBOOT_SIGNING_KEY).vbpubk $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VBOOT_SIGNING_KEY).vbprivk $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VBOOT_SIGNING_SUBKEY).vbprivk $(INSTALLED_BOOTIMAGE_TARGET).keyblock $(INSTALLED_BOOTIMAGE_TARGET) | 
| David Riley | 17be3d3 | 2015-03-03 08:54:11 -0800 | [diff] [blame] | 913 | $(hide) $(call assert-max-image-size,$(INSTALLED_BOOTIMAGE_TARGET),$(BOARD_BOOTIMAGE_PARTITION_SIZE)) | 
|  | 914 |  | 
|  | 915 | else # PRODUCT_SUPPORTS_VBOOT != true | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 916 |  | 
|  | 917 | $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) | 
|  | 918 | $(call pretty,"Target boot image: $@") | 
| Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 919 | $(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] | 920 | $(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE)) | 
| Ying Wang | ad7fd29 | 2013-08-08 16:34:29 -0700 | [diff] [blame] | 921 |  | 
|  | 922 | .PHONY: bootimage-nodeps | 
|  | 923 | bootimage-nodeps: $(MKBOOTIMG) | 
|  | 924 | @echo "make $@: ignoring dependencies" | 
| Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 925 | $(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] | 926 | $(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] | 927 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 928 | endif # TARGET_BOOTIMAGE_USE_EXT2 | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 929 | endif # BOARD_USES_RECOVERY_AS_BOOT | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 930 |  | 
| Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 931 | else # TARGET_NO_KERNEL == "true" | 
| Michael Schwartz | 0dc6f21 | 2017-07-18 10:05:13 -0700 | [diff] [blame] | 932 | ifdef BOARD_PREBUILT_BOOTIMAGE | 
|  | 933 | ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) | 
|  | 934 | # Remove when b/63676296 is resolved. | 
|  | 935 | $(error Prebuilt bootimage is only supported for AB targets) | 
|  | 936 | endif | 
|  | 937 | $(eval $(call copy-one-file,$(BOARD_PREBUILT_BOOTIMAGE),$(INSTALLED_BOOTIMAGE_TARGET))) | 
| Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 938 | else # BOARD_PREBUILT_BOOTIMAGE not defined | 
| Dan Willemsen | c1f17ff | 2016-10-05 16:57:27 -0700 | [diff] [blame] | 939 | INTERNAL_KERNEL_CMDLINE := $(strip $(BOARD_KERNEL_CMDLINE)) | 
| Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 940 | INSTALLED_BOOTIMAGE_TARGET := | 
|  | 941 | endif # BOARD_PREBUILT_BOOTIMAGE | 
|  | 942 | endif # TARGET_NO_KERNEL | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 943 |  | 
|  | 944 | # ----------------------------------------------------------------- | 
|  | 945 | # NOTICE files | 
|  | 946 | # | 
| Steve Block | d14d3b4 | 2012-03-01 11:34:41 +0000 | [diff] [blame] | 947 | # We are required to publish the licenses for all code under BSD, GPL and | 
|  | 948 | # Apache licenses (and possibly other more exotic ones as well). We err on the | 
|  | 949 | # side of caution, so the licenses for other third-party code are included here | 
|  | 950 | # too. | 
|  | 951 | # | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 952 | # This needs to be before the systemimage rules, because it adds to | 
|  | 953 | # ALL_DEFAULT_INSTALLED_MODULES, which those use to pick which files | 
|  | 954 | # go into the systemimage. | 
|  | 955 |  | 
| Steve Block | 495e585 | 2012-02-29 19:18:08 +0000 | [diff] [blame] | 956 | .PHONY: notice_files | 
|  | 957 |  | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 958 | # Create the rule to combine the files into text and html/xml forms | 
| Dario Freni | adc972d | 2018-07-09 18:38:38 +0100 | [diff] [blame] | 959 | # $(1) - xml_excluded_vendor_product|xml_vendor|xml_product|html | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 960 | # $(2) - Plain text output file | 
|  | 961 | # $(3) - HTML/XML output file | 
|  | 962 | # $(4) - File title | 
|  | 963 | # $(5) - Directory to use.  Notice files are all $(4)/src.  Other | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 964 | #		 directories in there will be used for scratch | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 965 | # $(6) - Dependencies for the output files | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 966 | # | 
|  | 967 | # The algorithm here is that we go collect a hash for each of the notice | 
|  | 968 | # files and write the names of the files that match that hash.  Then | 
|  | 969 | # to generate the real files, we go print out all of the files and their | 
|  | 970 | # hashes. | 
|  | 971 | # | 
|  | 972 | # These rules are fairly complex, so they depend on this makefile so if | 
|  | 973 | # it changes, they'll run again. | 
|  | 974 | # | 
|  | 975 | # TODO: We could clean this up so that we just record the locations of the | 
|  | 976 | # original notice files instead of making rules to copy them somwehere. | 
|  | 977 | # Then we could traverse that without quite as much bash drama. | 
|  | 978 | define combine-notice-files | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 979 | $(2) $(3): PRIVATE_MESSAGE := $(4) | 
|  | 980 | $(2) $(3): PRIVATE_DIR := $(5) | 
|  | 981 | $(2) : $(3) | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 982 | $(3) : $(6) $(BUILD_SYSTEM)/Makefile build/make/tools/generate-notice-files.py | 
|  | 983 | build/make/tools/generate-notice-files.py --text-output $(2) \ | 
| Dario Freni | cbca113 | 2018-08-28 18:04:03 +0100 | [diff] [blame] | 984 | $(if $(filter $(1),xml_excluded_extra_partitions),-e vendor$(comma)product$(comma)product_services --xml-output, \ | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 985 | $(if $(filter $(1),xml_vendor),-i vendor --xml-output, \ | 
| Dario Freni | adc972d | 2018-07-09 18:38:38 +0100 | [diff] [blame] | 986 | $(if $(filter $(1),xml_product),-i product --xml-output, \ | 
| Dario Freni | cbca113 | 2018-08-28 18:04:03 +0100 | [diff] [blame] | 987 | $(if $(filter $(1),xml_product_services),-i product_services --xml-output, \ | 
|  | 988 | --html-output)))) $(3) \ | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 989 | -t $$(PRIVATE_MESSAGE) -s $$(PRIVATE_DIR)/src | 
|  | 990 | notice_files: $(2) $(3) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 991 | endef | 
|  | 992 |  | 
|  | 993 | # TODO These intermediate NOTICE.txt/NOTICE.html files should go into | 
|  | 994 | # TARGET_OUT_NOTICE_FILES now that the notice files are gathered from | 
|  | 995 | # the src subdirectory. | 
|  | 996 |  | 
| Steve Block | 495e585 | 2012-02-29 19:18:08 +0000 | [diff] [blame] | 997 | target_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE.txt | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 998 | target_notice_file_html_or_xml := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html | 
|  | 999 | target_notice_file_html_or_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html.gz | 
|  | 1000 | installed_notice_html_or_xml_gz := $(TARGET_OUT)/etc/NOTICE.html.gz | 
| Steve Block | 495e585 | 2012-02-29 19:18:08 +0000 | [diff] [blame] | 1001 | tools_notice_file_txt := $(HOST_OUT_INTERMEDIATES)/NOTICE.txt | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1002 | tools_notice_file_html := $(HOST_OUT_INTERMEDIATES)/NOTICE.html | 
|  | 1003 |  | 
| Steven Moreland | ae69e57 | 2017-12-15 14:49:55 -0800 | [diff] [blame] | 1004 | # TODO(b/69865032): Make PRODUCT_NOTICE_SPLIT the default behavior. | 
|  | 1005 | ifeq ($(PRODUCT_NOTICE_SPLIT),true) | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1006 | target_notice_file_html_or_xml := $(TARGET_OUT_INTERMEDIATES)/NOTICE.xml | 
|  | 1007 | target_notice_file_html_or_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE.xml.gz | 
|  | 1008 | installed_notice_html_or_xml_gz := $(TARGET_OUT)/etc/NOTICE.xml.gz | 
|  | 1009 |  | 
|  | 1010 | target_vendor_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE_VENDOR.txt | 
|  | 1011 | target_vendor_notice_file_xml := $(TARGET_OUT_INTERMEDIATES)/NOTICE_VENDOR.xml | 
|  | 1012 | target_vendor_notice_file_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE_VENDOR.xml.gz | 
|  | 1013 | installed_vendor_notice_xml_gz := $(TARGET_OUT_VENDOR)/etc/NOTICE.xml.gz | 
| Dario Freni | adc972d | 2018-07-09 18:38:38 +0100 | [diff] [blame] | 1014 |  | 
|  | 1015 | target_product_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT.txt | 
|  | 1016 | target_product_notice_file_xml := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT.xml | 
|  | 1017 | target_product_notice_file_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT.xml.gz | 
|  | 1018 | installed_product_notice_xml_gz := $(TARGET_OUT_PRODUCT)/etc/NOTICE.xml.gz | 
| Dario Freni | cbca113 | 2018-08-28 18:04:03 +0100 | [diff] [blame] | 1019 |  | 
|  | 1020 | target_product_services_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT_SERVICES.txt | 
|  | 1021 | target_product_services_notice_file_xml := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT_SERVICES.xml | 
|  | 1022 | target_product_services_notice_file_xml_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE_PRODUCT_SERVICES.xml.gz | 
|  | 1023 | installed_product_services_notice_xml_gz := $(TARGET_OUT_PRODUCT_SERVICES)/etc/NOTICE.xml.gz | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1024 | endif | 
|  | 1025 |  | 
| Ying Wang | 62c81f8 | 2013-08-22 20:02:03 -0700 | [diff] [blame] | 1026 | ifndef TARGET_BUILD_APPS | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1027 | kernel_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/kernel.txt | 
| Josh Gao | 4d9268e | 2017-02-23 13:17:46 -0800 | [diff] [blame] | 1028 | winpthreads_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/winpthreads.txt | 
| Ying Wang | 4534d81 | 2012-04-09 17:04:12 -0700 | [diff] [blame] | 1029 | 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] | 1030 |  | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1031 | ifdef target_vendor_notice_file_xml_gz | 
| Dario Freni | cbca113 | 2018-08-28 18:04:03 +0100 | [diff] [blame] | 1032 | $(eval $(call combine-notice-files, xml_excluded_extra_partitions, \ | 
| Steve Block | 495e585 | 2012-02-29 19:18:08 +0000 | [diff] [blame] | 1033 | $(target_notice_file_txt), \ | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1034 | $(target_notice_file_html_or_xml), \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1035 | "Notices for files contained in the filesystem images in this directory:", \ | 
|  | 1036 | $(TARGET_OUT_NOTICE_FILES), \ | 
| Ying Wang | 4534d81 | 2012-04-09 17:04:12 -0700 | [diff] [blame] | 1037 | $(ALL_DEFAULT_INSTALLED_MODULES) $(kernel_notice_file) $(pdk_fusion_notice_files))) | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1038 | $(eval $(call combine-notice-files, xml_vendor, \ | 
|  | 1039 | $(target_vendor_notice_file_txt), \ | 
|  | 1040 | $(target_vendor_notice_file_xml), \ | 
|  | 1041 | "Notices for files contained in the vendor filesystem image in this directory:", \ | 
|  | 1042 | $(TARGET_OUT_NOTICE_FILES), \ | 
|  | 1043 | $(target_notice_file_html_or_xml))) | 
| Dario Freni | adc972d | 2018-07-09 18:38:38 +0100 | [diff] [blame] | 1044 | ifdef target_product_notice_file_txt | 
|  | 1045 | $(eval $(call combine-notice-files, xml_product, \ | 
|  | 1046 | $(target_product_notice_file_txt), \ | 
|  | 1047 | $(target_product_notice_file_xml), \ | 
|  | 1048 | "Notices for files contained in the product filesystem image in this directory:", \ | 
|  | 1049 | $(TARGET_OUT_NOTICE_FILES), \ | 
|  | 1050 | $(target_notice_file_html_or_xml))) | 
|  | 1051 | endif | 
| Dario Freni | cbca113 | 2018-08-28 18:04:03 +0100 | [diff] [blame] | 1052 | ifdef target_product_services_notice_file_txt | 
|  | 1053 | $(eval $(call combine-notice-files, xml_product_services, \ | 
|  | 1054 | $(target_product_services_notice_file_txt), \ | 
|  | 1055 | $(target_product_services_notice_file_xml), \ | 
|  | 1056 | "Notices for files contained in the product_services filesystem image in this directory:", \ | 
|  | 1057 | $(TARGET_OUT_NOTICE_FILES), \ | 
|  | 1058 | $(target_notice_file_html_or_xml))) | 
|  | 1059 | endif | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1060 | else | 
|  | 1061 | $(eval $(call combine-notice-files, html, \ | 
|  | 1062 | $(target_notice_file_txt), \ | 
|  | 1063 | $(target_notice_file_html_or_xml), \ | 
|  | 1064 | "Notices for files contained in the filesystem images in this directory:", \ | 
|  | 1065 | $(TARGET_OUT_NOTICE_FILES), \ | 
|  | 1066 | $(ALL_DEFAULT_INSTALLED_MODULES) $(kernel_notice_file) $(pdk_fusion_notice_files))) | 
|  | 1067 | endif | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1068 |  | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1069 | $(eval $(call combine-notice-files, html, \ | 
| Steve Block | 495e585 | 2012-02-29 19:18:08 +0000 | [diff] [blame] | 1070 | $(tools_notice_file_txt), \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1071 | $(tools_notice_file_html), \ | 
|  | 1072 | "Notices for files contained in the tools directory:", \ | 
|  | 1073 | $(HOST_OUT_NOTICE_FILES), \ | 
| Josh Gao | 4d9268e | 2017-02-23 13:17:46 -0800 | [diff] [blame] | 1074 | $(ALL_DEFAULT_INSTALLED_MODULES) \ | 
|  | 1075 | $(winpthreads_notice_file))) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1076 |  | 
|  | 1077 | # Install the html file at /system/etc/NOTICE.html.gz. | 
|  | 1078 | # This is not ideal, but this is very late in the game, after a lot of | 
|  | 1079 | # the module processing has already been done -- in fact, we used the | 
|  | 1080 | # fact that all that has been done to get the list of modules that we | 
|  | 1081 | # need notice files for. | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1082 | $(target_notice_file_html_or_xml_gz): $(target_notice_file_html_or_xml) | $(MINIGZIP) | 
| Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 1083 | $(hide) $(MINIGZIP) -9 < $< > $@ | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1084 | $(installed_notice_html_or_xml_gz): $(target_notice_file_html_or_xml_gz) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1085 | $(copy-file-to-target) | 
| Joe Onorato | 7b2845a | 2009-04-30 13:52:50 -0700 | [diff] [blame] | 1086 |  | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1087 | ifdef target_vendor_notice_file_xml_gz | 
|  | 1088 | # Install the vendor html file at /vendor/etc/NOTICE.xml.gz. | 
|  | 1089 | $(target_vendor_notice_file_xml_gz): $(target_vendor_notice_file_xml) | $(MINIGZIP) | 
|  | 1090 | $(hide) $(MINIGZIP) -9 < $< > $@ | 
|  | 1091 | $(installed_vendor_notice_xml_gz): $(target_vendor_notice_file_xml_gz) | 
|  | 1092 | $(copy-file-to-target) | 
|  | 1093 | endif | 
|  | 1094 |  | 
| Dario Freni | adc972d | 2018-07-09 18:38:38 +0100 | [diff] [blame] | 1095 | ifdef target_product_notice_file_xml_gz | 
|  | 1096 | # Install the product html file at /product/etc/NOTICE.xml.gz. | 
|  | 1097 | $(target_product_notice_file_xml_gz): $(target_product_notice_file_xml) | $(MINIGZIP) | 
|  | 1098 | $(hide) $(MINIGZIP) -9 < $< > $@ | 
|  | 1099 | $(installed_product_notice_xml_gz): $(target_product_notice_file_xml_gz) | 
|  | 1100 | $(copy-file-to-target) | 
|  | 1101 | endif | 
|  | 1102 |  | 
| Dario Freni | cbca113 | 2018-08-28 18:04:03 +0100 | [diff] [blame] | 1103 | ifdef target_product_services_notice_file_xml_gz | 
|  | 1104 | # Install the product html file at /product_services/etc/NOTICE.xml.gz. | 
|  | 1105 | $(target_product_services_notice_file_xml_gz): $(target_product_services_notice_file_xml) | $(MINIGZIP) | 
|  | 1106 | $(hide) $(MINIGZIP) -9 < $< > $@ | 
|  | 1107 | $(installed_product_services_notice_xml_gz): $(target_product_services_notice_file_xml_gz) | 
|  | 1108 | $(copy-file-to-target) | 
|  | 1109 | endif | 
|  | 1110 |  | 
| Joe Onorato | 7b2845a | 2009-04-30 13:52:50 -0700 | [diff] [blame] | 1111 | # if we've been run my mm, mmm, etc, don't reinstall this every time | 
|  | 1112 | ifeq ($(ONE_SHOT_MAKEFILE),) | 
| Jaekyun Seok | 3b7560b | 2017-04-19 15:26:47 +0900 | [diff] [blame] | 1113 | ALL_DEFAULT_INSTALLED_MODULES += $(installed_notice_html_or_xml_gz) | 
|  | 1114 | ifdef target_vendor_notice_file_xml_gz | 
|  | 1115 | ALL_DEFAULT_INSTALLED_MODULES += $(installed_vendor_notice_xml_gz) | 
|  | 1116 | endif | 
| Dario Freni | adc972d | 2018-07-09 18:38:38 +0100 | [diff] [blame] | 1117 | ifdef target_product_notice_file_xml_gz | 
|  | 1118 | ALL_DEFAULT_INSTALLED_MODULES += $(installed_product_notice_xml_gz) | 
|  | 1119 | endif | 
| Dario Freni | cbca113 | 2018-08-28 18:04:03 +0100 | [diff] [blame] | 1120 | ifdef target_product_services_notice_file_xml_gz | 
|  | 1121 | ALL_DEFAULT_INSTALLED_MODULES += $(installed_product_services_notice_xml_gz) | 
|  | 1122 | endif | 
| Joe Onorato | 7b2845a | 2009-04-30 13:52:50 -0700 | [diff] [blame] | 1123 | endif | 
| Ying Wang | 62c81f8 | 2013-08-22 20:02:03 -0700 | [diff] [blame] | 1124 | endif  # TARGET_BUILD_APPS | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1125 |  | 
|  | 1126 | # The kernel isn't really a module, so to get its module file in there, we | 
|  | 1127 | # make the target NOTICE files depend on this particular file too, which will | 
|  | 1128 | # then be in the right directory for the find in combine-notice-files to work. | 
|  | 1129 | $(kernel_notice_file): \ | 
| Lee Campbell | b463fcd | 2015-11-08 16:28:15 -0800 | [diff] [blame] | 1130 | $(BUILD_SYSTEM)/LINUX_KERNEL_COPYING \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1131 | | $(ACP) | 
|  | 1132 | @echo Copying: $@ | 
|  | 1133 | $(hide) mkdir -p $(dir $@) | 
|  | 1134 | $(hide) $(ACP) $< $@ | 
|  | 1135 |  | 
| Josh Gao | 4d9268e | 2017-02-23 13:17:46 -0800 | [diff] [blame] | 1136 | $(winpthreads_notice_file): \ | 
|  | 1137 | $(BUILD_SYSTEM)/WINPTHREADS_COPYING \ | 
|  | 1138 | | $(ACP) | 
|  | 1139 | @echo Copying: $@ | 
|  | 1140 | $(hide) mkdir -p $(dir $@) | 
|  | 1141 | $(hide) $(ACP) $< $@ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1142 |  | 
| Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 1143 | # ----------------------------------------------------------------- | 
|  | 1144 | # Build a keystore with the authorized keys in it, used to verify the | 
|  | 1145 | # authenticity of downloaded OTA packages. | 
|  | 1146 | # | 
|  | 1147 | # This rule adds to ALL_DEFAULT_INSTALLED_MODULES, so it needs to come | 
|  | 1148 | # before the rules that use that variable to build the image. | 
| Dan Willemsen | b589ae4 | 2015-10-29 21:26:18 +0000 | [diff] [blame] | 1149 | ALL_DEFAULT_INSTALLED_MODULES += $(TARGET_OUT_ETC)/security/otacerts.zip | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 1150 | $(TARGET_OUT_ETC)/security/otacerts.zip: KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR) | 
|  | 1151 | $(TARGET_OUT_ETC)/security/otacerts.zip: $(addsuffix .x509.pem,$(DEFAULT_KEY_CERT_PAIR)) | $(ZIPTIME) | 
| Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 1152 | $(hide) rm -f $@ | 
|  | 1153 | $(hide) mkdir -p $(dir $@) | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 1154 | $(hide) zip -qjX $@ $< | 
|  | 1155 | $(remove-timestamps-from-package) | 
| Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 1156 |  | 
| Alex Deymo | cec578c | 2017-03-28 20:48:18 -0700 | [diff] [blame] | 1157 | # Carry the public key for update_engine if it's a non-IoT target that | 
| Tao Bao | 38812d6 | 2016-01-20 20:58:20 -0800 | [diff] [blame] | 1158 | # uses the AB updater. We use the same key as otacerts but in RSA public key | 
|  | 1159 | # format. | 
|  | 1160 | ifeq ($(AB_OTA_UPDATER),true) | 
| Alex Deymo | cec578c | 2017-03-28 20:48:18 -0700 | [diff] [blame] | 1161 | ifneq ($(PRODUCT_IOT),true) | 
| Tao Bao | 23c3db9 | 2016-01-21 14:28:50 -0800 | [diff] [blame] | 1162 | ALL_DEFAULT_INSTALLED_MODULES += $(TARGET_OUT_ETC)/update_engine/update-payload-key.pub.pem | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 1163 | $(TARGET_OUT_ETC)/update_engine/update-payload-key.pub.pem: $(addsuffix .x509.pem,$(DEFAULT_KEY_CERT_PAIR)) | 
| Tao Bao | 38812d6 | 2016-01-20 20:58:20 -0800 | [diff] [blame] | 1164 | $(hide) rm -f $@ | 
|  | 1165 | $(hide) mkdir -p $(dir $@) | 
|  | 1166 | $(hide) openssl x509 -pubkey -noout -in $< > $@ | 
| Alex Deymo | c6ebe9f | 2016-08-03 20:52:54 -0700 | [diff] [blame] | 1167 |  | 
| Tao Bao | 696bb33 | 2018-08-17 16:27:01 -0700 | [diff] [blame] | 1168 | ALL_DEFAULT_INSTALLED_MODULES += \ | 
|  | 1169 | $(TARGET_RECOVERY_ROOT_OUT)/system/etc/update_engine/update-payload-key.pub.pem | 
|  | 1170 | $(TARGET_RECOVERY_ROOT_OUT)/system/etc/update_engine/update-payload-key.pub.pem: \ | 
|  | 1171 | $(TARGET_OUT_ETC)/update_engine/update-payload-key.pub.pem | 
| Alex Deymo | c6ebe9f | 2016-08-03 20:52:54 -0700 | [diff] [blame] | 1172 | $(hide) cp -f $< $@ | 
| Tao Bao | 38812d6 | 2016-01-20 20:58:20 -0800 | [diff] [blame] | 1173 | endif | 
|  | 1174 | endif | 
|  | 1175 |  | 
| Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 1176 | .PHONY: otacerts | 
|  | 1177 | otacerts: $(TARGET_OUT_ETC)/security/otacerts.zip | 
|  | 1178 |  | 
|  | 1179 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1180 | # ################################################################# | 
|  | 1181 | # Targets for user images | 
|  | 1182 | # ################################################################# | 
|  | 1183 |  | 
| Ying Wang | 933abf1 | 2010-06-16 14:31:34 -0700 | [diff] [blame] | 1184 | INTERNAL_USERIMAGES_EXT_VARIANT := | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1185 | ifeq ($(TARGET_USERIMAGES_USE_EXT2),true) | 
| Colin Cross | 0a7b2c5 | 2010-05-07 02:23:59 -0700 | [diff] [blame] | 1186 | INTERNAL_USERIMAGES_USE_EXT := true | 
|  | 1187 | INTERNAL_USERIMAGES_EXT_VARIANT := ext2 | 
|  | 1188 | else | 
|  | 1189 | ifeq ($(TARGET_USERIMAGES_USE_EXT3),true) | 
|  | 1190 | INTERNAL_USERIMAGES_USE_EXT := true | 
|  | 1191 | INTERNAL_USERIMAGES_EXT_VARIANT := ext3 | 
|  | 1192 | else | 
|  | 1193 | ifeq ($(TARGET_USERIMAGES_USE_EXT4),true) | 
|  | 1194 | INTERNAL_USERIMAGES_USE_EXT := true | 
|  | 1195 | INTERNAL_USERIMAGES_EXT_VARIANT := ext4 | 
|  | 1196 | endif | 
|  | 1197 | endif | 
|  | 1198 | endif | 
|  | 1199 |  | 
| JP Abgrall | 6ea5bd6 | 2014-10-22 20:01:22 -0700 | [diff] [blame] | 1200 | # These options tell the recovery updater/installer how to mount the partitions writebale. | 
|  | 1201 | # <fstype>=<fstype_opts>[|<fstype_opts>]... | 
|  | 1202 | # fstype_opts := <opt>[,<opt>]... | 
|  | 1203 | #         opt := <name>[=<value>] | 
| JP Abgrall | 775b1ab | 2014-10-23 16:27:03 -0700 | [diff] [blame] | 1204 | # The following worked on Nexus devices with Kernel 3.1, 3.4, 3.10 | 
|  | 1205 | 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] | 1206 |  | 
| Ying Wang | 542903a | 2010-11-17 15:40:38 -0800 | [diff] [blame] | 1207 | ifneq (true,$(TARGET_USERIMAGES_SPARSE_EXT_DISABLED)) | 
|  | 1208 | INTERNAL_USERIMAGES_SPARSE_EXT_FLAG := -s | 
|  | 1209 | endif | 
|  | 1210 |  | 
| Colin Cross | 0a7b2c5 | 2010-05-07 02:23:59 -0700 | [diff] [blame] | 1211 | ifeq ($(INTERNAL_USERIMAGES_USE_EXT),true) | 
| JP Abgrall | 5bfed5a | 2014-06-16 14:17:40 -0700 | [diff] [blame] | 1212 | INTERNAL_USERIMAGES_DEPS := $(SIMG2IMG) | 
|  | 1213 | INTERNAL_USERIMAGES_DEPS += $(MKEXTUSERIMG) $(MAKE_EXT4FS) $(E2FSCK) | 
|  | 1214 | ifeq ($(TARGET_USERIMAGES_USE_F2FS),true) | 
|  | 1215 | INTERNAL_USERIMAGES_DEPS += $(MKF2FSUSERIMG) $(MAKE_F2FS) | 
|  | 1216 | endif | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1217 | endif | 
| JP Abgrall | 5bfed5a | 2014-06-16 14:17:40 -0700 | [diff] [blame] | 1218 |  | 
| Chris Fries | df0387d | 2017-06-21 15:51:46 -0500 | [diff] [blame] | 1219 | ifeq ($(BOARD_AVB_ENABLE),true) | 
|  | 1220 | INTERNAL_USERIMAGES_DEPS += $(AVBTOOL) | 
|  | 1221 | endif | 
|  | 1222 |  | 
| Todd Poynor | b2a555e | 2015-12-15 18:00:14 -0800 | [diff] [blame] | 1223 | ifneq (true,$(TARGET_USERIMAGES_SPARSE_SQUASHFS_DISABLED)) | 
|  | 1224 | INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG := -s | 
|  | 1225 | endif | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 1226 | ifneq ($(filter $(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE) $(BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE) $(BOARD_ODMIMAGE_FILE_SYSTEM_TYPE) $(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE) $(BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE),squashfs),) | 
| Mohamad Ayyash | 353265b | 2015-06-24 15:42:19 -0700 | [diff] [blame] | 1227 | INTERNAL_USERIMAGES_DEPS += $(MAKE_SQUASHFS) $(MKSQUASHFSUSERIMG) $(IMG2SIMG) | 
| Mohamad Ayyash | 6894695 | 2015-03-03 12:30:37 -0800 | [diff] [blame] | 1228 | endif | 
|  | 1229 |  | 
| Ying Wang | 178ef92 | 2011-10-31 18:13:30 -0700 | [diff] [blame] | 1230 | INTERNAL_USERIMAGES_BINARY_PATHS := $(sort $(dir $(INTERNAL_USERIMAGES_DEPS))) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1231 |  | 
| Colin Cross | 8a30f72 | 2014-04-28 16:27:32 -0700 | [diff] [blame] | 1232 | ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY)) | 
| Tao Bao | b4ec6d7 | 2018-03-15 23:21:28 -0700 | [diff] [blame] | 1233 | INTERNAL_USERIMAGES_DEPS += $(BUILD_VERITY_METADATA) $(BUILD_VERITY_TREE) $(APPEND2SIMG) $(VERITY_SIGNER) | 
| Sami Tolvanen | f99b531 | 2015-05-20 07:30:57 +0100 | [diff] [blame] | 1234 | ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY_FEC)) | 
|  | 1235 | INTERNAL_USERIMAGES_DEPS += $(FEC) | 
|  | 1236 | endif | 
| Geremy Condra | fd6f751 | 2013-06-16 17:26:08 -0700 | [diff] [blame] | 1237 | endif | 
|  | 1238 |  | 
| Alex Klyubin | 092c902 | 2017-03-13 13:28:34 -0700 | [diff] [blame] | 1239 | 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] | 1240 | INTERNAL_USERIMAGES_DEPS += $(SELINUX_FC) | 
|  | 1241 |  | 
| Mohamad Ayyash | f876555 | 2016-03-02 21:07:23 -0800 | [diff] [blame] | 1242 | INTERNAL_USERIMAGES_DEPS += $(BLK_ALLOC_TO_BASE_FS) | 
|  | 1243 |  | 
| Jin Qian | abcec5e | 2017-03-10 16:53:45 -0800 | [diff] [blame] | 1244 | ifeq ($(INTERNAL_USERIMAGES_USE_EXT),true) | 
|  | 1245 | INTERNAL_USERIMAGES_DEPS += $(MKE2FS_CONF) | 
|  | 1246 | endif | 
|  | 1247 |  | 
| Yifan Hong | a42e5f9 | 2018-07-31 13:30:38 -0700 | [diff] [blame] | 1248 | ifeq (true,$(PRODUCT_USE_LOGICAL_PARTITIONS)) | 
| Yifan Hong | bbcba1e | 2018-06-18 16:32:35 -0700 | [diff] [blame] | 1249 |  | 
|  | 1250 | ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true) | 
|  | 1251 | $(error vboot 1.0 doesn't support logical partition) | 
|  | 1252 | endif | 
|  | 1253 |  | 
|  | 1254 | # TODO(b/80195851): Should not define BOARD_AVB_SYSTEM_KEY_PATH without | 
|  | 1255 | # BOARD_AVB_SYSTEM_DETACHED_VBMETA. | 
|  | 1256 |  | 
| Yifan Hong | a42e5f9 | 2018-07-31 13:30:38 -0700 | [diff] [blame] | 1257 | endif # PRODUCT_USE_LOGICAL_PARTITIONS | 
| Yifan Hong | bbcba1e | 2018-06-18 16:32:35 -0700 | [diff] [blame] | 1258 |  | 
| Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 1259 | # $(1): the path of the output dictionary file | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 1260 | # $(2): a subset of "system vendor cache userdata product product_services oem odm" | 
| Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1261 | # $(3): additional "key=value" pairs to append to the dictionary file. | 
|  | 1262 | define generate-image-prop-dictionary | 
| Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1263 | $(if $(filter $(2),system),\ | 
|  | 1264 | $(if $(BOARD_SYSTEMIMAGE_PARTITION_SIZE),$(hide) echo "system_size=$(BOARD_SYSTEMIMAGE_PARTITION_SIZE)" >> $(1)) | 
|  | 1265 | $(if $(BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "system_fs_type=$(BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) | 
|  | 1266 | $(if $(BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT),$(hide) echo "system_extfs_inode_count=$(BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT)" >> $(1)) | 
|  | 1267 | $(if $(BOARD_SYSTEMIMAGE_EXTFS_RSV_PCT),$(hide) echo "system_extfs_rsv_pct=$(BOARD_SYSTEMIMAGE_EXTFS_RSV_PCT)" >> $(1)) | 
|  | 1268 | $(if $(BOARD_SYSTEMIMAGE_JOURNAL_SIZE),$(hide) echo "system_journal_size=$(BOARD_SYSTEMIMAGE_JOURNAL_SIZE)" >> $(1)) | 
|  | 1269 | $(if $(BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "system_squashfs_compressor=$(BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR)" >> $(1)) | 
|  | 1270 | $(if $(BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR_OPT),$(hide) echo "system_squashfs_compressor_opt=$(BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR_OPT)" >> $(1)) | 
|  | 1271 | $(if $(BOARD_SYSTEMIMAGE_SQUASHFS_BLOCK_SIZE),$(hide) echo "system_squashfs_block_size=$(BOARD_SYSTEMIMAGE_SQUASHFS_BLOCK_SIZE)" >> $(1)) | 
|  | 1272 | $(if $(BOARD_SYSTEMIMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "system_squashfs_disable_4k_align=$(BOARD_SYSTEMIMAGE_SQUASHFS_DISABLE_4K_ALIGN)" >> $(1)) | 
|  | 1273 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_BASE_FS_PATH),$(hide) echo "system_base_fs_file=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_BASE_FS_PATH)" >> $(1)) | 
|  | 1274 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_HEADROOM),$(hide) echo "system_headroom=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_HEADROOM)" >> $(1)) | 
| Yifan Hong | bbcba1e | 2018-06-18 16:32:35 -0700 | [diff] [blame] | 1275 | $(if $(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "system_reserved_size=$(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE)" >> $(1)) | 
| Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1276 | ) | 
| Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1277 | $(if $(filter $(2),userdata),\ | 
|  | 1278 | $(if $(BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "userdata_fs_type=$(BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) | 
|  | 1279 | $(if $(BOARD_USERDATAIMAGE_PARTITION_SIZE),$(hide) echo "userdata_size=$(BOARD_USERDATAIMAGE_PARTITION_SIZE)" >> $(1)) | 
|  | 1280 | ) | 
| Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1281 | $(if $(filter $(2),cache),\ | 
|  | 1282 | $(if $(BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "cache_fs_type=$(BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) | 
|  | 1283 | $(if $(BOARD_CACHEIMAGE_PARTITION_SIZE),$(hide) echo "cache_size=$(BOARD_CACHEIMAGE_PARTITION_SIZE)" >> $(1)) | 
|  | 1284 | ) | 
|  | 1285 | $(if $(filter $(2),vendor),\ | 
|  | 1286 | $(if $(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "vendor_fs_type=$(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) | 
|  | 1287 | $(if $(BOARD_VENDORIMAGE_EXTFS_INODE_COUNT),$(hide) echo "vendor_extfs_inode_count=$(BOARD_VENDORIMAGE_EXTFS_INODE_COUNT)" >> $(1)) | 
|  | 1288 | $(if $(BOARD_VENDORIMAGE_EXTFS_RSV_PCT),$(hide) echo "vendor_extfs_rsv_pct=$(BOARD_VENDORIMAGE_EXTFS_RSV_PCT)" >> $(1)) | 
|  | 1289 | $(if $(BOARD_VENDORIMAGE_PARTITION_SIZE),$(hide) echo "vendor_size=$(BOARD_VENDORIMAGE_PARTITION_SIZE)" >> $(1)) | 
|  | 1290 | $(if $(BOARD_VENDORIMAGE_JOURNAL_SIZE),$(hide) echo "vendor_journal_size=$(BOARD_VENDORIMAGE_JOURNAL_SIZE)" >> $(1)) | 
|  | 1291 | $(if $(BOARD_VENDORIMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "vendor_squashfs_compressor=$(BOARD_VENDORIMAGE_SQUASHFS_COMPRESSOR)" >> $(1)) | 
|  | 1292 | $(if $(BOARD_VENDORIMAGE_SQUASHFS_COMPRESSOR_OPT),$(hide) echo "vendor_squashfs_compressor_opt=$(BOARD_VENDORIMAGE_SQUASHFS_COMPRESSOR_OPT)" >> $(1)) | 
|  | 1293 | $(if $(BOARD_VENDORIMAGE_SQUASHFS_BLOCK_SIZE),$(hide) echo "vendor_squashfs_block_size=$(BOARD_VENDORIMAGE_SQUASHFS_BLOCK_SIZE)" >> $(1)) | 
|  | 1294 | $(if $(BOARD_VENDORIMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "vendor_squashfs_disable_4k_align=$(BOARD_VENDORIMAGE_SQUASHFS_DISABLE_4K_ALIGN)" >> $(1)) | 
|  | 1295 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_BASE_FS_PATH),$(hide) echo "vendor_base_fs_file=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_BASE_FS_PATH)" >> $(1)) | 
| Yifan Hong | 749062d | 2018-06-19 16:23:16 -0700 | [diff] [blame] | 1296 | $(if $(BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "vendor_reserved_size=$(BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE)" >> $(1)) | 
| Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1297 | ) | 
|  | 1298 | $(if $(filter $(2),product),\ | 
|  | 1299 | $(if $(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "product_fs_type=$(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) | 
|  | 1300 | $(if $(BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT),$(hide) echo "product_extfs_inode_count=$(BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT)" >> $(1)) | 
|  | 1301 | $(if $(BOARD_PRODUCTIMAGE_EXTFS_RSV_PCT),$(hide) echo "product_extfs_rsv_pct=$(BOARD_PRODUCTIMAGE_EXTFS_RSV_PCT)" >> $(1)) | 
|  | 1302 | $(if $(BOARD_PRODUCTIMAGE_PARTITION_SIZE),$(hide) echo "product_size=$(BOARD_PRODUCTIMAGE_PARTITION_SIZE)" >> $(1)) | 
|  | 1303 | $(if $(BOARD_PRODUCTIMAGE_JOURNAL_SIZE),$(hide) echo "product_journal_size=$(BOARD_PRODUCTIMAGE_JOURNAL_SIZE)" >> $(1)) | 
|  | 1304 | $(if $(BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "product_squashfs_compressor=$(BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR)" >> $(1)) | 
|  | 1305 | $(if $(BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR_OPT),$(hide) echo "product_squashfs_compressor_opt=$(BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR_OPT)" >> $(1)) | 
|  | 1306 | $(if $(BOARD_PRODUCTIMAGE_SQUASHFS_BLOCK_SIZE),$(hide) echo "product_squashfs_block_size=$(BOARD_PRODUCTIMAGE_SQUASHFS_BLOCK_SIZE)" >> $(1)) | 
|  | 1307 | $(if $(BOARD_PRODUCTIMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "product_squashfs_disable_4k_align=$(BOARD_PRODUCTIMAGE_SQUASHFS_DISABLE_4K_ALIGN)" >> $(1)) | 
|  | 1308 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_BASE_FS_PATH),$(hide) echo "product_base_fs_file=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_BASE_FS_PATH)" >> $(1)) | 
| Yifan Hong | 56a6c3b | 2018-07-20 15:19:34 -0700 | [diff] [blame] | 1309 | $(if $(BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "product_reserved_size=$(BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE)" >> $(1)) | 
| Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1310 | ) | 
| Yifan Hong | ebc041a | 2018-07-26 16:02:52 -0700 | [diff] [blame] | 1311 | $(if $(filter $(2),product_services),\ | 
|  | 1312 | $(if $(BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "product_services_fs_type=$(BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) | 
|  | 1313 | $(if $(BOARD_PRODUCT_SERVICESIMAGE_EXTFS_INODE_COUNT),$(hide) echo "product_services_extfs_inode_count=$(BOARD_PRODUCT_SERVICESIMAGE_EXTFS_INODE_COUNT)" >> $(1)) | 
|  | 1314 | $(if $(BOARD_PRODUCT_SERVICESIMAGE_EXTFS_RSV_PCT),$(hide) echo "product_services_extfs_rsv_pct=$(BOARD_PRODUCT_SERVICESIMAGE_EXTFS_RSV_PCT)" >> $(1)) | 
|  | 1315 | $(if $(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE),$(hide) echo "product_services_size=$(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE)" >> $(1)) | 
|  | 1316 | $(if $(BOARD_PRODUCT_SERVICESIMAGE_JOURNAL_SIZE),$(hide) echo "product_services_journal_size=$(BOARD_PRODUCT_SERVICESIMAGE_JOURNAL_SIZE)" >> $(1)) | 
|  | 1317 | $(if $(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "product_services_squashfs_compressor=$(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR)" >> $(1)) | 
|  | 1318 | $(if $(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR_OPT),$(hide) echo "product_services_squashfs_compressor_opt=$(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR_OPT)" >> $(1)) | 
|  | 1319 | $(if $(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_BLOCK_SIZE),$(hide) echo "product_services_squashfs_block_size=$(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_BLOCK_SIZE)" >> $(1)) | 
|  | 1320 | $(if $(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "product_services_squashfs_disable_4k_align=$(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_DISABLE_4K_ALIGN)" >> $(1)) | 
|  | 1321 | $(if $(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "product_services_reserved_size=$(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_RESERVED_SIZE)" >> $(1)) | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 1322 | ) | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 1323 | $(if $(filter $(2),odm),\ | 
|  | 1324 | $(if $(BOARD_ODMIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "odm_fs_type=$(BOARD_ODMIMAGE_FILE_SYSTEM_TYPE)" >> $(1)) | 
|  | 1325 | $(if $(BOARD_ODMIMAGE_EXTFS_INODE_COUNT),$(hide) echo "odm_extfs_inode_count=$(BOARD_ODMIMAGE_EXTFS_INODE_COUNT)" >> $(1)) | 
|  | 1326 | $(if $(BOARD_ODMIMAGE_EXTFS_RSV_PCT),$(hide) echo "odm_extfs_rsv_pct=$(BOARD_ODMIMAGE_EXTFS_RSV_PCT)" >> $(1)) | 
|  | 1327 | $(if $(BOARD_ODMIMAGE_PARTITION_SIZE),$(hide) echo "odm_size=$(BOARD_ODMIMAGE_PARTITION_SIZE)" >> $(1)) | 
|  | 1328 | $(if $(BOARD_ODMIMAGE_JOURNAL_SIZE),$(hide) echo "odm_journal_size=$(BOARD_ODMIMAGE_JOURNAL_SIZE)" >> $(1)) | 
|  | 1329 | $(if $(BOARD_ODMIMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "odm_squashfs_compressor=$(BOARD_ODMIMAGE_SQUASHFS_COMPRESSOR)" >> $(1)) | 
|  | 1330 | $(if $(BOARD_ODMIMAGE_SQUASHFS_COMPRESSOR_OPT),$(hide) echo "odm_squashfs_compressor_opt=$(BOARD_ODMIMAGE_SQUASHFS_COMPRESSOR_OPT)" >> $(1)) | 
|  | 1331 | $(if $(BOARD_ODMIMAGE_SQUASHFS_BLOCK_SIZE),$(hide) echo "odm_squashfs_block_size=$(BOARD_ODMIMAGE_SQUASHFS_BLOCK_SIZE)" >> $(1)) | 
|  | 1332 | $(if $(BOARD_ODMIMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "odm_squashfs_disable_4k_align=$(BOARD_ODMIMAGE_SQUASHFS_DISABLE_4K_ALIGN)" >> $(1)) | 
|  | 1333 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ODM_BASE_FS_PATH),$(hide) echo "odm_base_fs_file=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ODM_BASE_FS_PATH)" >> $(1)) | 
|  | 1334 | $(if $(BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "odm_reserved_size=$(BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE)" >> $(1)) | 
|  | 1335 | ) | 
| Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 1336 | $(if $(filter $(2),oem),\ | 
|  | 1337 | $(if $(BOARD_OEMIMAGE_PARTITION_SIZE),$(hide) echo "oem_size=$(BOARD_OEMIMAGE_PARTITION_SIZE)" >> $(1)) | 
|  | 1338 | $(if $(BOARD_OEMIMAGE_JOURNAL_SIZE),$(hide) echo "oem_journal_size=$(BOARD_OEMIMAGE_JOURNAL_SIZE)" >> $(1)) | 
|  | 1339 | $(if $(BOARD_OEMIMAGE_EXTFS_INODE_COUNT),$(hide) echo "oem_extfs_inode_count=$(BOARD_OEMIMAGE_EXTFS_INODE_COUNT)" >> $(1)) | 
|  | 1340 | $(if $(BOARD_OEMIMAGE_EXTFS_RSV_PCT),$(hide) echo "oem_extfs_rsv_pct=$(BOARD_OEMIMAGE_EXTFS_RSV_PCT)" >> $(1)) | 
|  | 1341 | ) | 
| Tao Bao | 3602eca | 2018-07-10 10:53:55 -0700 | [diff] [blame] | 1342 | $(hide) echo "ext_mkuserimg=$(notdir $(MKEXTUSERIMG))" >> $(1) | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 1343 |  | 
| Tao Bao | 3602eca | 2018-07-10 10:53:55 -0700 | [diff] [blame] | 1344 | $(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] | 1345 | $(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] | 1346 | $(if $(INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG),$(hide) echo "squashfs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG)" >> $(1)) | 
| Tao Bao | 3602eca | 2018-07-10 10:53:55 -0700 | [diff] [blame] | 1347 | $(if $(BOARD_EXT4_SHARE_DUP_BLOCKS),$(hide) echo "ext4_share_dup_blocks=$(BOARD_EXT4_SHARE_DUP_BLOCKS)" >> $(1)) | 
|  | 1348 | $(if $(BOARD_FLASH_LOGICAL_BLOCK_SIZE), $(hide) echo "flash_logical_block_size=$(BOARD_FLASH_LOGICAL_BLOCK_SIZE)" >> $(1)) | 
|  | 1349 | $(if $(BOARD_FLASH_ERASE_BLOCK_SIZE), $(hide) echo "flash_erase_block_size=$(BOARD_FLASH_ERASE_BLOCK_SIZE)" >> $(1)) | 
| Ying Wang | fdbd9cb | 2012-11-21 10:47:00 -0800 | [diff] [blame] | 1350 | $(hide) echo "selinux_fc=$(SELINUX_FC)" >> $(1) | 
| Sami Tolvanen | 8b3f08b | 2015-04-07 15:08:59 +0100 | [diff] [blame] | 1351 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_BOOT_SIGNER),$(hide) echo "boot_signer=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_BOOT_SIGNER)" >> $(1)) | 
| Daniel Rosenberg | f4eabc3 | 2014-07-10 15:42:38 -0700 | [diff] [blame] | 1352 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),$(hide) echo "verity=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY)" >> $(1)) | 
| Paul Lawrence | a37b2bb | 2014-11-13 17:54:30 -0800 | [diff] [blame] | 1353 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),$(hide) echo "verity_key=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY)" >> $(1)) | 
| Claes Elgemark | ec99604 | 2015-06-02 11:03:27 +0200 | [diff] [blame] | 1354 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),$(hide) echo "verity_signer_cmd=$(notdir $(VERITY_SIGNER))" >> $(1)) | 
| Sami Tolvanen | f99b531 | 2015-05-20 07:30:57 +0100 | [diff] [blame] | 1355 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY_FEC),$(hide) echo "verity_fec=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY_FEC)" >> $(1)) | 
| Bowgo Tsai | 6ceeb1a | 2017-10-11 16:21:48 +0800 | [diff] [blame] | 1356 | $(if $(filter eng, $(TARGET_BUILD_VARIANT)),$(hide) echo "verity_disable=true" >> $(1)) | 
| Daniel Rosenberg | f4eabc3 | 2014-07-10 15:42:38 -0700 | [diff] [blame] | 1357 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_VERITY_PARTITION),$(hide) echo "system_verity_block_device=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_VERITY_PARTITION)" >> $(1)) | 
|  | 1358 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_VERITY_PARTITION),$(hide) echo "vendor_verity_block_device=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_VERITY_PARTITION)" >> $(1)) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 1359 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_VERITY_PARTITION),$(hide) echo "product_verity_block_device=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_VERITY_PARTITION)" >> $(1)) | 
| Yifan Hong | ebc041a | 2018-07-26 16:02:52 -0700 | [diff] [blame] | 1360 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_SERVICES_VERITY_PARTITION),$(hide) echo "product_services_verity_block_device=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_SERVICES_VERITY_PARTITION)" >> $(1)) | 
| Tao Bao | d95e9fd | 2015-03-29 23:07:41 -0700 | [diff] [blame] | 1361 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT),$(hide) echo "vboot=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT)" >> $(1)) | 
|  | 1362 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT),$(hide) echo "vboot_key=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VBOOT_SIGNING_KEY)" >> $(1)) | 
| Furquan Shaikh | e8c2122 | 2015-08-07 11:58:05 -0700 | [diff] [blame] | 1363 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT),$(hide) echo "vboot_subkey=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VBOOT_SIGNING_SUBKEY)" >> $(1)) | 
| Tao Bao | 9b524ef | 2017-02-23 11:03:45 -0800 | [diff] [blame] | 1364 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT),$(hide) echo "futility=$(notdir $(FUTILITY))" >> $(1)) | 
| Tao Bao | d95e9fd | 2015-03-29 23:07:41 -0700 | [diff] [blame] | 1365 | $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT),$(hide) echo "vboot_signer_cmd=$(VBOOT_SIGNER)" >> $(1)) | 
| Tao Bao | 3cba374 | 2017-05-16 16:27:25 -0700 | [diff] [blame] | 1366 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_avbtool=$(notdir $(AVBTOOL))" >> $(1)) | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 1367 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_system_hashtree_enable=$(BOARD_AVB_ENABLE)" >> $(1)) | 
|  | 1368 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_system_add_hashtree_footer_args=$(BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS)" >> $(1)) | 
|  | 1369 | $(if $(BOARD_AVB_ENABLE),\ | 
|  | 1370 | $(if $(BOARD_AVB_SYSTEM_KEY_PATH),\ | 
|  | 1371 | $(hide) echo "avb_system_key_path=$(BOARD_AVB_SYSTEM_KEY_PATH)" >> $(1) | 
|  | 1372 | $(hide) echo "avb_system_algorithm=$(BOARD_AVB_SYSTEM_ALGORITHM)" >> $(1) | 
|  | 1373 | $(hide) echo "avb_system_rollback_index_location=$(BOARD_AVB_SYSTEM_ROLLBACK_INDEX_LOCATION)" >> $(1))) | 
|  | 1374 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_vendor_hashtree_enable=$(BOARD_AVB_ENABLE)" >> $(1)) | 
|  | 1375 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_vendor_add_hashtree_footer_args=$(BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS)" >> $(1)) | 
|  | 1376 | $(if $(BOARD_AVB_ENABLE),\ | 
|  | 1377 | $(if $(BOARD_AVB_VENDOR_KEY_PATH),\ | 
|  | 1378 | $(hide) echo "avb_vendor_key_path=$(BOARD_AVB_VENDOR_KEY_PATH)" >> $(1) | 
|  | 1379 | $(hide) echo "avb_vendor_algorithm=$(BOARD_AVB_VENDOR_ALGORITHM)" >> $(1) | 
|  | 1380 | $(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] | 1381 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_product_hashtree_enable=$(BOARD_AVB_ENABLE)" >> $(1)) | 
|  | 1382 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_product_add_hashtree_footer_args=$(BOARD_AVB_PRODUCT_ADD_HASHTREE_FOOTER_ARGS)" >> $(1)) | 
|  | 1383 | $(if $(BOARD_AVB_ENABLE),\ | 
|  | 1384 | $(if $(BOARD_AVB_PRODUCT_KEY_PATH),\ | 
|  | 1385 | $(hide) echo "avb_product_key_path=$(BOARD_AVB_PRODUCT_KEY_PATH)" >> $(1) | 
|  | 1386 | $(hide) echo "avb_product_algorithm=$(BOARD_AVB_PRODUCT_ALGORITHM)" >> $(1) | 
|  | 1387 | $(hide) echo "avb_product_rollback_index_location=$(BOARD_AVB_PRODUCT_ROLLBACK_INDEX_LOCATION)" >> $(1))) | 
| Tao Bao | 1ebda8d | 2018-08-01 17:21:14 -0700 | [diff] [blame] | 1388 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_product_services_hashtree_enable=$(BOARD_AVB_ENABLE)" >> $(1)) | 
|  | 1389 | $(if $(BOARD_AVB_ENABLE),\ | 
|  | 1390 | $(hide) echo "avb_product_services_add_hashtree_footer_args=$(BOARD_AVB_PRODUCT_SERVICES_ADD_HASHTREE_FOOTER_ARGS)" >> $(1)) | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 1391 | $(if $(BOARD_AVB_ENABLE),\ | 
|  | 1392 | $(if $(BOARD_AVB_PRODUCT_SERVICES_KEY_PATH),\ | 
| Yifan Hong | ebc041a | 2018-07-26 16:02:52 -0700 | [diff] [blame] | 1393 | $(hide) echo "avb_product_services_key_path=$(BOARD_AVB_PRODUCT_SERVICES_KEY_PATH)" >> $(1) | 
|  | 1394 | $(hide) echo "avb_product_services_algorithm=$(BOARD_AVB_PRODUCT_SERVICES_ALGORITHM)" >> $(1) | 
|  | 1395 | $(hide) echo "avb_product_services_rollback_index_location=$(BOARD_AVB_PRODUCT_SERVICES_ROLLBACK_INDEX_LOCATION)" >> $(1))) | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 1396 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_odm_hashtree_enable=$(BOARD_AVB_ENABLE)" >> $(1)) | 
|  | 1397 | $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_odm_add_hashtree_footer_args=$(BOARD_AVB_ODM_ADD_HASHTREE_FOOTER_ARGS)" >> $(1)) | 
|  | 1398 | $(if $(BOARD_AVB_ENABLE),\ | 
|  | 1399 | $(if $(BOARD_AVB_ODM_KEY_PATH),\ | 
|  | 1400 | $(hide) echo "avb_odm_key_path=$(BOARD_AVB_ODM_KEY_PATH)" >> $(1) | 
|  | 1401 | $(hide) echo "avb_odm_algorithm=$(BOARD_AVB_ODM_ALGORITHM)" >> $(1) | 
|  | 1402 | $(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] | 1403 | $(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)),\ | 
|  | 1404 | $(hide) echo "recovery_as_boot=true" >> $(1)) | 
| Ying Wang | 0eabd4f | 2015-03-24 19:07:40 -0700 | [diff] [blame] | 1405 | $(if $(filter true,$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)),\ | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1406 | $(hide) echo "system_root_image=true" >> $(1)) | 
|  | 1407 | $(hide) echo "root_dir=$(TARGET_ROOT_OUT)" >> $(1) | 
| Yifan Hong | 2dae572 | 2018-07-31 12:47:27 -0700 | [diff] [blame] | 1408 | $(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] | 1409 | $(if $(3),$(hide) $(foreach kv,$(3),echo "$(kv)" >> $(1);)) | 
|  | 1410 | endef | 
|  | 1411 |  | 
|  | 1412 | # $(1): the path of the output dictionary file | 
|  | 1413 | # $(2): additional "key=value" pairs to append to the dictionary file. | 
|  | 1414 | define generate-userimage-prop-dictionary | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 1415 | $(call generate-image-prop-dictionary,$(1),system vendor cache userdata product product_services oem odm,$(2)) | 
| Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 1416 | endef | 
|  | 1417 |  | 
| Yifan Hong | bbcba1e | 2018-06-18 16:32:35 -0700 | [diff] [blame] | 1418 | # $(1): the path of the input dictionary file, where each line has the format key=value | 
|  | 1419 | # $(2): the key to look up | 
|  | 1420 | define read-image-prop-dictionary | 
|  | 1421 | $$(grep '$(2)=' $(1) | cut -f2- -d'=') | 
|  | 1422 | endef | 
|  | 1423 |  | 
| Xu Chao | 2b04bf4 | 2017-07-06 14:34:31 +0800 | [diff] [blame] | 1424 | # $(1): modules list | 
|  | 1425 | # $(2): output dir | 
|  | 1426 | # $(3): mount point | 
|  | 1427 | # $(4): staging dir | 
|  | 1428 | # Depmod requires a well-formed kernel version so 0.0 is used as a placeholder. | 
|  | 1429 | define build-image-kernel-modules | 
|  | 1430 | $(hide) rm -rf $(2)/lib/modules | 
|  | 1431 | $(hide) mkdir -p $(2)/lib/modules | 
|  | 1432 | $(hide) cp $(1) $(2)/lib/modules/ | 
|  | 1433 | $(hide) rm -rf $(4) | 
|  | 1434 | $(hide) mkdir -p $(4)/lib/modules/0.0/$(3)lib/modules | 
|  | 1435 | $(hide) cp $(1) $(4)/lib/modules/0.0/$(3)lib/modules | 
|  | 1436 | $(hide) $(DEPMOD) -b $(4) 0.0 | 
|  | 1437 | $(hide) sed -e 's/\(.*modules.*\):/\/\1:/g' -e 's/ \([^ ]*modules[^ ]*\)/ \/\1/g' $(4)/lib/modules/0.0/modules.dep > $(2)/lib/modules/modules.dep | 
|  | 1438 | $(hide) cp $(4)/lib/modules/0.0/modules.alias $(2)/lib/modules | 
|  | 1439 | endef | 
|  | 1440 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1441 | # ----------------------------------------------------------------- | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1442 | # Recovery image | 
| Doug Zongker | 8cebf1f | 2009-07-07 17:14:25 -0700 | [diff] [blame] | 1443 |  | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 1444 | # Recovery image exists if we are building recovery, or building recovery as boot. | 
|  | 1445 | ifneq (,$(INSTALLED_RECOVERYIMAGE_TARGET)$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT))) | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1446 |  | 
| Ying Wang | 3752614 | 2015-03-10 12:02:57 -0700 | [diff] [blame] | 1447 | INTERNAL_RECOVERYIMAGE_FILES := $(filter $(TARGET_RECOVERY_OUT)/%, \ | 
|  | 1448 | $(ALL_DEFAULT_INSTALLED_MODULES)) | 
|  | 1449 |  | 
| Tao Bao | 10fc949 | 2018-08-14 12:17:48 -0700 | [diff] [blame] | 1450 | INSTALLED_FILES_FILE_RECOVERY := $(PRODUCT_OUT)/installed-files-recovery.txt | 
|  | 1451 | INSTALLED_FILES_JSON_RECOVERY := $(INSTALLED_FILES_FILE_RECOVERY:.txt=.json) | 
|  | 1452 |  | 
|  | 1453 | # TODO(b/30414428): Can't depend on INTERNAL_RECOVERYIMAGE_FILES alone like other | 
|  | 1454 | # INSTALLED_FILES_FILE_* rules. Because currently there're cp/rsync/rm commands in | 
|  | 1455 | # build-recoveryimage-target, which would touch the files under TARGET_RECOVERY_OUT and race with | 
|  | 1456 | # the call to FILELIST. | 
|  | 1457 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) | 
|  | 1458 | $(INSTALLED_FILES_FILE_RECOVERY): $(INSTALLED_BOOTIMAGE_TARGET) | 
|  | 1459 | else | 
|  | 1460 | $(INSTALLED_FILES_FILE_RECOVERY): $(INSTALLED_RECOVERYIMAGE_TARGET) | 
|  | 1461 | endif | 
|  | 1462 |  | 
|  | 1463 | $(INSTALLED_FILES_FILE_RECOVERY): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_RECOVERY) | 
|  | 1464 | $(INSTALLED_FILES_FILE_RECOVERY): $(INTERNAL_RECOVERYIMAGE_FILES) $(FILESLIST) | 
|  | 1465 | @echo Installed file list: $@ | 
|  | 1466 | @mkdir -p $(dir $@) | 
|  | 1467 | @rm -f $@ | 
|  | 1468 | $(hide) $(FILESLIST) $(TARGET_RECOVERY_ROOT_OUT) > $(@:.txt=.json) | 
|  | 1469 | $(hide) build/make/tools/fileslist_util.py -c $(@:.txt=.json) > $@ | 
|  | 1470 |  | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1471 | recovery_initrc := $(call include-path-for, recovery)/etc/init.rc | 
| Alex Klyubin | 2a7171a | 2017-03-10 12:53:02 -0800 | [diff] [blame] | 1472 | recovery_sepolicy := \ | 
|  | 1473 | $(TARGET_RECOVERY_ROOT_OUT)/sepolicy \ | 
| Jeff Vander Stoep | 4ff042c | 2017-06-13 08:30:46 -0700 | [diff] [blame] | 1474 | $(TARGET_RECOVERY_ROOT_OUT)/plat_file_contexts \ | 
| Bowgo Tsai | 09f88a6 | 2018-02-05 17:32:20 +0800 | [diff] [blame] | 1475 | $(TARGET_RECOVERY_ROOT_OUT)/vendor_file_contexts \ | 
| Alex Klyubin | 2a7171a | 2017-03-10 12:53:02 -0800 | [diff] [blame] | 1476 | $(TARGET_RECOVERY_ROOT_OUT)/plat_property_contexts \ | 
| Bowgo Tsai | 09f88a6 | 2018-02-05 17:32:20 +0800 | [diff] [blame] | 1477 | $(TARGET_RECOVERY_ROOT_OUT)/vendor_property_contexts | 
|  | 1478 |  | 
| Bowgo Tsai | 9967125 | 2017-11-30 22:15:17 +0800 | [diff] [blame] | 1479 | ifdef BOARD_ODM_SEPOLICY_DIRS | 
|  | 1480 | recovery_sepolicy += \ | 
|  | 1481 | $(TARGET_RECOVERY_ROOT_OUT)/odm_file_contexts \ | 
|  | 1482 | $(TARGET_RECOVERY_ROOT_OUT)/odm_property_contexts | 
|  | 1483 | endif | 
|  | 1484 |  | 
| Alex Klyubin | 2a7171a | 2017-03-10 12:53:02 -0800 | [diff] [blame] | 1485 | # Passed into rsync from non-recovery root to recovery root, to avoid overwriting recovery-specific | 
|  | 1486 | # SELinux files | 
|  | 1487 | IGNORE_RECOVERY_SEPOLICY := $(patsubst $(TARGET_RECOVERY_OUT)/%,--exclude=/%,$(recovery_sepolicy)) | 
|  | 1488 |  | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1489 | recovery_kernel := $(INSTALLED_KERNEL_TARGET) # same as a non-recovery system | 
|  | 1490 | recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1491 | recovery_resources_common := $(call include-path-for, recovery)/res | 
| Doug Zongker | e129732 | 2013-03-06 15:04:31 -0800 | [diff] [blame] | 1492 |  | 
| Tao Bao | e1e829e | 2018-08-29 20:36:00 -0700 | [diff] [blame] | 1493 | # Set recovery_density to a density bucket based on PRODUCT_AAPT_PREF_CONFIG if set. Otherwise use | 
|  | 1494 | # the default medium density. | 
| Doug Zongker | 8eaeea9 | 2014-05-12 15:32:20 -0700 | [diff] [blame] | 1495 | ifneq (,$(PRODUCT_AAPT_PREF_CONFIG)) | 
| Tao Bao | e1e829e | 2018-08-29 20:36:00 -0700 | [diff] [blame] | 1496 | # If PRODUCT_AAPT_PREF_CONFIG includes a non-numeric dpi bucket, always perfer that value. | 
| Doug Zongker | 8eaeea9 | 2014-05-12 15:32:20 -0700 | [diff] [blame] | 1497 | recovery_density := $(filter %dpi,$(PRODUCT_AAPT_PREF_CONFIG)) | 
| Tao Bao | e1e829e | 2018-08-29 20:36:00 -0700 | [diff] [blame] | 1498 | ifeq (,$(filter xxxhdpi xxhdpi xhdpi hdpi mdpi,$(recovery_density))) | 
|  | 1499 | recovery_density_value := $(patsubst %dpi,%,$(recovery_density)) | 
|  | 1500 | # Map the numeric dpi value to a bucket. We roughly use the medium point between the primary | 
|  | 1501 | # densities to split buckets. | 
|  | 1502 | # ------160------240------320----------480------------640------ | 
|  | 1503 | #       mdpi     hdpi    xhdpi        xxhdpi        xxxhdpi | 
|  | 1504 | recovery_density := $(strip \ | 
|  | 1505 | $(or $(if $(filter $(shell echo $$(($(recovery_density_value) >= 560))),1),xxxhdpi),\ | 
|  | 1506 | $(if $(filter $(shell echo $$(($(recovery_density_value) >= 400))),1),xxhdpi),\ | 
|  | 1507 | $(if $(filter $(shell echo $$(($(recovery_density_value) >= 280))),1),xhdpi),\ | 
|  | 1508 | $(if $(filter $(shell echo $$(($(recovery_density_value) >= 200))),1),hdpi,mdpi))) | 
| Doug Zongker | 8eaeea9 | 2014-05-12 15:32:20 -0700 | [diff] [blame] | 1509 | endif | 
| Tao Bao | e1e829e | 2018-08-29 20:36:00 -0700 | [diff] [blame] | 1510 | else # PRODUCT_AAPT_PREF_CONFIG is empty | 
|  | 1511 | recovery_density := mdpi | 
|  | 1512 | endif # PRODUCT_AAPT_PREF_CONFIG | 
| Doug Zongker | 8eaeea9 | 2014-05-12 15:32:20 -0700 | [diff] [blame] | 1513 |  | 
|  | 1514 | ifneq (,$(wildcard $(recovery_resources_common)-$(recovery_density))) | 
|  | 1515 | recovery_resources_common := $(recovery_resources_common)-$(recovery_density) | 
|  | 1516 | else | 
| Doug Zongker | 25d55f8 | 2014-04-04 13:51:15 -0700 | [diff] [blame] | 1517 | recovery_resources_common := $(recovery_resources_common)-xhdpi | 
|  | 1518 | endif | 
|  | 1519 |  | 
| Tao Bao | e1e829e | 2018-08-29 20:36:00 -0700 | [diff] [blame] | 1520 | # Select the 18x32 font on high-density devices (xhdpi and up); and the 12x22 font on other devices. | 
|  | 1521 | # Note that the font selected here can be overridden for a particular device by putting a font.png | 
|  | 1522 | # in its private recovery resources. | 
|  | 1523 | ifneq (,$(filter xxxhdpi xxhdpi xhdpi,$(recovery_density))) | 
| Doug Zongker | e129732 | 2013-03-06 15:04:31 -0800 | [diff] [blame] | 1524 | recovery_font := $(call include-path-for, recovery)/fonts/18x32.png | 
|  | 1525 | else | 
|  | 1526 | recovery_font := $(call include-path-for, recovery)/fonts/12x22.png | 
|  | 1527 | endif | 
|  | 1528 |  | 
| Ying Wang | 9a17568 | 2015-08-06 11:47:47 -0700 | [diff] [blame] | 1529 | ifndef TARGET_PRIVATE_RES_DIRS | 
|  | 1530 | TARGET_PRIVATE_RES_DIRS := $(wildcard $(TARGET_DEVICE_DIR)/recovery/res) | 
|  | 1531 | endif | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1532 | recovery_resource_deps := $(shell find $(recovery_resources_common) \ | 
| Ying Wang | 9a17568 | 2015-08-06 11:47:47 -0700 | [diff] [blame] | 1533 | $(TARGET_PRIVATE_RES_DIRS) -type f) | 
| Andrew Boie | fa61ff0 | 2012-09-28 09:33:45 -0700 | [diff] [blame] | 1534 | ifdef TARGET_RECOVERY_FSTAB | 
|  | 1535 | recovery_fstab := $(TARGET_RECOVERY_FSTAB) | 
|  | 1536 | else | 
| Doug Zongker | 9ce0fb6 | 2010-09-20 18:04:41 -0700 | [diff] [blame] | 1537 | recovery_fstab := $(strip $(wildcard $(TARGET_DEVICE_DIR)/recovery.fstab)) | 
| Andrew Boie | fa61ff0 | 2012-09-28 09:33:45 -0700 | [diff] [blame] | 1538 | endif | 
| Tao Bao | c3c1753 | 2016-06-10 10:11:54 -0700 | [diff] [blame] | 1539 | ifdef TARGET_RECOVERY_WIPE | 
|  | 1540 | recovery_wipe := $(TARGET_RECOVERY_WIPE) | 
| Tao Bao | 3051f4f | 2016-05-31 23:56:23 -0700 | [diff] [blame] | 1541 | else | 
| Tao Bao | c3c1753 | 2016-06-10 10:11:54 -0700 | [diff] [blame] | 1542 | recovery_wipe := | 
| Tao Bao | 3051f4f | 2016-05-31 23:56:23 -0700 | [diff] [blame] | 1543 | endif | 
| Tao Bao | 8beab69 | 2015-07-22 12:33:18 -0700 | [diff] [blame] | 1544 |  | 
| Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 1545 | # Traditionally with non-A/B OTA we have: | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 1546 | #   boot.img + recovery-from-boot.p + recovery-resource.dat = recovery.img. | 
| Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 1547 | # recovery-resource.dat is needed only if we carry an imgdiff patch of the boot and recovery images | 
|  | 1548 | # 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] | 1549 | # | 
|  | 1550 | # We no longer need that if one of the following conditions holds: | 
| Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 1551 | #   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] | 1552 | #      (BOARD_USES_FULL_RECOVERY_IMAGE = true); | 
| Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 1553 | #   b) We build a single image that contains boot and recovery both - no recovery image to install | 
|  | 1554 | #      (BOARD_USES_RECOVERY_AS_BOOT = true); | 
|  | 1555 | #   c) We build the root into system image - not needing the resource file as we do bsdiff | 
|  | 1556 | #      (BOARD_BUILD_SYSTEM_ROOT_IMAGE = true). | 
| Hridya Valsaraju | e74a38b | 2018-03-21 12:15:11 -0700 | [diff] [blame] | 1557 | #   d) We include the recovery DTBO image within recovery - not needing the resource file as we | 
|  | 1558 | #      do bsdiff because boot and recovery will contain different number of entries | 
|  | 1559 | #      (BOARD_INCLUDE_RECOVERY_DTBO = true). | 
| Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 1560 | # Note that condition b) implies condition c), because of the earlier check in this file: | 
|  | 1561 | # "BOARD_USES_RECOVERY_AS_BOOT = true must have BOARD_BUILD_SYSTEM_ROOT_IMAGE = true" (not vice | 
|  | 1562 | # versa though). | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 1563 |  | 
| Hridya Valsaraju | e74a38b | 2018-03-21 12:15:11 -0700 | [diff] [blame] | 1564 | ifeq (,$(filter true, $(BOARD_USES_FULL_RECOVERY_IMAGE) $(BOARD_BUILD_SYSTEM_ROOT_IMAGE) \ | 
|  | 1565 | $(BOARD_INCLUDE_RECOVERY_DTBO))) | 
| Doug Zongker | 5658887 | 2012-08-20 15:38:58 -0700 | [diff] [blame] | 1566 | # Named '.dat' so we don't attempt to use imgdiff for patching it. | 
|  | 1567 | RECOVERY_RESOURCE_ZIP := $(TARGET_OUT)/etc/recovery-resource.dat | 
| Tao Bao | 8beab69 | 2015-07-22 12:33:18 -0700 | [diff] [blame] | 1568 | else | 
| Tao Bao | 8beab69 | 2015-07-22 12:33:18 -0700 | [diff] [blame] | 1569 | RECOVERY_RESOURCE_ZIP := | 
|  | 1570 | endif | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1571 |  | 
| Tao Bao | 139c727 | 2018-07-31 13:26:54 -0700 | [diff] [blame] | 1572 | INSTALLED_RECOVERY_BUILD_PROP_TARGET := $(TARGET_RECOVERY_ROOT_OUT)/prop.default | 
|  | 1573 |  | 
|  | 1574 | $(INSTALLED_RECOVERY_BUILD_PROP_TARGET): PRIVATE_RECOVERY_UI_PROPERTIES := \ | 
| Tao Bao | 139c727 | 2018-07-31 13:26:54 -0700 | [diff] [blame] | 1575 | TARGET_RECOVERY_UI_ANIMATION_FPS:animation_fps \ | 
|  | 1576 | TARGET_RECOVERY_UI_MARGIN_HEIGHT:margin_height \ | 
|  | 1577 | TARGET_RECOVERY_UI_MARGIN_WIDTH:margin_width \ | 
|  | 1578 | TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS:menu_unusable_rows \ | 
|  | 1579 | TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE:progress_bar_baseline \ | 
|  | 1580 | TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD:touch_low_threshold \ | 
|  | 1581 | TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD:touch_high_threshold \ | 
|  | 1582 | TARGET_RECOVERY_UI_VR_STEREO_OFFSET:vr_stereo_offset | 
|  | 1583 |  | 
|  | 1584 | # Parses the given list of build variables and writes their values as build properties if defined. | 
|  | 1585 | # For example, if a target defines `TARGET_RECOVERY_UI_MARGIN_HEIGHT := 100`, | 
|  | 1586 | # `ro.recovery.ui.margin_height=100` will be appended to the given output file. | 
|  | 1587 | # $(1): Map from the build variable names to property names | 
|  | 1588 | # $(2): Output file | 
|  | 1589 | define append-recovery-ui-properties | 
|  | 1590 | echo "#" >> $(2) | 
|  | 1591 | echo "# RECOVERY UI BUILD PROPERTIES" >> $(2) | 
|  | 1592 | echo "#" >> $(2) | 
|  | 1593 | $(foreach prop,$(1), \ | 
|  | 1594 | $(eval _varname := $(call word-colon,1,$(prop))) \ | 
|  | 1595 | $(eval _propname := $(call word-colon,2,$(prop))) \ | 
|  | 1596 | $(eval _value := $($(_varname))) \ | 
|  | 1597 | $(if $(_value), \ | 
|  | 1598 | echo ro.recovery.ui.$(_propname)=$(_value) >> $(2) &&)) true | 
|  | 1599 | endef | 
|  | 1600 |  | 
|  | 1601 | $(INSTALLED_RECOVERY_BUILD_PROP_TARGET): \ | 
|  | 1602 | $(INSTALLED_DEFAULT_PROP_TARGET) \ | 
|  | 1603 | $(INSTALLED_VENDOR_DEFAULT_PROP_TARGET) \ | 
| Tao Bao | 6eb1a99 | 2018-08-06 07:33:45 -0700 | [diff] [blame] | 1604 | $(intermediate_system_build_prop) \ | 
| Tao Bao | 139c727 | 2018-07-31 13:26:54 -0700 | [diff] [blame] | 1605 | $(INSTALLED_VENDOR_BUILD_PROP_TARGET) \ | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 1606 | $(INSTALLED_ODM_BUILD_PROP_TARGET) \ | 
| Tao Bao | 139c727 | 2018-07-31 13:26:54 -0700 | [diff] [blame] | 1607 | $(INSTALLED_PRODUCT_BUILD_PROP_TARGET) \ | 
|  | 1608 | $(INSTALLED_PRODUCT_SERVICES_BUILD_PROP_TARGET) | 
|  | 1609 | @echo "Target recovery buildinfo: $@ | 
|  | 1610 | $(hide) mkdir -p $(dir $@) | 
|  | 1611 | $(hide) rm -f $@ | 
|  | 1612 | $(hide) cat $(INSTALLED_DEFAULT_PROP_TARGET) > $@ | 
|  | 1613 | $(hide) cat $(INSTALLED_VENDOR_DEFAULT_PROP_TARGET) >> $@ | 
| Tao Bao | 6eb1a99 | 2018-08-06 07:33:45 -0700 | [diff] [blame] | 1614 | $(hide) cat $(intermediate_system_build_prop) >> $@ | 
| Tao Bao | 139c727 | 2018-07-31 13:26:54 -0700 | [diff] [blame] | 1615 | $(hide) cat $(INSTALLED_VENDOR_BUILD_PROP_TARGET) >> $@ | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 1616 | $(hide) cat $(INSTALLED_ODM_BUILD_PROP_TARGET) >> $@ | 
| Tao Bao | 139c727 | 2018-07-31 13:26:54 -0700 | [diff] [blame] | 1617 | $(hide) cat $(INSTALLED_PRODUCT_BUILD_PROP_TARGET) >> $@ | 
|  | 1618 | $(hide) cat $(INSTALLED_PRODUCT_SERVICES_BUILD_PROP_TARGET) >> $@ | 
|  | 1619 | $(call append-recovery-ui-properties,$(PRIVATE_RECOVERY_UI_PROPERTIES),$@) | 
|  | 1620 |  | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1621 | INTERNAL_RECOVERYIMAGE_ARGS := \ | 
|  | 1622 | $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \ | 
|  | 1623 | --kernel $(recovery_kernel) \ | 
|  | 1624 | --ramdisk $(recovery_ramdisk) | 
|  | 1625 |  | 
|  | 1626 | # Assumes this has already been stripped | 
| Dan Willemsen | c1f17ff | 2016-10-05 16:57:27 -0700 | [diff] [blame] | 1627 | ifdef INTERNAL_KERNEL_CMDLINE | 
|  | 1628 | INTERNAL_RECOVERYIMAGE_ARGS += --cmdline "$(INTERNAL_KERNEL_CMDLINE)" | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1629 | endif | 
|  | 1630 | ifdef BOARD_KERNEL_BASE | 
|  | 1631 | INTERNAL_RECOVERYIMAGE_ARGS += --base $(BOARD_KERNEL_BASE) | 
|  | 1632 | endif | 
| Ying Wang | 4de6b5b | 2010-08-25 14:29:34 -0700 | [diff] [blame] | 1633 | ifdef BOARD_KERNEL_PAGESIZE | 
|  | 1634 | INTERNAL_RECOVERYIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE) | 
|  | 1635 | endif | 
| Hridya Valsaraju | e74a38b | 2018-03-21 12:15:11 -0700 | [diff] [blame] | 1636 | ifdef BOARD_INCLUDE_RECOVERY_DTBO | 
|  | 1637 | INTERNAL_RECOVERYIMAGE_ARGS += --recovery_dtbo $(BOARD_PREBUILT_DTBOIMAGE) | 
|  | 1638 | endif | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1639 |  | 
|  | 1640 | # Keys authorized to sign OTA packages this build will accept.  The | 
| Ying Wang | 3c21fe5 | 2011-10-04 10:50:08 -0700 | [diff] [blame] | 1641 | # build always uses dev-keys for this; release packaging tools will | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1642 | # substitute other keys for this one. | 
| Ying Wang | 3c21fe5 | 2011-10-04 10:50:08 -0700 | [diff] [blame] | 1643 | OTA_PUBLIC_KEYS := $(DEFAULT_SYSTEM_DEV_CERTIFICATE).x509.pem | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1644 |  | 
|  | 1645 | # Generate a file containing the keys that will be read by the | 
|  | 1646 | # recovery binary. | 
|  | 1647 | RECOVERY_INSTALL_OTA_KEYS := \ | 
|  | 1648 | $(call intermediates-dir-for,PACKAGING,ota_keys)/keys | 
|  | 1649 | DUMPKEY_JAR := $(HOST_OUT_JAVA_LIBRARIES)/dumpkey.jar | 
|  | 1650 | $(RECOVERY_INSTALL_OTA_KEYS): PRIVATE_OTA_PUBLIC_KEYS := $(OTA_PUBLIC_KEYS) | 
| Doug Zongker | 5d4808d | 2011-03-16 07:49:13 -0700 | [diff] [blame] | 1651 | $(RECOVERY_INSTALL_OTA_KEYS): extra_keys := $(patsubst %,%.x509.pem,$(PRODUCT_EXTRA_RECOVERY_KEYS)) | 
| Doug Zongker | e121d6a | 2011-02-01 14:13:52 -0800 | [diff] [blame] | 1652 | $(RECOVERY_INSTALL_OTA_KEYS): $(OTA_PUBLIC_KEYS) $(DUMPKEY_JAR) $(extra_keys) | 
|  | 1653 | @echo "DumpPublicKey: $@ <= $(PRIVATE_OTA_PUBLIC_KEYS) $(extra_keys)" | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1654 | @rm -rf $@ | 
|  | 1655 | @mkdir -p $(dir $@) | 
| Colin Cross | 0851df8 | 2017-06-30 13:55:38 -0700 | [diff] [blame] | 1656 | $(JAVA) -jar $(DUMPKEY_JAR) $(PRIVATE_OTA_PUBLIC_KEYS) $(extra_keys) > $@ | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1657 |  | 
| Andres Morales | b8876e1 | 2015-05-06 20:44:22 -0700 | [diff] [blame] | 1658 | RECOVERYIMAGE_ID_FILE := $(PRODUCT_OUT)/recovery.id | 
| Howard Chen | 1756f8d | 2017-02-22 17:27:10 +0800 | [diff] [blame] | 1659 |  | 
| Ying Wang | 747b9f1 | 2015-01-30 14:05:22 -0800 | [diff] [blame] | 1660 | # $(1): output file | 
|  | 1661 | define build-recoveryimage-target | 
| Tomasz Wasilczyk | 29ec06b | 2017-11-15 10:34:01 -0800 | [diff] [blame] | 1662 | # Making recovery image | 
| Ying Wang | 747b9f1 | 2015-01-30 14:05:22 -0800 | [diff] [blame] | 1663 | $(hide) mkdir -p $(TARGET_RECOVERY_OUT) | 
| Tao Bao | 696bb33 | 2018-08-17 16:27:01 -0700 | [diff] [blame] | 1664 | $(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] | 1665 | # Copying baseline ramdisk... | 
| Alex Klyubin | 2a7171a | 2017-03-10 12:53:02 -0800 | [diff] [blame] | 1666 | # Use rsync because "cp -Rf" fails to overwrite broken symlinks on Mac. | 
| Tao Bao | 696bb33 | 2018-08-17 16:27:01 -0700 | [diff] [blame] | 1667 | $(hide) rsync -a --exclude=sdcard $(IGNORE_RECOVERY_SEPOLICY) $(IGNORE_CACHE_LINK) $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT) | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1668 | $(if $(filter true,$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)),, \ | 
|  | 1669 | $(hide) rsync -a $(TARGET_RAMDISK_OUT)/* $(TARGET_RECOVERY_ROOT_OUT)/) | 
| Tomasz Wasilczyk | 29ec06b | 2017-11-15 10:34:01 -0800 | [diff] [blame] | 1670 | # Modifying ramdisk contents... | 
| Howard Chen | 1756f8d | 2017-02-22 17:27:10 +0800 | [diff] [blame] | 1671 | $(if $(BOARD_RECOVERY_KERNEL_MODULES), \ | 
|  | 1672 | $(call build-image-kernel-modules,$(BOARD_RECOVERY_KERNEL_MODULES),$(TARGET_RECOVERY_ROOT_OUT),,$(call intermediates-dir-for,PACKAGING,depmod_recovery))) | 
| Bowgo Tsai | b5b3bc6 | 2017-09-25 17:50:41 +0800 | [diff] [blame] | 1673 | # Removes $(TARGET_RECOVERY_ROOT_OUT)/init*.rc EXCEPT init.recovery*.rc. | 
|  | 1674 | $(hide) find $(TARGET_RECOVERY_ROOT_OUT) -maxdepth 1 -name 'init*.rc' -type f -not -name "init.recovery.*.rc" | xargs rm -f | 
| Ying Wang | 747b9f1 | 2015-01-30 14:05:22 -0800 | [diff] [blame] | 1675 | $(hide) cp -f $(recovery_initrc) $(TARGET_RECOVERY_ROOT_OUT)/ | 
| Tao Bao | cf8853b | 2018-08-13 14:27:32 -0700 | [diff] [blame] | 1676 | $(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] | 1677 | $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/res | 
|  | 1678 | $(hide) rm -rf $(TARGET_RECOVERY_ROOT_OUT)/res/* | 
|  | 1679 | $(hide) cp -rf $(recovery_resources_common)/* $(TARGET_RECOVERY_ROOT_OUT)/res | 
|  | 1680 | $(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] | 1681 | $(hide) $(foreach item,$(TARGET_PRIVATE_RES_DIRS), \ | 
|  | 1682 | cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline)) | 
| Ying Wang | 747b9f1 | 2015-01-30 14:05:22 -0800 | [diff] [blame] | 1683 | $(hide) $(foreach item,$(recovery_fstab), \ | 
| Tao Bao | 696bb33 | 2018-08-17 16:27:01 -0700 | [diff] [blame] | 1684 | cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.fstab) | 
| Tao Bao | c3c1753 | 2016-06-10 10:11:54 -0700 | [diff] [blame] | 1685 | $(if $(strip $(recovery_wipe)), \ | 
| Tao Bao | 696bb33 | 2018-08-17 16:27:01 -0700 | [diff] [blame] | 1686 | $(hide) cp -f $(recovery_wipe) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.wipe) | 
| Ying Wang | 747b9f1 | 2015-01-30 14:05:22 -0800 | [diff] [blame] | 1687 | $(hide) cp $(RECOVERY_INSTALL_OTA_KEYS) $(TARGET_RECOVERY_ROOT_OUT)/res/keys | 
| Hung-ying Tyan | f829b40 | 2017-05-01 21:56:26 +0800 | [diff] [blame] | 1688 | $(hide) ln -sf prop.default $(TARGET_RECOVERY_ROOT_OUT)/default.prop | 
| Andriy Naborskyy | 5310557 | 2016-07-22 11:03:31 -0700 | [diff] [blame] | 1689 | $(BOARD_RECOVERY_IMAGE_PREPARE) | 
| Thierry Strudel | 74a81e6 | 2015-07-09 09:54:55 -0700 | [diff] [blame] | 1690 | $(hide) $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RECOVERY_ROOT_OUT) | $(MINIGZIP) > $(recovery_ramdisk) | 
| Tao Bao | d95e9fd | 2015-03-29 23:07:41 -0700 | [diff] [blame] | 1691 | $(if $(filter true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT)), \ | 
| Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 1692 | $(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1).unsigned, \ | 
|  | 1693 | $(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1) --id > $(RECOVERYIMAGE_ID_FILE)) | 
| Sami Tolvanen | 8b3f08b | 2015-04-07 15:08:59 +0100 | [diff] [blame] | 1694 | $(if $(filter true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_BOOT_SIGNER)),\ | 
| Nick Desaulniers | d491fcf | 2016-08-08 10:51:10 -0700 | [diff] [blame] | 1695 | $(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)),\ | 
|  | 1696 | $(BOOT_SIGNER) /boot $(1) $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).x509.pem $(1),\ | 
|  | 1697 | $(BOOT_SIGNER) /recovery $(1) $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VERITY_SIGNING_KEY).x509.pem $(1)\ | 
|  | 1698 | )\ | 
|  | 1699 | ) | 
| Tao Bao | d95e9fd | 2015-03-29 23:07:41 -0700 | [diff] [blame] | 1700 | $(if $(filter true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT)), \ | 
| Furquan Shaikh | e8c2122 | 2015-08-07 11:58:05 -0700 | [diff] [blame] | 1701 | $(VBOOT_SIGNER) $(FUTILITY) $(1).unsigned $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VBOOT_SIGNING_KEY).vbpubk $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VBOOT_SIGNING_KEY).vbprivk $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VBOOT_SIGNING_SUBKEY).vbprivk $(1).keyblock $(1)) | 
| Bowgo Tsai | 03b9c8e | 2017-11-17 15:22:37 +0800 | [diff] [blame] | 1702 | $(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)), \ | 
|  | 1703 | $(hide) $(call assert-max-image-size,$(1),$(call get-hash-image-max-size,$(BOARD_BOOTIMAGE_PARTITION_SIZE))), \ | 
|  | 1704 | $(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] | 1705 | $(if $(filter true,$(BOARD_AVB_ENABLE)), \ | 
|  | 1706 | $(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)), \ | 
|  | 1707 | $(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),\ | 
|  | 1708 | $(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] | 1709 | endef | 
|  | 1710 |  | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 1711 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) | 
| Ying Wang | bd07ad0 | 2016-03-10 12:57:33 -0800 | [diff] [blame] | 1712 | ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_BOOT_SIGNER)) | 
|  | 1713 | $(INSTALLED_BOOTIMAGE_TARGET) : $(BOOT_SIGNER) | 
|  | 1714 | endif | 
|  | 1715 | ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT)) | 
|  | 1716 | $(INSTALLED_BOOTIMAGE_TARGET) : $(VBOOT_SIGNER) | 
|  | 1717 | endif | 
| Thierry Strudel | d7bd1f2 | 2017-05-04 13:58:04 -0700 | [diff] [blame] | 1718 | ifeq (true,$(BOARD_AVB_ENABLE)) | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 1719 | $(INSTALLED_BOOTIMAGE_TARGET) : $(AVBTOOL) $(BOARD_AVB_BOOT_KEY_PATH) | 
| Thierry Strudel | d7bd1f2 | 2017-05-04 13:58:04 -0700 | [diff] [blame] | 1720 | endif | 
| Tao Bao | f4866c7 | 2018-08-22 14:35:09 -0700 | [diff] [blame] | 1721 | ifdef BOARD_INCLUDE_RECOVERY_DTBO | 
|  | 1722 | $(INSTALLED_BOOTIMAGE_TARGET): $(BOARD_PREBUILT_DTBOIMAGE) | 
|  | 1723 | endif | 
|  | 1724 |  | 
| Jiyong Park | ce3e34f | 2018-05-24 14:24:50 +0900 | [diff] [blame] | 1725 | $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \ | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1726 | $(INTERNAL_ROOT_FILES) \ | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 1727 | $(INSTALLED_RAMDISK_TARGET) \ | 
|  | 1728 | $(INTERNAL_RECOVERYIMAGE_FILES) \ | 
| Daniel Cashman | df1e210 | 2016-12-17 00:53:52 +0000 | [diff] [blame] | 1729 | $(recovery_initrc) $(recovery_sepolicy) $(recovery_kernel) \ | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 1730 | $(INSTALLED_2NDBOOTLOADER_TARGET) \ | 
| Tao Bao | 139c727 | 2018-07-31 13:26:54 -0700 | [diff] [blame] | 1731 | $(INSTALLED_RECOVERY_BUILD_PROP_TARGET) \ | 
|  | 1732 | $(recovery_resource_deps) \ | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 1733 | $(recovery_fstab) \ | 
| Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 1734 | $(RECOVERY_INSTALL_OTA_KEYS) \ | 
| Howard Chen | 1756f8d | 2017-02-22 17:27:10 +0800 | [diff] [blame] | 1735 | $(BOARD_RECOVERY_KERNEL_MODULES) \ | 
|  | 1736 | $(DEPMOD) | 
| Tao Bao | f4866c7 | 2018-08-22 14:35:09 -0700 | [diff] [blame] | 1737 | $(call pretty,"Target boot image from recovery: $@") | 
|  | 1738 | $(call build-recoveryimage-target, $@) | 
|  | 1739 | endif # BOARD_USES_RECOVERY_AS_BOOT | 
|  | 1740 |  | 
|  | 1741 | ifdef BOARD_INCLUDE_RECOVERY_DTBO | 
|  | 1742 | $(INSTALLED_RECOVERYIMAGE_TARGET): $(BOARD_PREBUILT_DTBOIMAGE) | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 1743 | endif | 
|  | 1744 |  | 
| Jiyong Park | ce3e34f | 2018-05-24 14:24:50 +0900 | [diff] [blame] | 1745 | $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \ | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1746 | $(INTERNAL_ROOT_FILES) \ | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1747 | $(INSTALLED_RAMDISK_TARGET) \ | 
|  | 1748 | $(INSTALLED_BOOTIMAGE_TARGET) \ | 
| Ying Wang | 3752614 | 2015-03-10 12:02:57 -0700 | [diff] [blame] | 1749 | $(INTERNAL_RECOVERYIMAGE_FILES) \ | 
| Daniel Cashman | df1e210 | 2016-12-17 00:53:52 +0000 | [diff] [blame] | 1750 | $(recovery_initrc) $(recovery_sepolicy) $(recovery_kernel) \ | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1751 | $(INSTALLED_2NDBOOTLOADER_TARGET) \ | 
| Tao Bao | 139c727 | 2018-07-31 13:26:54 -0700 | [diff] [blame] | 1752 | $(INSTALLED_RECOVERY_BUILD_PROP_TARGET) \ | 
|  | 1753 | $(recovery_resource_deps) \ | 
| Doug Zongker | 9ce0fb6 | 2010-09-20 18:04:41 -0700 | [diff] [blame] | 1754 | $(recovery_fstab) \ | 
| Jaekyun Seok | 8bee120 | 2017-01-31 20:07:02 +0900 | [diff] [blame] | 1755 | $(RECOVERY_INSTALL_OTA_KEYS) \ | 
| Howard Chen | 1756f8d | 2017-02-22 17:27:10 +0800 | [diff] [blame] | 1756 | $(BOARD_RECOVERY_KERNEL_MODULES) \ | 
|  | 1757 | $(DEPMOD) | 
| Tao Bao | f4866c7 | 2018-08-22 14:35:09 -0700 | [diff] [blame] | 1758 | $(call build-recoveryimage-target, $@) | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1759 |  | 
| Tao Bao | 4594d0e | 2015-12-22 09:47:46 -0800 | [diff] [blame] | 1760 | ifdef RECOVERY_RESOURCE_ZIP | 
| Dan Willemsen | 48a621c | 2015-10-29 16:33:05 -0700 | [diff] [blame] | 1761 | $(RECOVERY_RESOURCE_ZIP): $(INSTALLED_RECOVERYIMAGE_TARGET) | $(ZIPTIME) | 
| Doug Zongker | 1a09726 | 2012-09-04 14:45:11 -0700 | [diff] [blame] | 1762 | $(hide) mkdir -p $(dir $@) | 
| Dan Willemsen | 48a621c | 2015-10-29 16:33:05 -0700 | [diff] [blame] | 1763 | $(hide) find $(TARGET_RECOVERY_ROOT_OUT)/res -type f | sort | zip -0qrjX $@ -@ | 
|  | 1764 | $(remove-timestamps-from-package) | 
| Tao Bao | 8beab69 | 2015-07-22 12:33:18 -0700 | [diff] [blame] | 1765 | endif | 
| Doug Zongker | 5658887 | 2012-08-20 15:38:58 -0700 | [diff] [blame] | 1766 |  | 
| Ying Wang | 747b9f1 | 2015-01-30 14:05:22 -0800 | [diff] [blame] | 1767 | .PHONY: recoveryimage-nodeps | 
|  | 1768 | recoveryimage-nodeps: | 
|  | 1769 | @echo "make $@: ignoring dependencies" | 
|  | 1770 | $(call build-recoveryimage-target, $(INSTALLED_RECOVERYIMAGE_TARGET)) | 
|  | 1771 |  | 
| Tao Bao | 8beab69 | 2015-07-22 12:33:18 -0700 | [diff] [blame] | 1772 | else # INSTALLED_RECOVERYIMAGE_TARGET not defined | 
| Doug Zongker | 5658887 | 2012-08-20 15:38:58 -0700 | [diff] [blame] | 1773 | RECOVERY_RESOURCE_ZIP := | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1774 | endif | 
|  | 1775 |  | 
|  | 1776 | .PHONY: recoveryimage | 
| Doug Zongker | 5658887 | 2012-08-20 15:38:58 -0700 | [diff] [blame] | 1777 | recoveryimage: $(INSTALLED_RECOVERYIMAGE_TARGET) $(RECOVERY_RESOURCE_ZIP) | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1778 |  | 
| Jiyong Park | 03eb061 | 2017-10-04 21:22:41 +0900 | [diff] [blame] | 1779 | ifneq ($(BOARD_NAND_PAGE_SIZE),) | 
|  | 1780 | $(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] | 1781 | endif | 
|  | 1782 |  | 
| Jiyong Park | 03eb061 | 2017-10-04 21:22:41 +0900 | [diff] [blame] | 1783 | ifneq ($(BOARD_NAND_SPARE_SIZE),) | 
|  | 1784 | $(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] | 1785 | endif | 
|  | 1786 |  | 
| Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1787 | # ----------------------------------------------------------------- | 
| Ying Wang | 0235237 | 2010-09-27 10:37:25 -0700 | [diff] [blame] | 1788 | # system image | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1789 | # | 
| Ying Wang | 9c649a7 | 2012-08-08 15:27:00 -0700 | [diff] [blame] | 1790 | # Remove overridden packages from $(ALL_PDK_FUSION_FILES) | 
|  | 1791 | PDK_FUSION_SYSIMG_FILES := \ | 
|  | 1792 | $(filter-out $(foreach p,$(overridden_packages),$(p) %/$(p).apk), \ | 
|  | 1793 | $(ALL_PDK_FUSION_FILES)) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1794 |  | 
|  | 1795 | INTERNAL_SYSTEMIMAGE_FILES := $(filter $(TARGET_OUT)/%, \ | 
| Ying Wang | 160b670 | 2012-03-13 18:58:27 -0700 | [diff] [blame] | 1796 | $(ALL_GENERATED_SOURCES) \ | 
| Doug Zongker | 5658887 | 2012-08-20 15:38:58 -0700 | [diff] [blame] | 1797 | $(ALL_DEFAULT_INSTALLED_MODULES) \ | 
|  | 1798 | $(PDK_FUSION_SYSIMG_FILES) \ | 
| Dan Willemsen | 0663f68 | 2018-03-06 14:07:21 -0800 | [diff] [blame] | 1799 | $(RECOVERY_RESOURCE_ZIP)) \ | 
|  | 1800 | $(PDK_FUSION_SYMLINK_STAMP) | 
| Ying Wang | 160b670 | 2012-03-13 18:58:27 -0700 | [diff] [blame] | 1801 |  | 
| Ying Wang | 82cceba | 2012-08-13 15:03:00 -0700 | [diff] [blame] | 1802 | FULL_SYSTEMIMAGE_DEPS := $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_USERIMAGES_DEPS) | 
| Andreas Gampe | 039b5c7 | 2017-03-24 16:06:31 -0700 | [diff] [blame] | 1803 |  | 
|  | 1804 | # ASAN libraries in the system image - add dependency. | 
|  | 1805 | ASAN_IN_SYSTEM_INSTALLED := $(TARGET_OUT)/asan.tar.bz2 | 
| Evgenii Stepanov | 8841a7f | 2018-07-27 11:54:32 -0700 | [diff] [blame] | 1806 | ifneq (,$(filter address, $(SANITIZE_TARGET))) | 
| Andreas Gampe | 039b5c7 | 2017-03-24 16:06:31 -0700 | [diff] [blame] | 1807 | ifeq (true,$(SANITIZE_TARGET_SYSTEM)) | 
|  | 1808 | FULL_SYSTEMIMAGE_DEPS += $(ASAN_IN_SYSTEM_INSTALLED) | 
|  | 1809 | endif | 
|  | 1810 | endif | 
|  | 1811 |  | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 1812 | FULL_SYSTEMIMAGE_DEPS += $(INTERNAL_ROOT_FILES) $(INSTALLED_FILES_FILE_ROOT) | 
| Luis Hector Chavez | ff48993 | 2018-07-03 15:41:40 -0700 | [diff] [blame] | 1813 |  | 
| Ying Wang | e5e8c5f | 2011-09-09 16:35:53 -0700 | [diff] [blame] | 1814 | # ----------------------------------------------------------------- | 
| Steven Moreland | 627debe | 2018-05-01 09:54:21 -0700 | [diff] [blame] | 1815 | # Final System VINTF manifest including fragments. This is not assembled | 
|  | 1816 | # on the device because it depends on everything in a given device | 
|  | 1817 | # image which defines a vintf_fragment. | 
|  | 1818 |  | 
|  | 1819 | BUILT_ASSEMBLED_SYSTEM_MANIFEST := $(PRODUCT_OUT)/verified_assembled_system_manifest.xml | 
|  | 1820 | $(BUILT_ASSEMBLED_SYSTEM_MANIFEST): $(HOST_OUT_EXECUTABLES)/assemble_vintf | 
|  | 1821 | $(BUILT_ASSEMBLED_SYSTEM_MANIFEST): $(BUILT_VENDOR_MATRIX) | 
|  | 1822 | $(BUILT_ASSEMBLED_SYSTEM_MANIFEST): $(BUILT_SYSTEM_MANIFEST) | 
|  | 1823 | $(BUILT_ASSEMBLED_SYSTEM_MANIFEST): $(FULL_SYSTEMIMAGE_DEPS) | 
|  | 1824 | @echo "Verifying system VINTF manifest." | 
|  | 1825 | PRODUCT_ENFORCE_VINTF_MANIFEST=$(PRODUCT_ENFORCE_VINTF_MANIFEST) \ | 
|  | 1826 | $(HOST_OUT_EXECUTABLES)/assemble_vintf \ | 
|  | 1827 | -c $(BUILT_VENDOR_MATRIX) \ | 
|  | 1828 | -i $(BUILT_SYSTEM_MANIFEST) \ | 
|  | 1829 | $$([ -d $(TARGET_OUT)/etc/vintf/manifest ] && \ | 
|  | 1830 | find $(TARGET_OUT)/etc/vintf/manifest -type f -name "*.xml" | \ | 
|  | 1831 | sed "s/^/-i /" | tr '\n' ' ') -o $@ | 
|  | 1832 |  | 
|  | 1833 | # ----------------------------------------------------------------- | 
| Ying Wang | e5e8c5f | 2011-09-09 16:35:53 -0700 | [diff] [blame] | 1834 | # installed file list | 
|  | 1835 | # Depending on anything that $(BUILT_SYSTEMIMAGE) depends on. | 
|  | 1836 | # We put installed-files.txt ahead of image itself in the dependency graph | 
|  | 1837 | # so that we can get the size stat even if the build fails due to too large | 
|  | 1838 | # system image. | 
|  | 1839 | INSTALLED_FILES_FILE := $(PRODUCT_OUT)/installed-files.txt | 
| Colin Cross | 23dded0 | 2018-06-13 14:04:22 -0700 | [diff] [blame] | 1840 | INSTALLED_FILES_JSON := $(INSTALLED_FILES_FILE:.txt=.json) | 
|  | 1841 | $(INSTALLED_FILES_FILE): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON) | 
| Makoto Onuki | 9fe97e2 | 2017-03-16 09:41:19 -0700 | [diff] [blame] | 1842 | $(INSTALLED_FILES_FILE): $(FULL_SYSTEMIMAGE_DEPS) $(FILESLIST) | 
| Ying Wang | e5e8c5f | 2011-09-09 16:35:53 -0700 | [diff] [blame] | 1843 | @echo Installed file list: $@ | 
|  | 1844 | @mkdir -p $(dir $@) | 
|  | 1845 | @rm -f $@ | 
| Makoto Onuki | 9fe97e2 | 2017-03-16 09:41:19 -0700 | [diff] [blame] | 1846 | $(hide) $(FILESLIST) $(TARGET_OUT) > $(@:.txt=.json) | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 1847 | $(hide) build/make/tools/fileslist_util.py -c $(@:.txt=.json) > $@ | 
| Ying Wang | e5e8c5f | 2011-09-09 16:35:53 -0700 | [diff] [blame] | 1848 |  | 
|  | 1849 | .PHONY: installed-file-list | 
|  | 1850 | installed-file-list: $(INSTALLED_FILES_FILE) | 
| Ying Wang | 534fcd7 | 2013-03-01 16:45:35 -0800 | [diff] [blame] | 1851 |  | 
|  | 1852 | $(call dist-for-goals, sdk win_sdk sdk_addon, $(INSTALLED_FILES_FILE)) | 
| Ying Wang | e5e8c5f | 2011-09-09 16:35:53 -0700 | [diff] [blame] | 1853 |  | 
|  | 1854 | systemimage_intermediates := \ | 
| Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 1855 | $(call intermediates-dir-for,PACKAGING,systemimage) | 
| Ying Wang | e5e8c5f | 2011-09-09 16:35:53 -0700 | [diff] [blame] | 1856 | BUILT_SYSTEMIMAGE := $(systemimage_intermediates)/system.img | 
|  | 1857 |  | 
| Ying Wang | 23898df | 2014-06-18 20:26:24 -0700 | [diff] [blame] | 1858 | # Create symlink /system/vendor to /vendor if necessary. | 
| Dan Willemsen | 6c3e79b | 2016-06-17 14:07:37 -0700 | [diff] [blame] | 1859 | ifdef BOARD_USES_VENDORIMAGE | 
| Ying Wang | 23898df | 2014-06-18 20:26:24 -0700 | [diff] [blame] | 1860 | define create-system-vendor-symlink | 
| Ying Wang | 3e72ed1 | 2014-07-17 12:56:49 -0700 | [diff] [blame] | 1861 | $(hide) if [ -d $(TARGET_OUT)/vendor ] && [ ! -h $(TARGET_OUT)/vendor ]; then \ | 
|  | 1862 | echo 'Non-symlink $(TARGET_OUT)/vendor detected!' 1>&2; \ | 
|  | 1863 | echo 'You cannot install files to $(TARGET_OUT)/vendor while building a separate vendor.img!' 1>&2; \ | 
|  | 1864 | exit 1; \ | 
|  | 1865 | fi | 
| Ying Wang | 23898df | 2014-06-18 20:26:24 -0700 | [diff] [blame] | 1866 | $(hide) ln -sf /vendor $(TARGET_OUT)/vendor | 
|  | 1867 | endef | 
|  | 1868 | else | 
|  | 1869 | define create-system-vendor-symlink | 
|  | 1870 | endef | 
|  | 1871 | endif | 
|  | 1872 |  | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 1873 | # Create symlink /system/product to /product if necessary. | 
|  | 1874 | ifdef BOARD_USES_PRODUCTIMAGE | 
|  | 1875 | define create-system-product-symlink | 
|  | 1876 | $(hide) if [ -d $(TARGET_OUT)/product ] && [ ! -h $(TARGET_OUT)/product ]; then \ | 
|  | 1877 | echo 'Non-symlink $(TARGET_OUT)/product detected!' 1>&2; \ | 
|  | 1878 | echo 'You cannot install files to $(TARGET_OUT)/product while building a separate product.img!' 1>&2; \ | 
|  | 1879 | exit 1; \ | 
|  | 1880 | fi | 
|  | 1881 | $(hide) ln -sf /product $(TARGET_OUT)/product | 
|  | 1882 | endef | 
|  | 1883 | else | 
|  | 1884 | define create-system-product-symlink | 
|  | 1885 | endef | 
|  | 1886 | endif | 
|  | 1887 |  | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 1888 | # Create symlink /system/product_services to /product_services if necessary. | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 1889 | ifdef BOARD_USES_PRODUCT_SERVICESIMAGE | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 1890 | define create-system-product_services-symlink | 
|  | 1891 | $(hide) if [ -d $(TARGET_OUT)/product_services ] && [ ! -h $(TARGET_OUT)/product_services ]; then \ | 
|  | 1892 | echo 'Non-symlink $(TARGET_OUT)/product_services detected!' 1>&2; \ | 
|  | 1893 | echo 'You cannot install files to $(TARGET_OUT)/product_services while building a separate product_services.img!' 1>&2; \ | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 1894 | exit 1; \ | 
|  | 1895 | fi | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 1896 | $(hide) ln -sf /product_services $(TARGET_OUT)/product_services | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 1897 | endef | 
|  | 1898 | else | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 1899 | define create-system-product_services-symlink | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 1900 | endef | 
|  | 1901 | endif | 
|  | 1902 |  | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 1903 | # Create symlink /vendor/odm to /odm if necessary. | 
|  | 1904 | ifdef BOARD_USES_ODMIMAGE | 
|  | 1905 | define create-vendor-odm-symlink | 
|  | 1906 | $(hide) if [ -d $(TARGET_OUT_VENDOR)/odm ] && [ ! -h $(TARGET_OUT_VENDOR)/odm ]; then \ | 
|  | 1907 | echo 'Non-symlink $(TARGET_OUT_VENDOR)/odm detected!' 1>&2; \ | 
|  | 1908 | echo 'You cannot install files to $(TARGET_OUT_VENDOR)/odm while building a separate odm.img!' 1>&2; \ | 
|  | 1909 | exit 1; \ | 
|  | 1910 | fi | 
|  | 1911 | $(hide) ln -sf /odm $(TARGET_OUT_VENDOR)/odm | 
|  | 1912 | endef | 
|  | 1913 | else | 
|  | 1914 | define create-vendor-odm-symlink | 
|  | 1915 | endef | 
|  | 1916 | endif | 
|  | 1917 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1918 | # $(1): output file | 
|  | 1919 | define build-systemimage-target | 
| Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 1920 | @echo "Target system fs image: $(1)" | 
| Ying Wang | 23898df | 2014-06-18 20:26:24 -0700 | [diff] [blame] | 1921 | $(call create-system-vendor-symlink) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 1922 | $(call create-system-product-symlink) | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 1923 | $(call create-system-product_services-symlink) | 
| Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 1924 | @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] | 1925 | $(call generate-image-prop-dictionary, $(systemimage_intermediates)/system_image_info.txt,system, \ | 
| Geremy Condra | 5b5f495 | 2014-05-05 22:19:37 -0700 | [diff] [blame] | 1926 | skip_fsck=true) | 
| Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 1927 | $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \ | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 1928 | build/make/tools/releasetools/build_image.py \ | 
| Thierry Strudel | 74a81e6 | 2015-07-09 09:54:55 -0700 | [diff] [blame] | 1929 | $(TARGET_OUT) $(systemimage_intermediates)/system_image_info.txt $(1) $(TARGET_OUT) \ | 
| Yifan Hong | bbcba1e | 2018-06-18 16:32:35 -0700 | [diff] [blame] | 1930 | $(systemimage_intermediates)/generated_system_image_info.txt \ | 
|  | 1931 | || ( mkdir -p $(DIST_DIR); cp $(INSTALLED_FILES_FILE) $(DIST_DIR)/installed-files-rescued.txt; \ | 
| Ying Wang | 45ff36e | 2014-08-13 12:36:05 -0700 | [diff] [blame] | 1932 | exit 1 ) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1933 | endef | 
|  | 1934 |  | 
| Steven Moreland | 627debe | 2018-05-01 09:54:21 -0700 | [diff] [blame] | 1935 | $(BUILT_SYSTEMIMAGE): $(BUILT_ASSEMBLED_SYSTEM_MANIFEST) | 
| Shinichiro Hamaji | 3deb87d | 2016-04-19 18:41:27 +0900 | [diff] [blame] | 1936 | $(BUILT_SYSTEMIMAGE): $(FULL_SYSTEMIMAGE_DEPS) $(INSTALLED_FILES_FILE) $(BUILD_IMAGE_SRCS) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1937 | $(call build-systemimage-target,$@) | 
|  | 1938 |  | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 1939 | INSTALLED_SYSTEMIMAGE_TARGET := $(PRODUCT_OUT)/system.img | 
| Ying Wang | 0235237 | 2010-09-27 10:37:25 -0700 | [diff] [blame] | 1940 | SYSTEMIMAGE_SOURCE_DIR := $(TARGET_OUT) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1941 |  | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 1942 | # INSTALLED_SYSTEMIMAGE_TARGET used to be named INSTALLED_SYSTEMIMAGE. Create an alias for backward | 
|  | 1943 | # compatibility, in case device-specific Makefiles still refer to the old name. | 
|  | 1944 | INSTALLED_SYSTEMIMAGE := $(INSTALLED_SYSTEMIMAGE_TARGET) | 
|  | 1945 |  | 
| Doug Zongker | 73ef825 | 2009-07-23 15:12:53 -0700 | [diff] [blame] | 1946 | # The system partition needs room for the recovery image as well.  We | 
|  | 1947 | # now store the recovery image as a binary patch using the boot image | 
|  | 1948 | # as the source (since they are very similar).  Generate the patch so | 
|  | 1949 | # we can see how big it's going to be, and include that in the system | 
|  | 1950 | # image size check calculation. | 
| Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 1951 | ifneq ($(INSTALLED_BOOTIMAGE_TARGET),) | 
| Sriram Raman | 1e96ac8 | 2009-07-24 13:52:32 -0700 | [diff] [blame] | 1952 | ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),) | 
| Tao Bao | 8beab69 | 2015-07-22 12:33:18 -0700 | [diff] [blame] | 1953 | ifneq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true) | 
| Hridya Valsaraju | e74a38b | 2018-03-21 12:15:11 -0700 | [diff] [blame] | 1954 | ifneq (,$(filter true, $(BOARD_BUILD_SYSTEM_ROOT_IMAGE) $(BOARD_INCLUDE_RECOVERY_DTBO))) | 
| Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 1955 | diff_tool := $(HOST_OUT_EXECUTABLES)/bsdiff | 
|  | 1956 | else | 
|  | 1957 | diff_tool := $(HOST_OUT_EXECUTABLES)/imgdiff | 
|  | 1958 | endif | 
| Doug Zongker | 73ef825 | 2009-07-23 15:12:53 -0700 | [diff] [blame] | 1959 | intermediates := $(call intermediates-dir-for,PACKAGING,recovery_patch) | 
|  | 1960 | RECOVERY_FROM_BOOT_PATCH := $(intermediates)/recovery_from_boot.p | 
| Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 1961 | $(RECOVERY_FROM_BOOT_PATCH): PRIVATE_DIFF_TOOL := $(diff_tool) | 
|  | 1962 | $(RECOVERY_FROM_BOOT_PATCH): \ | 
|  | 1963 | $(INSTALLED_RECOVERYIMAGE_TARGET) \ | 
|  | 1964 | $(INSTALLED_BOOTIMAGE_TARGET) \ | 
|  | 1965 | $(diff_tool) | 
| Doug Zongker | 73ef825 | 2009-07-23 15:12:53 -0700 | [diff] [blame] | 1966 | @echo "Construct recovery from boot" | 
|  | 1967 | mkdir -p $(dir $@) | 
| Tao Bao | 6d5d623 | 2018-03-09 17:04:42 -0800 | [diff] [blame] | 1968 | $(PRIVATE_DIFF_TOOL) $(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_RECOVERYIMAGE_TARGET) $@ | 
| Tao Bao | 8beab69 | 2015-07-22 12:33:18 -0700 | [diff] [blame] | 1969 | else # $(BOARD_USES_FULL_RECOVERY_IMAGE) == true | 
|  | 1970 | RECOVERY_FROM_BOOT_PATCH := $(INSTALLED_RECOVERYIMAGE_TARGET) | 
| Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 1971 | endif # BOARD_USES_FULL_RECOVERY_IMAGE | 
|  | 1972 | endif # INSTALLED_RECOVERYIMAGE_TARGET | 
|  | 1973 | endif # INSTALLED_BOOTIMAGE_TARGET | 
| Doug Zongker | 73ef825 | 2009-07-23 15:12:53 -0700 | [diff] [blame] | 1974 |  | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 1975 | $(INSTALLED_SYSTEMIMAGE_TARGET): $(BUILT_SYSTEMIMAGE) $(RECOVERY_FROM_BOOT_PATCH) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1976 | @echo "Install system fs image: $@" | 
|  | 1977 | $(copy-file-to-target) | 
| Yifan Hong | bbcba1e | 2018-06-18 16:32:35 -0700 | [diff] [blame] | 1978 | $(hide) $(call assert-max-image-size,$@ $(RECOVERY_FROM_BOOT_PATCH),\ | 
|  | 1979 | $(call read-image-prop-dictionary,\ | 
|  | 1980 | $(systemimage_intermediates)/generated_system_image_info.txt,system_size)) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1981 |  | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 1982 | systemimage: $(INSTALLED_SYSTEMIMAGE_TARGET) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1983 |  | 
|  | 1984 | .PHONY: systemimage-nodeps snod | 
|  | 1985 | systemimage-nodeps snod: $(filter-out systemimage-nodeps snod,$(MAKECMDGOALS)) \ | 
| Colin Cross | 144b028 | 2010-05-10 13:04:47 -0700 | [diff] [blame] | 1986 | | $(INTERNAL_USERIMAGES_DEPS) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1987 | @echo "make $@: ignoring dependencies" | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 1988 | $(call build-systemimage-target,$(INSTALLED_SYSTEMIMAGE_TARGET)) | 
|  | 1989 | $(hide) $(call assert-max-image-size,$(INSTALLED_SYSTEMIMAGE_TARGET),\ | 
| Yifan Hong | bbcba1e | 2018-06-18 16:32:35 -0700 | [diff] [blame] | 1990 | $(call read-image-prop-dictionary,\ | 
|  | 1991 | $(systemimage_intermediates)/generated_system_image_info.txt,system_size)) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1992 |  | 
| Ying Wang | acf01ec | 2012-02-24 11:05:48 -0800 | [diff] [blame] | 1993 | ifneq (,$(filter systemimage-nodeps snod, $(MAKECMDGOALS))) | 
|  | 1994 | ifeq (true,$(WITH_DEXPREOPT)) | 
|  | 1995 | $(warning Warning: with dexpreopt enabled, you may need a full rebuild.) | 
|  | 1996 | endif | 
|  | 1997 | endif | 
|  | 1998 |  | 
| Colin Cross | 91a5227 | 2017-06-20 16:57:52 -0700 | [diff] [blame] | 1999 | .PHONY: sync | 
|  | 2000 | sync: $(INTERNAL_SYSTEMIMAGE_FILES) | 
|  | 2001 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2002 | ####### | 
|  | 2003 | ## system tarball | 
|  | 2004 | define build-systemtarball-target | 
| Ying Wang | 23898df | 2014-06-18 20:26:24 -0700 | [diff] [blame] | 2005 | $(call pretty,"Target system fs tarball: $(INSTALLED_SYSTEMTARBALL_TARGET)") | 
|  | 2006 | $(call create-system-vendor-symlink) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2007 | $(call create-system-product-symlink) | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 2008 | $(call create-system-product_services-symlink) | 
| Ying Wang | 23898df | 2014-06-18 20:26:24 -0700 | [diff] [blame] | 2009 | $(MKTARBALL) $(FS_GET_STATS) \ | 
|  | 2010 | $(PRODUCT_OUT) system $(PRIVATE_SYSTEM_TAR) \ | 
| Thierry Strudel | 74a81e6 | 2015-07-09 09:54:55 -0700 | [diff] [blame] | 2011 | $(INSTALLED_SYSTEMTARBALL_TARGET) $(TARGET_OUT) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2012 | endef | 
|  | 2013 |  | 
| Bruce Beare | 69ef5ce | 2010-06-11 12:05:57 -0700 | [diff] [blame] | 2014 | ifndef SYSTEM_TARBALL_FORMAT | 
|  | 2015 | SYSTEM_TARBALL_FORMAT := bz2 | 
|  | 2016 | endif | 
|  | 2017 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2018 | system_tar := $(PRODUCT_OUT)/system.tar | 
| Bruce Beare | 69ef5ce | 2010-06-11 12:05:57 -0700 | [diff] [blame] | 2019 | INSTALLED_SYSTEMTARBALL_TARGET := $(system_tar).$(SYSTEM_TARBALL_FORMAT) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2020 | $(INSTALLED_SYSTEMTARBALL_TARGET): PRIVATE_SYSTEM_TAR := $(system_tar) | 
|  | 2021 | $(INSTALLED_SYSTEMTARBALL_TARGET): $(FS_GET_STATS) $(INTERNAL_SYSTEMIMAGE_FILES) | 
|  | 2022 | $(build-systemtarball-target) | 
|  | 2023 |  | 
|  | 2024 | .PHONY: systemtarball-nodeps | 
|  | 2025 | systemtarball-nodeps: $(FS_GET_STATS) \ | 
|  | 2026 | $(filter-out systemtarball-nodeps stnod,$(MAKECMDGOALS)) | 
|  | 2027 | $(build-systemtarball-target) | 
|  | 2028 |  | 
|  | 2029 | .PHONY: stnod | 
|  | 2030 | stnod: systemtarball-nodeps | 
|  | 2031 |  | 
| Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2032 | # ----------------------------------------------------------------- | 
| Ying Wang | 4534d81 | 2012-04-09 17:04:12 -0700 | [diff] [blame] | 2033 | ## platform.zip: system, plus other files to be used in PDK fusion build, | 
|  | 2034 | ## in a zip file | 
| keunyoung | c017806 | 2013-07-22 14:54:58 -0700 | [diff] [blame] | 2035 | ## | 
|  | 2036 | ## PDK_PLATFORM_ZIP_PRODUCT_BINARIES is used to store specified files to platform.zip. | 
|  | 2037 | ## The variable will be typically set from BoardConfig.mk. | 
|  | 2038 | ## Files under out dir will be rejected to prevent possible conflicts with other rules. | 
| Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2039 | pdk_odex_javalibs := $(strip $(foreach m,$(DEXPREOPT.MODULES.JAVA_LIBRARIES),\ | 
|  | 2040 | $(if $(filter $(DEXPREOPT.$(m).INSTALLED),$(ALL_DEFAULT_INSTALLED_MODULES)),$(m)))) | 
|  | 2041 | pdk_odex_apps := $(strip $(foreach m,$(DEXPREOPT.MODULES.APPS),\ | 
|  | 2042 | $(if $(filter $(DEXPREOPT.$(m).INSTALLED),$(ALL_DEFAULT_INSTALLED_MODULES)),$(m)))) | 
|  | 2043 | pdk_classes_dex := $(strip \ | 
|  | 2044 | $(foreach m,$(pdk_odex_javalibs),$(call intermediates-dir-for,JAVA_LIBRARIES,$(m),,COMMON)/javalib.jar) \ | 
|  | 2045 | $(foreach m,$(pdk_odex_apps),$(call intermediates-dir-for,APPS,$(m))/package.dex.apk)) | 
|  | 2046 |  | 
|  | 2047 | pdk_odex_config_mk := $(PRODUCT_OUT)/pdk_dexpreopt_config.mk | 
|  | 2048 | $(pdk_odex_config_mk): PRIVATE_JAVA_LIBRARIES := $(pdk_odex_javalibs) | 
|  | 2049 | $(pdk_odex_config_mk): PRIVATE_APPS := $(pdk_odex_apps) | 
|  | 2050 | $(pdk_odex_config_mk) : | 
|  | 2051 | @echo "PDK odex config makefile: $@" | 
|  | 2052 | $(hide) mkdir -p $(dir $@) | 
|  | 2053 | $(hide) echo "# Auto-generated. Do not modify." > $@ | 
|  | 2054 | $(hide) echo "PDK.DEXPREOPT.JAVA_LIBRARIES:=$(PRIVATE_JAVA_LIBRARIES)" >> $@ | 
|  | 2055 | $(hide) echo "PDK.DEXPREOPT.APPS:=$(PRIVATE_APPS)" >> $@ | 
|  | 2056 | $(foreach m,$(PRIVATE_JAVA_LIBRARIES),\ | 
|  | 2057 | $(hide) echo "PDK.DEXPREOPT.$(m).SRC:=$(patsubst $(OUT_DIR)/%,%,$(call intermediates-dir-for,JAVA_LIBRARIES,$(m),,COMMON)/javalib.jar)" >> $@$(newline)\ | 
|  | 2058 | $(hide) echo "PDK.DEXPREOPT.$(m).DEX_PREOPT:=$(DEXPREOPT.$(m).DEX_PREOPT)" >> $@$(newline)\ | 
|  | 2059 | $(hide) echo "PDK.DEXPREOPT.$(m).MULTILIB:=$(DEXPREOPT.$(m).MULTILIB)" >> $@$(newline)\ | 
|  | 2060 | $(hide) echo "PDK.DEXPREOPT.$(m).DEX_PREOPT_FLAGS:=$(DEXPREOPT.$(m).DEX_PREOPT_FLAGS)" >> $@$(newline)\ | 
|  | 2061 | ) | 
|  | 2062 | $(foreach m,$(PRIVATE_APPS),\ | 
|  | 2063 | $(hide) echo "PDK.DEXPREOPT.$(m).SRC:=$(patsubst $(OUT_DIR)/%,%,$(call intermediates-dir-for,APPS,$(m))/package.dex.apk)" >> $@$(newline)\ | 
|  | 2064 | $(hide) echo "PDK.DEXPREOPT.$(m).DEX_PREOPT:=$(DEXPREOPT.$(m).DEX_PREOPT)" >> $@$(newline)\ | 
|  | 2065 | $(hide) echo "PDK.DEXPREOPT.$(m).MULTILIB:=$(DEXPREOPT.$(m).MULTILIB)" >> $@$(newline)\ | 
|  | 2066 | $(hide) echo "PDK.DEXPREOPT.$(m).DEX_PREOPT_FLAGS:=$(DEXPREOPT.$(m).DEX_PREOPT_FLAGS)" >> $@$(newline)\ | 
|  | 2067 | $(hide) echo "PDK.DEXPREOPT.$(m).PRIVILEGED_MODULE:=$(DEXPREOPT.$(m).PRIVILEGED_MODULE)" >> $@$(newline)\ | 
| Dan Willemsen | 05a2b93 | 2017-03-20 18:31:17 -0700 | [diff] [blame] | 2068 | $(hide) echo "PDK.DEXPREOPT.$(m).VENDOR_MODULE:=$(DEXPREOPT.$(m).VENDOR_MODULE)" >> $@$(newline)\ | 
| Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2069 | $(hide) echo "PDK.DEXPREOPT.$(m).TARGET_ARCH:=$(DEXPREOPT.$(m).TARGET_ARCH)" >> $@$(newline)\ | 
|  | 2070 | $(hide) echo "PDK.DEXPREOPT.$(m).STRIPPED_SRC:=$(patsubst $(PRODUCT_OUT)/%,%,$(DEXPREOPT.$(m).INSTALLED_STRIPPED))" >> $@$(newline)\ | 
|  | 2071 | ) | 
|  | 2072 |  | 
| keunyoung | c017806 | 2013-07-22 14:54:58 -0700 | [diff] [blame] | 2073 | 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] | 2074 | INSTALLED_PLATFORM_ZIP := $(PRODUCT_OUT)/platform.zip | 
| Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2075 |  | 
|  | 2076 | $(INSTALLED_PLATFORM_ZIP): PRIVATE_DEX_FILES := $(pdk_classes_dex) | 
|  | 2077 | $(INSTALLED_PLATFORM_ZIP): PRIVATE_ODEX_CONFIG := $(pdk_odex_config_mk) | 
|  | 2078 | $(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_SYSTEMIMAGE_FILES) $(pdk_odex_config_mk) | 
| Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 2079 | $(call pretty,"Platform zip package: $(INSTALLED_PLATFORM_ZIP)") | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 2080 | $(hide) rm -f $@ | 
|  | 2081 | $(hide) cd $(dir $@) && zip -qryX $(notdir $@) \ | 
|  | 2082 | $(TARGET_COPY_OUT_SYSTEM) \ | 
|  | 2083 | $(patsubst $(PRODUCT_OUT)/%, %, $(TARGET_OUT_NOTICE_FILES)) \ | 
|  | 2084 | $(addprefix symbols/,$(PDK_SYMBOL_FILES_LIST)) | 
| Ying Wang | cff3862 | 2014-07-16 17:46:35 -0700 | [diff] [blame] | 2085 | ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 2086 | $(hide) cd $(dir $@) && zip -qryX $(notdir $@) \ | 
|  | 2087 | $(TARGET_COPY_OUT_VENDOR) | 
| Ying Wang | cff3862 | 2014-07-16 17:46:35 -0700 | [diff] [blame] | 2088 | endif | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2089 | ifdef BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 2090 | $(hide) cd $(dir $@) && zip -qryX $(notdir $@) \ | 
|  | 2091 | $(TARGET_COPY_OUT_PRODUCT) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2092 | endif | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2093 | ifdef BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 2094 | $(hide) cd $(dir $@) && zip -qryX $(notdir $@) \ | 
|  | 2095 | $(TARGET_COPY_OUT_PRODUCT_SERVICES) | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2096 | endif | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 2097 | ifdef BOARD_ODMIMAGE_FILE_SYSTEM_TYPE | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 2098 | $(hide) cd $(dir $@) && zip -qryX $(notdir $@) \ | 
|  | 2099 | $(TARGET_COPY_OUT_ODM) | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 2100 | endif | 
| Colin Cross | c451a37 | 2013-12-18 19:36:44 -0800 | [diff] [blame] | 2101 | ifneq ($(PDK_PLATFORM_JAVA_ZIP_CONTENTS),) | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 2102 | $(hide) cd $(OUT_DIR) && zip -qryX $(patsubst $(OUT_DIR)/%,%,$@) $(PDK_PLATFORM_JAVA_ZIP_CONTENTS) | 
| Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 2103 | endif | 
| keunyoung | c017806 | 2013-07-22 14:54:58 -0700 | [diff] [blame] | 2104 | ifneq ($(PDK_PLATFORM_ZIP_PRODUCT_BINARIES),) | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 2105 | $(hide) zip -qryX $@ $(PDK_PLATFORM_ZIP_PRODUCT_BINARIES) | 
| keunyoung | c017806 | 2013-07-22 14:54:58 -0700 | [diff] [blame] | 2106 | endif | 
| Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2107 | @# Add dex-preopt files and config. | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 2108 | $(if $(PRIVATE_DEX_FILES),$(hide) cd $(OUT_DIR) && zip -qryX $(patsubst $(OUT_DIR)/%,%,$@ $(PRIVATE_DEX_FILES))) | 
|  | 2109 | $(hide) touch $(PRODUCT_OUT)/pdk.mk | 
|  | 2110 | $(hide) zip -qryXj $@ $(PRIVATE_ODEX_CONFIG) $(PRODUCT_OUT)/pdk.mk | 
| Ying Wang | 4c289e5 | 2012-03-30 13:52:54 -0700 | [diff] [blame] | 2111 |  | 
|  | 2112 | .PHONY: platform | 
| Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 2113 | platform: $(INSTALLED_PLATFORM_ZIP) | 
|  | 2114 |  | 
|  | 2115 | .PHONY: platform-java | 
|  | 2116 | platform-java: platform | 
| Ying Wang | 4c289e5 | 2012-03-30 13:52:54 -0700 | [diff] [blame] | 2117 |  | 
|  | 2118 | # Dist the platform.zip | 
| Keun young Park | 3e93aea | 2012-05-29 17:55:46 -0700 | [diff] [blame] | 2119 | ifneq (,$(filter platform platform-java, $(MAKECMDGOALS))) | 
|  | 2120 | $(call dist-for-goals, platform platform-java, $(INSTALLED_PLATFORM_ZIP)) | 
| Ying Wang | 4c289e5 | 2012-03-30 13:52:54 -0700 | [diff] [blame] | 2121 | endif | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2122 |  | 
| Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 2123 | # ----------------------------------------------------------------- | 
| Bruce Beare | 52aac20 | 2010-06-04 15:24:49 -0700 | [diff] [blame] | 2124 | ## boot tarball | 
|  | 2125 | define build-boottarball-target | 
| Bruce Beare | 45ac434 | 2010-06-24 14:02:00 -0700 | [diff] [blame] | 2126 | $(hide) echo "Target boot fs tarball: $(INSTALLED_BOOTTARBALL_TARGET)" | 
| Bruce Beare | 52aac20 | 2010-06-04 15:24:49 -0700 | [diff] [blame] | 2127 | $(hide) mkdir -p $(PRODUCT_OUT)/boot | 
|  | 2128 | $(hide) cp -f $(INTERNAL_BOOTIMAGE_FILES) $(PRODUCT_OUT)/boot/. | 
| Dan Willemsen | c1f17ff | 2016-10-05 16:57:27 -0700 | [diff] [blame] | 2129 | $(hide) echo $(INTERNAL_KERNEL_CMDLINE) > $(PRODUCT_OUT)/boot/cmdline | 
| Bruce Beare | 52aac20 | 2010-06-04 15:24:49 -0700 | [diff] [blame] | 2130 | $(hide) $(MKTARBALL) $(FS_GET_STATS) \ | 
|  | 2131 | $(PRODUCT_OUT) boot $(PRIVATE_BOOT_TAR) \ | 
| Thierry Strudel | 74a81e6 | 2015-07-09 09:54:55 -0700 | [diff] [blame] | 2132 | $(INSTALLED_BOOTTARBALL_TARGET) $(TARGET_OUT) | 
| Bruce Beare | 52aac20 | 2010-06-04 15:24:49 -0700 | [diff] [blame] | 2133 | endef | 
|  | 2134 |  | 
|  | 2135 | ifndef BOOT_TARBALL_FORMAT | 
|  | 2136 | BOOT_TARBALL_FORMAT := bz2 | 
|  | 2137 | endif | 
|  | 2138 |  | 
|  | 2139 | boot_tar := $(PRODUCT_OUT)/boot.tar | 
|  | 2140 | INSTALLED_BOOTTARBALL_TARGET := $(boot_tar).$(BOOT_TARBALL_FORMAT) | 
|  | 2141 | $(INSTALLED_BOOTTARBALL_TARGET): PRIVATE_BOOT_TAR := $(boot_tar) | 
|  | 2142 | $(INSTALLED_BOOTTARBALL_TARGET): $(FS_GET_STATS) $(INTERNAL_BOOTIMAGE_FILES) | 
|  | 2143 | $(build-boottarball-target) | 
|  | 2144 |  | 
|  | 2145 | .PHONY: boottarball-nodeps btnod | 
|  | 2146 | boottarball-nodeps btnod: $(FS_GET_STATS) \ | 
|  | 2147 | $(filter-out boottarball-nodeps btnod,$(MAKECMDGOALS)) | 
|  | 2148 | $(build-boottarball-target) | 
|  | 2149 |  | 
|  | 2150 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2151 | # ----------------------------------------------------------------- | 
|  | 2152 | # data partition image | 
|  | 2153 | INTERNAL_USERDATAIMAGE_FILES := \ | 
| Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2154 | $(filter $(TARGET_OUT_DATA)/%,$(ALL_DEFAULT_INSTALLED_MODULES)) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2155 |  | 
| Ying Wang | d7321d3 | 2013-03-15 10:32:29 -0700 | [diff] [blame] | 2156 | # Don't build userdata.img if it's extfs but no partition size | 
|  | 2157 | skip_userdata.img := | 
|  | 2158 | ifdef INTERNAL_USERIMAGES_EXT_VARIANT | 
|  | 2159 | ifndef BOARD_USERDATAIMAGE_PARTITION_SIZE | 
|  | 2160 | skip_userdata.img := true | 
|  | 2161 | endif | 
|  | 2162 | endif | 
|  | 2163 |  | 
|  | 2164 | ifneq ($(skip_userdata.img),true) | 
| Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 2165 | userdataimage_intermediates := \ | 
| Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2166 | $(call intermediates-dir-for,PACKAGING,userdata) | 
| Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 2167 | BUILT_USERDATAIMAGE_TARGET := $(PRODUCT_OUT)/userdata.img | 
|  | 2168 |  | 
| Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 2169 | define build-userdataimage-target | 
|  | 2170 | $(call pretty,"Target userdata fs image: $(INSTALLED_USERDATAIMAGE_TARGET)") | 
|  | 2171 | @mkdir -p $(TARGET_OUT_DATA) | 
|  | 2172 | @mkdir -p $(userdataimage_intermediates) && rm -rf $(userdataimage_intermediates)/userdata_image_info.txt | 
| Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 2173 | $(call generate-image-prop-dictionary, $(userdataimage_intermediates)/userdata_image_info.txt,userdata,skip_fsck=true) | 
| Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 2174 | $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \ | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 2175 | build/make/tools/releasetools/build_image.py \ | 
| Thierry Strudel | 74a81e6 | 2015-07-09 09:54:55 -0700 | [diff] [blame] | 2176 | $(TARGET_OUT_DATA) $(userdataimage_intermediates)/userdata_image_info.txt $(INSTALLED_USERDATAIMAGE_TARGET) $(TARGET_OUT) | 
| JP Abgrall | 0ed7cec | 2014-06-16 14:19:36 -0700 | [diff] [blame] | 2177 | $(hide) $(call assert-max-image-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_PARTITION_SIZE)) | 
| Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 2178 | endef | 
|  | 2179 |  | 
| Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 2180 | # We just build this directly to the install location. | 
|  | 2181 | INSTALLED_USERDATAIMAGE_TARGET := $(BUILT_USERDATAIMAGE_TARGET) | 
| Andreas Gampe | 039b5c7 | 2017-03-24 16:06:31 -0700 | [diff] [blame] | 2182 | INSTALLED_USERDATAIMAGE_TARGET_DEPS := \ | 
|  | 2183 | $(INTERNAL_USERIMAGES_DEPS) \ | 
|  | 2184 | $(INTERNAL_USERDATAIMAGE_FILES) \ | 
|  | 2185 | $(BUILD_IMAGE_SRCS) | 
|  | 2186 | $(INSTALLED_USERDATAIMAGE_TARGET): $(INSTALLED_USERDATAIMAGE_TARGET_DEPS) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2187 | $(build-userdataimage-target) | 
|  | 2188 |  | 
|  | 2189 | .PHONY: userdataimage-nodeps | 
| Colin Cross | 144b028 | 2010-05-10 13:04:47 -0700 | [diff] [blame] | 2190 | userdataimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2191 | $(build-userdataimage-target) | 
|  | 2192 |  | 
| Ying Wang | d7321d3 | 2013-03-15 10:32:29 -0700 | [diff] [blame] | 2193 | endif # not skip_userdata.img | 
|  | 2194 | skip_userdata.img := | 
| Ying Wang | e215ed5 | 2012-10-15 14:36:22 -0700 | [diff] [blame] | 2195 |  | 
| Andreas Gampe | 039b5c7 | 2017-03-24 16:06:31 -0700 | [diff] [blame] | 2196 | # ASAN libraries in the system image - build rule. | 
|  | 2197 | ASAN_OUT_DIRS_FOR_SYSTEM_INSTALL := $(sort $(patsubst $(PRODUCT_OUT)/%,%,\ | 
|  | 2198 | $(TARGET_OUT_SHARED_LIBRARIES) \ | 
|  | 2199 | $(2ND_TARGET_OUT_SHARED_LIBRARIES) \ | 
|  | 2200 | $(TARGET_OUT_VENDOR_SHARED_LIBRARIES) \ | 
|  | 2201 | $(2ND_TARGET_OUT_VENDOR_SHARED_LIBRARIES))) | 
| Andreas Gampe | 2c498a3 | 2017-03-30 16:54:23 -0700 | [diff] [blame] | 2202 | # Extra options: Enforce the system user for the files to avoid having to change ownership. | 
|  | 2203 | ASAN_SYSTEM_INSTALL_OPTIONS := --owner=1000 --group=1000 | 
| Andreas Gampe | 039b5c7 | 2017-03-24 16:06:31 -0700 | [diff] [blame] | 2204 | # Note: experimentally, it seems not worth it to try to get "best" compression. We don't save | 
|  | 2205 | #       enough space. | 
|  | 2206 | $(ASAN_IN_SYSTEM_INSTALLED): $(INSTALLED_USERDATAIMAGE_TARGET_DEPS) | 
| Andreas Gampe | 2c498a3 | 2017-03-30 16:54:23 -0700 | [diff] [blame] | 2207 | 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] | 2208 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2209 | ####### | 
|  | 2210 | ## data partition tarball | 
|  | 2211 | define build-userdatatarball-target | 
|  | 2212 | $(call pretty,"Target userdata fs tarball: " \ | 
|  | 2213 | "$(INSTALLED_USERDATATARBALL_TARGET)") | 
|  | 2214 | $(MKTARBALL) $(FS_GET_STATS) \ | 
|  | 2215 | $(PRODUCT_OUT) data $(PRIVATE_USERDATA_TAR) \ | 
| Thierry Strudel | 74a81e6 | 2015-07-09 09:54:55 -0700 | [diff] [blame] | 2216 | $(INSTALLED_USERDATATARBALL_TARGET) $(TARGET_OUT) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2217 | endef | 
|  | 2218 |  | 
|  | 2219 | userdata_tar := $(PRODUCT_OUT)/userdata.tar | 
|  | 2220 | INSTALLED_USERDATATARBALL_TARGET := $(userdata_tar).bz2 | 
|  | 2221 | $(INSTALLED_USERDATATARBALL_TARGET): PRIVATE_USERDATA_TAR := $(userdata_tar) | 
|  | 2222 | $(INSTALLED_USERDATATARBALL_TARGET): $(FS_GET_STATS) $(INTERNAL_USERDATAIMAGE_FILES) | 
|  | 2223 | $(build-userdatatarball-target) | 
|  | 2224 |  | 
| Dan Willemsen | 69af2e4 | 2016-08-16 16:36:05 -0700 | [diff] [blame] | 2225 | $(call dist-for-goals,userdatatarball,$(INSTALLED_USERDATATARBALL_TARGET)) | 
|  | 2226 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2227 | .PHONY: userdatatarball-nodeps | 
|  | 2228 | userdatatarball-nodeps: $(FS_GET_STATS) | 
|  | 2229 | $(build-userdatatarball-target) | 
|  | 2230 |  | 
|  | 2231 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 2232 | # ----------------------------------------------------------------- | 
| David Zeuthen | 2532862 | 2016-04-08 15:08:03 -0400 | [diff] [blame] | 2233 | # partition table image | 
|  | 2234 | ifdef BOARD_BPT_INPUT_FILES | 
|  | 2235 |  | 
|  | 2236 | BUILT_BPTIMAGE_TARGET := $(PRODUCT_OUT)/partition-table.img | 
| Casey Dahlin | 04d15dd | 2016-08-19 10:59:57 -0700 | [diff] [blame] | 2237 | BUILT_BPTJSON_TARGET := $(PRODUCT_OUT)/partition-table.bpt | 
| David Zeuthen | 2532862 | 2016-04-08 15:08:03 -0400 | [diff] [blame] | 2238 |  | 
|  | 2239 | INTERNAL_BVBTOOL_MAKE_TABLE_ARGS := \ | 
|  | 2240 | --output_gpt $(BUILT_BPTIMAGE_TARGET) \ | 
| Casey Dahlin | 04d15dd | 2016-08-19 10:59:57 -0700 | [diff] [blame] | 2241 | --output_json $(BUILT_BPTJSON_TARGET) \ | 
| David Zeuthen | 2532862 | 2016-04-08 15:08:03 -0400 | [diff] [blame] | 2242 | $(foreach file, $(BOARD_BPT_INPUT_FILES), --input $(file)) | 
|  | 2243 |  | 
|  | 2244 | ifdef BOARD_BPT_DISK_SIZE | 
|  | 2245 | INTERNAL_BVBTOOL_MAKE_TABLE_ARGS += --disk_size $(BOARD_BPT_DISK_SIZE) | 
|  | 2246 | endif | 
|  | 2247 |  | 
|  | 2248 | define build-bptimage-target | 
|  | 2249 | $(call pretty,"Target partition table image: $(INSTALLED_BPTIMAGE_TARGET)") | 
|  | 2250 | $(hide) $(BPTTOOL) make_table $(INTERNAL_BVBTOOL_MAKE_TABLE_ARGS) $(BOARD_BPT_MAKE_TABLE_ARGS) | 
|  | 2251 | endef | 
|  | 2252 |  | 
|  | 2253 | INSTALLED_BPTIMAGE_TARGET := $(BUILT_BPTIMAGE_TARGET) | 
| Casey Dahlin | 04d15dd | 2016-08-19 10:59:57 -0700 | [diff] [blame] | 2254 | $(BUILT_BPTJSON_TARGET): $(INSTALLED_BPTIMAGE_TARGET) | 
|  | 2255 | $(hide) touch -c $(BUILT_BPTJSON_TARGET) | 
|  | 2256 |  | 
| David Zeuthen | 2532862 | 2016-04-08 15:08:03 -0400 | [diff] [blame] | 2257 | $(INSTALLED_BPTIMAGE_TARGET): $(BPTTOOL) $(BOARD_BPT_INPUT_FILES) | 
|  | 2258 | $(build-bptimage-target) | 
|  | 2259 |  | 
|  | 2260 | .PHONY: bptimage-nodeps | 
|  | 2261 | bptimage-nodeps: | 
|  | 2262 | $(build-bptimage-target) | 
|  | 2263 |  | 
|  | 2264 | endif # BOARD_BPT_INPUT_FILES | 
|  | 2265 |  | 
|  | 2266 | # ----------------------------------------------------------------- | 
| Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2267 | # cache partition image | 
|  | 2268 | ifdef BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE | 
|  | 2269 | INTERNAL_CACHEIMAGE_FILES := \ | 
|  | 2270 | $(filter $(TARGET_OUT_CACHE)/%,$(ALL_DEFAULT_INSTALLED_MODULES)) | 
|  | 2271 |  | 
|  | 2272 | cacheimage_intermediates := \ | 
|  | 2273 | $(call intermediates-dir-for,PACKAGING,cache) | 
|  | 2274 | BUILT_CACHEIMAGE_TARGET := $(PRODUCT_OUT)/cache.img | 
|  | 2275 |  | 
|  | 2276 | define build-cacheimage-target | 
|  | 2277 | $(call pretty,"Target cache fs image: $(INSTALLED_CACHEIMAGE_TARGET)") | 
|  | 2278 | @mkdir -p $(TARGET_OUT_CACHE) | 
|  | 2279 | @mkdir -p $(cacheimage_intermediates) && rm -rf $(cacheimage_intermediates)/cache_image_info.txt | 
| Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 2280 | $(call generate-image-prop-dictionary, $(cacheimage_intermediates)/cache_image_info.txt,cache,skip_fsck=true) | 
| Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2281 | $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \ | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 2282 | build/make/tools/releasetools/build_image.py \ | 
| Thierry Strudel | 74a81e6 | 2015-07-09 09:54:55 -0700 | [diff] [blame] | 2283 | $(TARGET_OUT_CACHE) $(cacheimage_intermediates)/cache_image_info.txt $(INSTALLED_CACHEIMAGE_TARGET) $(TARGET_OUT) | 
| JP Abgrall | 0ed7cec | 2014-06-16 14:19:36 -0700 | [diff] [blame] | 2284 | $(hide) $(call assert-max-image-size,$(INSTALLED_CACHEIMAGE_TARGET),$(BOARD_CACHEIMAGE_PARTITION_SIZE)) | 
| Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2285 | endef | 
|  | 2286 |  | 
|  | 2287 | # We just build this directly to the install location. | 
|  | 2288 | INSTALLED_CACHEIMAGE_TARGET := $(BUILT_CACHEIMAGE_TARGET) | 
| Shinichiro Hamaji | 3deb87d | 2016-04-19 18:41:27 +0900 | [diff] [blame] | 2289 | $(INSTALLED_CACHEIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) $(INTERNAL_CACHEIMAGE_FILES) $(BUILD_IMAGE_SRCS) | 
| Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2290 | $(build-cacheimage-target) | 
|  | 2291 |  | 
|  | 2292 | .PHONY: cacheimage-nodeps | 
|  | 2293 | cacheimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS) | 
|  | 2294 | $(build-cacheimage-target) | 
|  | 2295 |  | 
| Patrick Tjin | f3b0dc2 | 2016-05-13 15:26:09 -0700 | [diff] [blame] | 2296 | else # BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE | 
|  | 2297 | # we need to ignore the broken cache link when doing the rsync | 
|  | 2298 | IGNORE_CACHE_LINK := --exclude=cache | 
| Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2299 | endif # BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE | 
|  | 2300 |  | 
| David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 2301 | # ----------------------------------------------------------------- | 
| Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2302 | # system_other partition image | 
|  | 2303 | ifeq ($(BOARD_USES_SYSTEM_OTHER_ODEX),true) | 
|  | 2304 | BOARD_USES_SYSTEM_OTHER := true | 
|  | 2305 |  | 
|  | 2306 | # Marker file to identify that odex files are installed | 
|  | 2307 | INSTALLED_SYSTEM_OTHER_ODEX_MARKER := $(TARGET_OUT_SYSTEM_OTHER)/system-other-odex-marker | 
|  | 2308 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_SYSTEM_OTHER_ODEX_MARKER) | 
|  | 2309 | $(INSTALLED_SYSTEM_OTHER_ODEX_MARKER): | 
|  | 2310 | $(hide) touch $@ | 
|  | 2311 | endif | 
|  | 2312 |  | 
|  | 2313 | ifdef BOARD_USES_SYSTEM_OTHER | 
|  | 2314 | INTERNAL_SYSTEMOTHERIMAGE_FILES := \ | 
|  | 2315 | $(filter $(TARGET_OUT_SYSTEM_OTHER)/%,\ | 
|  | 2316 | $(ALL_DEFAULT_INSTALLED_MODULES)\ | 
| Dan Willemsen | 0663f68 | 2018-03-06 14:07:21 -0800 | [diff] [blame] | 2317 | $(ALL_PDK_FUSION_FILES)) \ | 
|  | 2318 | $(PDK_FUSION_SYMLINK_STAMP) | 
| Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2319 |  | 
|  | 2320 | INSTALLED_FILES_FILE_SYSTEMOTHER := $(PRODUCT_OUT)/installed-files-system-other.txt | 
| Colin Cross | 23dded0 | 2018-06-13 14:04:22 -0700 | [diff] [blame] | 2321 | INSTALLED_FILES_JSON_SYSTEMOTHER := $(INSTALLED_FILES_FILE_SYSTEMOTHER:.txt=.json) | 
|  | 2322 | $(INSTALLED_FILES_FILE_SYSTEMOTHER): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_SYSTEMOTHER) | 
| Makoto Onuki | 9fe97e2 | 2017-03-16 09:41:19 -0700 | [diff] [blame] | 2323 | $(INSTALLED_FILES_FILE_SYSTEMOTHER) : $(INTERNAL_SYSTEMOTHERIMAGE_FILES) $(FILESLIST) | 
| Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2324 | @echo Installed file list: $@ | 
|  | 2325 | @mkdir -p $(dir $@) | 
|  | 2326 | @rm -f $@ | 
| Makoto Onuki | 9fe97e2 | 2017-03-16 09:41:19 -0700 | [diff] [blame] | 2327 | $(hide) $(FILESLIST) $(TARGET_OUT_SYSTEM_OTHER) > $(@:.txt=.json) | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 2328 | $(hide) build/make/tools/fileslist_util.py -c $(@:.txt=.json) > $@ | 
| Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2329 |  | 
|  | 2330 | systemotherimage_intermediates := \ | 
|  | 2331 | $(call intermediates-dir-for,PACKAGING,system_other) | 
|  | 2332 | BUILT_SYSTEMOTHERIMAGE_TARGET := $(PRODUCT_OUT)/system_other.img | 
|  | 2333 |  | 
|  | 2334 | # Note that we assert the size is SYSTEMIMAGE_PARTITION_SIZE since this is the 'b' system image. | 
|  | 2335 | define build-systemotherimage-target | 
|  | 2336 | $(call pretty,"Target system_other fs image: $(INSTALLED_SYSTEMOTHERIMAGE_TARGET)") | 
|  | 2337 | @mkdir -p $(TARGET_OUT_SYSTEM_OTHER) | 
|  | 2338 | @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] | 2339 | $(call generate-image-prop-dictionary, $(systemotherimage_intermediates)/system_other_image_info.txt,system,skip_fsck=true) | 
| Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2340 | $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \ | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 2341 | build/make/tools/releasetools/build_image.py \ | 
| Yifan Hong | bbcba1e | 2018-06-18 16:32:35 -0700 | [diff] [blame] | 2342 | $(TARGET_OUT_SYSTEM_OTHER) $(systemotherimage_intermediates)/system_other_image_info.txt $(INSTALLED_SYSTEMOTHERIMAGE_TARGET) $(TARGET_OUT)\ | 
|  | 2343 | $(systemotherimage_intermediates)/generated_system_other_image_info.txt | 
|  | 2344 | $(hide) $(call assert-max-image-size,$(INSTALLED_SYSTEMOTHERIMAGE_TARGET),\ | 
|  | 2345 | $(call read-image-prop-dictionary,\ | 
|  | 2346 | $(systemotherimage_intermediates)/generated_system_other_image_info.txt,system_size)) | 
| Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2347 | endef | 
|  | 2348 |  | 
|  | 2349 | # We just build this directly to the install location. | 
|  | 2350 | INSTALLED_SYSTEMOTHERIMAGE_TARGET := $(BUILT_SYSTEMOTHERIMAGE_TARGET) | 
| Andreas Gampe | 4ed21d1 | 2017-06-16 10:24:54 -0700 | [diff] [blame] | 2351 | ifneq (true,$(SANITIZE_LITE)) | 
|  | 2352 | # 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] | 2353 | $(INSTALLED_SYSTEMOTHERIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) $(INTERNAL_SYSTEMOTHERIMAGE_FILES) $(INSTALLED_FILES_FILE_SYSTEMOTHER) | 
|  | 2354 | $(build-systemotherimage-target) | 
| Andreas Gampe | 4ed21d1 | 2017-06-16 10:24:54 -0700 | [diff] [blame] | 2355 | endif | 
| Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 2356 |  | 
|  | 2357 | .PHONY: systemotherimage-nodeps | 
|  | 2358 | systemotherimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS) | 
|  | 2359 | $(build-systemotherimage-target) | 
|  | 2360 |  | 
|  | 2361 | endif # BOARD_USES_SYSTEM_OTHER | 
|  | 2362 |  | 
|  | 2363 |  | 
|  | 2364 | # ----------------------------------------------------------------- | 
| Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2365 | # vendor partition image | 
|  | 2366 | ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE | 
|  | 2367 | INTERNAL_VENDORIMAGE_FILES := \ | 
| Ying Wang | cff3862 | 2014-07-16 17:46:35 -0700 | [diff] [blame] | 2368 | $(filter $(TARGET_OUT_VENDOR)/%,\ | 
|  | 2369 | $(ALL_DEFAULT_INSTALLED_MODULES)\ | 
| Dan Willemsen | 0663f68 | 2018-03-06 14:07:21 -0800 | [diff] [blame] | 2370 | $(ALL_PDK_FUSION_FILES)) \ | 
|  | 2371 | $(PDK_FUSION_SYMLINK_STAMP) | 
| Ying Wang | cff3862 | 2014-07-16 17:46:35 -0700 | [diff] [blame] | 2372 |  | 
| Steven Moreland | 627debe | 2018-05-01 09:54:21 -0700 | [diff] [blame] | 2373 | # Final Vendor VINTF manifest including fragments. This is not assembled | 
|  | 2374 | # on the device because it depends on everything in a given device | 
|  | 2375 | # image which defines a vintf_fragment. | 
|  | 2376 | ifdef BUILT_VENDOR_MANIFEST | 
|  | 2377 | BUILT_ASSEMBLED_VENDOR_MANIFEST := $(PRODUCT_OUT)/verified_assembled_vendor_manifest.xml | 
|  | 2378 | ifeq (true,$(strip $(PRODUCT_ENFORCE_VINTF_MANIFEST))) | 
|  | 2379 | ifdef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE | 
|  | 2380 | # TODO(b/65028233): turn this on globally | 
|  | 2381 | $(BUILT_ASSEMBLED_VENDOR_MANIFEST): PRIVATE_SYSTEM_ASSEMBLE_VINTF_ENV_VARS := VINTF_ENFORCE_NO_UNUSED_HALS=true | 
|  | 2382 | endif # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE | 
|  | 2383 | endif # PRODUCT_ENFORCE_VINTF_MANIFEST | 
|  | 2384 | $(BUILT_ASSEMBLED_VENDOR_MANIFEST): $(HOST_OUT_EXECUTABLES)/assemble_vintf | 
|  | 2385 | $(BUILT_ASSEMBLED_VENDOR_MANIFEST): $(BUILT_SYSTEM_MATRIX) | 
|  | 2386 | $(BUILT_ASSEMBLED_VENDOR_MANIFEST): $(BUILT_VENDOR_MANIFEST) | 
|  | 2387 | $(BUILT_ASSEMBLED_VENDOR_MANIFEST): $(INTERNAL_VENDORIMAGE_FILES) | 
|  | 2388 | @echo "Verifying vendor VINTF manifest." | 
|  | 2389 | PRODUCT_ENFORCE_VINTF_MANIFEST=$(PRODUCT_ENFORCE_VINTF_MANIFEST) \ | 
|  | 2390 | $(PRIVATE_SYSTEM_ASSEMBLE_VINTF_ENV_VARS) \ | 
|  | 2391 | $(HOST_OUT_EXECUTABLES)/assemble_vintf \ | 
|  | 2392 | -c $(BUILT_SYSTEM_MATRIX) \ | 
|  | 2393 | -i $(BUILT_VENDOR_MANIFEST) \ | 
|  | 2394 | $$([ -d $(TARGET_OUT_VENDOR)/etc/vintf/manifest ] && \ | 
|  | 2395 | find $(TARGET_OUT_VENDOR)/etc/vintf/manifest -type f -name "*.xml" | \ | 
|  | 2396 | sed "s/^/-i /" | tr '\n' ' ') -o $@ | 
|  | 2397 | endif # BUILT_VENDOR_MANIFEST | 
|  | 2398 |  | 
| Ying Wang | cff3862 | 2014-07-16 17:46:35 -0700 | [diff] [blame] | 2399 | # platform.zip depends on $(INTERNAL_VENDORIMAGE_FILES). | 
|  | 2400 | $(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_VENDORIMAGE_FILES) | 
| Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2401 |  | 
| Ying Wang | 8da19e3 | 2015-09-15 14:22:12 -0700 | [diff] [blame] | 2402 | INSTALLED_FILES_FILE_VENDOR := $(PRODUCT_OUT)/installed-files-vendor.txt | 
| Colin Cross | 23dded0 | 2018-06-13 14:04:22 -0700 | [diff] [blame] | 2403 | INSTALLED_FILES_JSON_VENDOR := $(INSTALLED_FILES_FILE_VENDOR:.txt=.json) | 
|  | 2404 | $(INSTALLED_FILES_FILE_VENDOR): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_VENDOR) | 
| Makoto Onuki | 9fe97e2 | 2017-03-16 09:41:19 -0700 | [diff] [blame] | 2405 | $(INSTALLED_FILES_FILE_VENDOR) : $(INTERNAL_VENDORIMAGE_FILES) $(FILESLIST) | 
| Ying Wang | 8da19e3 | 2015-09-15 14:22:12 -0700 | [diff] [blame] | 2406 | @echo Installed file list: $@ | 
|  | 2407 | @mkdir -p $(dir $@) | 
|  | 2408 | @rm -f $@ | 
| Makoto Onuki | 9fe97e2 | 2017-03-16 09:41:19 -0700 | [diff] [blame] | 2409 | $(hide) $(FILESLIST) $(TARGET_OUT_VENDOR) > $(@:.txt=.json) | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 2410 | $(hide) build/make/tools/fileslist_util.py -c $(@:.txt=.json) > $@ | 
| Ying Wang | 8da19e3 | 2015-09-15 14:22:12 -0700 | [diff] [blame] | 2411 |  | 
| Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2412 | vendorimage_intermediates := \ | 
|  | 2413 | $(call intermediates-dir-for,PACKAGING,vendor) | 
|  | 2414 | BUILT_VENDORIMAGE_TARGET := $(PRODUCT_OUT)/vendor.img | 
| Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2415 | define build-vendorimage-target | 
|  | 2416 | $(call pretty,"Target vendor fs image: $(INSTALLED_VENDORIMAGE_TARGET)") | 
|  | 2417 | @mkdir -p $(TARGET_OUT_VENDOR) | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 2418 | $(call create-vendor-odm-symlink) | 
| Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2419 | @mkdir -p $(vendorimage_intermediates) && rm -rf $(vendorimage_intermediates)/vendor_image_info.txt | 
| Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 2420 | $(call generate-image-prop-dictionary, $(vendorimage_intermediates)/vendor_image_info.txt,vendor,skip_fsck=true) | 
| Howard Chen | 1756f8d | 2017-02-22 17:27:10 +0800 | [diff] [blame] | 2421 | $(if $(BOARD_VENDOR_KERNEL_MODULES), \ | 
|  | 2422 | $(call build-image-kernel-modules,$(BOARD_VENDOR_KERNEL_MODULES),$(TARGET_OUT_VENDOR),vendor/,$(call intermediates-dir-for,PACKAGING,depmod_vendor))) | 
| Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2423 | $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \ | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 2424 | build/make/tools/releasetools/build_image.py \ | 
| Yifan Hong | 749062d | 2018-06-19 16:23:16 -0700 | [diff] [blame] | 2425 | $(TARGET_OUT_VENDOR) $(vendorimage_intermediates)/vendor_image_info.txt $(INSTALLED_VENDORIMAGE_TARGET) $(TARGET_OUT) \ | 
|  | 2426 | $(vendorimage_intermediates)/generated_vendor_image_info.txt | 
|  | 2427 | $(hide) $(call assert-max-image-size,$(INSTALLED_VENDORIMAGE_TARGET),\ | 
|  | 2428 | $(call read-image-prop-dictionary,\ | 
|  | 2429 | $(vendorimage_intermediates)/generated_vendor_image_info.txt,vendor_size)) | 
| Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2430 | endef | 
|  | 2431 |  | 
|  | 2432 | # We just build this directly to the install location. | 
|  | 2433 | INSTALLED_VENDORIMAGE_TARGET := $(BUILT_VENDORIMAGE_TARGET) | 
| Steven Moreland | 627debe | 2018-05-01 09:54:21 -0700 | [diff] [blame] | 2434 | ifdef BUILT_VENDOR_MANIFEST | 
|  | 2435 | $(INSTALLED_VENDORIMAGE_TARGET): $(BUILT_ASSEMBLED_VENDOR_MANIFEST) | 
|  | 2436 | endif | 
| Howard Chen | 1756f8d | 2017-02-22 17:27:10 +0800 | [diff] [blame] | 2437 | $(INSTALLED_VENDORIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) $(INTERNAL_VENDORIMAGE_FILES) $(INSTALLED_FILES_FILE_VENDOR) $(BUILD_IMAGE_SRCS) $(DEPMOD) $(BOARD_VENDOR_KERNEL_MODULES) | 
| Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2438 | $(build-vendorimage-target) | 
|  | 2439 |  | 
| Steven Moreland | a2e734d | 2017-03-07 12:10:09 -0800 | [diff] [blame] | 2440 | .PHONY: vendorimage-nodeps vnod | 
|  | 2441 | vendorimage-nodeps vnod: | $(INTERNAL_USERIMAGES_DEPS) $(DEPMOD) | 
| Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2442 | $(build-vendorimage-target) | 
|  | 2443 |  | 
| Colin Cross | 91a5227 | 2017-06-20 16:57:52 -0700 | [diff] [blame] | 2444 | sync: $(INTERNAL_VENDORIMAGE_FILES) | 
|  | 2445 |  | 
| Dan Willemsen | 6c3e79b | 2016-06-17 14:07:37 -0700 | [diff] [blame] | 2446 | else ifdef BOARD_PREBUILT_VENDORIMAGE | 
|  | 2447 | INSTALLED_VENDORIMAGE_TARGET := $(PRODUCT_OUT)/vendor.img | 
|  | 2448 | $(eval $(call copy-one-file,$(BOARD_PREBUILT_VENDORIMAGE),$(INSTALLED_VENDORIMAGE_TARGET))) | 
|  | 2449 | endif | 
| Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 2450 |  | 
| Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 2451 | # ----------------------------------------------------------------- | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2452 | # product partition image | 
|  | 2453 | ifdef BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE | 
|  | 2454 | INTERNAL_PRODUCTIMAGE_FILES := \ | 
|  | 2455 | $(filter $(TARGET_OUT_PRODUCT)/%,\ | 
|  | 2456 | $(ALL_DEFAULT_INSTALLED_MODULES)\ | 
| Dan Willemsen | 0663f68 | 2018-03-06 14:07:21 -0800 | [diff] [blame] | 2457 | $(ALL_PDK_FUSION_FILES)) \ | 
|  | 2458 | $(PDK_FUSION_SYMLINK_STAMP) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2459 |  | 
|  | 2460 | # platform.zip depends on $(INTERNAL_PRODUCTIMAGE_FILES). | 
|  | 2461 | $(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_PRODUCTIMAGE_FILES) | 
|  | 2462 |  | 
|  | 2463 | INSTALLED_FILES_FILE_PRODUCT := $(PRODUCT_OUT)/installed-files-product.txt | 
| Colin Cross | 23dded0 | 2018-06-13 14:04:22 -0700 | [diff] [blame] | 2464 | INSTALLED_FILES_JSON_PRODUCT := $(INSTALLED_FILES_FILE_PRODUCT:.txt=.json) | 
|  | 2465 | $(INSTALLED_FILES_FILE_PRODUCT): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_PRODUCT) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2466 | $(INSTALLED_FILES_FILE_PRODUCT) : $(INTERNAL_PRODUCTIMAGE_FILES) $(FILESLIST) | 
|  | 2467 | @echo Installed file list: $@ | 
|  | 2468 | @mkdir -p $(dir $@) | 
|  | 2469 | @rm -f $@ | 
|  | 2470 | $(hide) $(FILESLIST) $(TARGET_OUT_PRODUCT) > $(@:.txt=.json) | 
|  | 2471 | $(hide) build/tools/fileslist_util.py -c $(@:.txt=.json) > $@ | 
|  | 2472 |  | 
|  | 2473 | productimage_intermediates := \ | 
|  | 2474 | $(call intermediates-dir-for,PACKAGING,product) | 
|  | 2475 | BUILT_PRODUCTIMAGE_TARGET := $(PRODUCT_OUT)/product.img | 
|  | 2476 | define build-productimage-target | 
|  | 2477 | $(call pretty,"Target product fs image: $(INSTALLED_PRODUCTIMAGE_TARGET)") | 
|  | 2478 | @mkdir -p $(TARGET_OUT_PRODUCT) | 
|  | 2479 | @mkdir -p $(productimage_intermediates) && rm -rf $(productimage_intermediates)/product_image_info.txt | 
| Yifan Hong | 760d3c0 | 2018-05-30 11:16:46 -0700 | [diff] [blame] | 2480 | $(call generate-image-prop-dictionary, $(productimage_intermediates)/product_image_info.txt,product,skip_fsck=true) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2481 | $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \ | 
|  | 2482 | ./build/tools/releasetools/build_image.py \ | 
| Yifan Hong | 56a6c3b | 2018-07-20 15:19:34 -0700 | [diff] [blame] | 2483 | $(TARGET_OUT_PRODUCT) $(productimage_intermediates)/product_image_info.txt $(INSTALLED_PRODUCTIMAGE_TARGET) $(TARGET_OUT) \ | 
|  | 2484 | $(productimage_intermediates)/generated_product_image_info.txt | 
|  | 2485 | $(hide) $(call assert-max-image-size,$(INSTALLED_PRODUCTIMAGE_TARGET),\ | 
|  | 2486 | $(call read-image-prop-dictionary,\ | 
|  | 2487 | $(productimage_intermediates)/generated_product_image_info.txt,product_size)) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2488 | endef | 
|  | 2489 |  | 
|  | 2490 | # We just build this directly to the install location. | 
|  | 2491 | INSTALLED_PRODUCTIMAGE_TARGET := $(BUILT_PRODUCTIMAGE_TARGET) | 
|  | 2492 | $(INSTALLED_PRODUCTIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) $(INTERNAL_PRODUCTIMAGE_FILES) $(INSTALLED_FILES_FILE_PRODUCT) $(BUILD_IMAGE_SRCS) | 
|  | 2493 | $(build-productimage-target) | 
|  | 2494 |  | 
|  | 2495 | .PHONY: productimage-nodeps pnod | 
|  | 2496 | productimage-nodeps pnod: | $(INTERNAL_USERIMAGES_DEPS) | 
|  | 2497 | $(build-productimage-target) | 
|  | 2498 |  | 
|  | 2499 | sync: $(INTERNAL_PRODUCTIMAGE_FILES) | 
|  | 2500 |  | 
|  | 2501 | else ifdef BOARD_PREBUILT_PRODUCTIMAGE | 
|  | 2502 | INSTALLED_PRODUCTIMAGE_TARGET := $(PRODUCT_OUT)/product.img | 
|  | 2503 | $(eval $(call copy-one-file,$(BOARD_PREBUILT_PRODUCTIMAGE),$(INSTALLED_PRODUCTIMAGE_TARGET))) | 
|  | 2504 | endif | 
|  | 2505 |  | 
|  | 2506 | # ----------------------------------------------------------------- | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 2507 | # product_services partition image | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2508 | ifdef BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE | 
|  | 2509 | INTERNAL_PRODUCT_SERVICESIMAGE_FILES := \ | 
|  | 2510 | $(filter $(TARGET_OUT_PRODUCT_SERVICES)/%,\ | 
|  | 2511 | $(ALL_DEFAULT_INSTALLED_MODULES)\ | 
|  | 2512 | $(ALL_PDK_FUSION_FILES)) \ | 
|  | 2513 | $(PDK_FUSION_SYMLINK_STAMP) | 
|  | 2514 |  | 
|  | 2515 | # platform.zip depends on $(INTERNAL_PRODUCT_SERVICESIMAGE_FILES). | 
|  | 2516 | $(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_PRODUCT_SERVICESIMAGE_FILES) | 
|  | 2517 |  | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 2518 | INSTALLED_FILES_FILE_PRODUCT_SERVICES := $(PRODUCT_OUT)/installed-files-product_services.txt | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2519 | INSTALLED_FILES_JSON_PRODUCT_SERVICES := $(INSTALLED_FILES_FILE_PRODUCT_SERVICES:.txt=.json) | 
|  | 2520 | $(INSTALLED_FILES_FILE_PRODUCT_SERVICES): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_PRODUCT_SERVICES) | 
|  | 2521 | $(INSTALLED_FILES_FILE_PRODUCT_SERVICES) : $(INTERNAL_PRODUCT_SERVICESIMAGE_FILES) $(FILESLIST) | 
|  | 2522 | @echo Installed file list: $@ | 
|  | 2523 | @mkdir -p $(dir $@) | 
|  | 2524 | @rm -f $@ | 
|  | 2525 | $(hide) $(FILESLIST) $(TARGET_OUT_PRODUCT_SERVICES) > $(@:.txt=.json) | 
|  | 2526 | $(hide) build/tools/fileslist_util.py -c $(@:.txt=.json) > $@ | 
|  | 2527 |  | 
| Yifan Hong | ebc041a | 2018-07-26 16:02:52 -0700 | [diff] [blame] | 2528 | product_servicesimage_intermediates := \ | 
|  | 2529 | $(call intermediates-dir-for,PACKAGING,product_services) | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 2530 | BUILT_PRODUCT_SERVICESIMAGE_TARGET := $(PRODUCT_OUT)/product_services.img | 
|  | 2531 | define build-product_servicesimage-target | 
|  | 2532 | $(call pretty,"Target product_services fs image: $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET)") | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2533 | @mkdir -p $(TARGET_OUT_PRODUCT_SERVICES) | 
| Yifan Hong | ebc041a | 2018-07-26 16:02:52 -0700 | [diff] [blame] | 2534 | @mkdir -p $(product_servicesimage_intermediates) && rm -rf $(product_servicesimage_intermediates)/product_services_image_info.txt | 
|  | 2535 | $(call generate-image-prop-dictionary, $(product_servicesimage_intermediates)/product_services_image_info.txt,product_services, skip_fsck=true) | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2536 | $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \ | 
|  | 2537 | ./build/tools/releasetools/build_image.py \ | 
| Yifan Hong | ebc041a | 2018-07-26 16:02:52 -0700 | [diff] [blame] | 2538 | $(TARGET_OUT_PRODUCT_SERVICES) $(product_servicesimage_intermediates)/product_services_image_info.txt $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) $(TARGET_OUT) \ | 
|  | 2539 | $(product_servicesimage_intermediates)/generated_product_services_image_info.txt | 
| Yifan Hong | 9c35a02 | 2018-07-20 15:33:47 -0700 | [diff] [blame] | 2540 | $(hide) $(call assert-max-image-size,$(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET),\ | 
|  | 2541 | $(call read-image-prop-dictionary,\ | 
| Yifan Hong | ebc041a | 2018-07-26 16:02:52 -0700 | [diff] [blame] | 2542 | $(product_servicesimage_intermediates)/generated_product_services_image_info.txt,product_services_size)) | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2543 | endef | 
|  | 2544 |  | 
|  | 2545 | # We just build this directly to the install location. | 
|  | 2546 | INSTALLED_PRODUCT_SERVICESIMAGE_TARGET := $(BUILT_PRODUCT_SERVICESIMAGE_TARGET) | 
|  | 2547 | $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) $(INTERNAL_PRODUCT_SERVICESIMAGE_FILES) $(INSTALLED_FILES_FILE_PRODUCT_SERVICES) $(BUILD_IMAGE_SRCS) | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 2548 | $(build-product_servicesimage-target) | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2549 |  | 
|  | 2550 | .PHONY: productservicesimage-nodeps psnod | 
|  | 2551 | productservicesimage-nodeps psnod: | $(INTERNAL_USERIMAGES_DEPS) | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 2552 | $(build-product_servicesimage-target) | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2553 |  | 
|  | 2554 | sync: $(INTERNAL_PRODUCT_SERVICESIMAGE_FILES) | 
|  | 2555 |  | 
|  | 2556 | else ifdef BOARD_PREBUILT_PRODUCT_SERVICESIMAGE | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 2557 | INSTALLED_PRODUCT_SERVICESIMAGE_TARGET := $(PRODUCT_OUT)/product_services.img | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2558 | $(eval $(call copy-one-file,$(BOARD_PREBUILT_PRODUCT_SERVICESIMAGE),$(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET))) | 
|  | 2559 | endif | 
|  | 2560 |  | 
|  | 2561 | # ----------------------------------------------------------------- | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 2562 | # odm partition image | 
|  | 2563 | ifdef BOARD_ODMIMAGE_FILE_SYSTEM_TYPE | 
|  | 2564 | INTERNAL_ODMIMAGE_FILES := \ | 
|  | 2565 | $(filter $(TARGET_OUT_ODM)/%,\ | 
|  | 2566 | $(ALL_DEFAULT_INSTALLED_MODULES)\ | 
|  | 2567 | $(ALL_PDK_FUSION_FILES)) \ | 
|  | 2568 | $(PDK_FUSION_SYMLINK_STAMP) | 
|  | 2569 | # platform.zip depends on $(INTERNAL_ODMIMAGE_FILES). | 
|  | 2570 | $(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_ODMIMAGE_FILES) | 
|  | 2571 |  | 
|  | 2572 | INSTALLED_FILES_FILE_ODM := $(PRODUCT_OUT)/installed-files-odm.txt | 
|  | 2573 | INSTALLED_FILES_JSON_ODM := $(INSTALLED_FILES_FILE_ODM:.txt=.json) | 
|  | 2574 | $(INSTALLED_FILES_FILE_ODM): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_ODM) | 
|  | 2575 | $(INSTALLED_FILES_FILE_ODM) : $(INTERNAL_ODMIMAGE_FILES) $(FILESLIST) | 
|  | 2576 | @echo Installed file list: $@ | 
|  | 2577 | @mkdir -p $(dir $@) | 
|  | 2578 | @rm -f $@ | 
|  | 2579 | $(hide) $(FILESLIST) $(TARGET_OUT_ODM) > $(@:.txt=.json) | 
|  | 2580 | $(hide) build/tools/fileslist_util.py -c $(@:.txt=.json) > $@ | 
|  | 2581 |  | 
|  | 2582 | odmimage_intermediates := \ | 
|  | 2583 | $(call intermediates-dir-for,PACKAGING,odm) | 
|  | 2584 | BUILT_ODMIMAGE_TARGET := $(PRODUCT_OUT)/odm.img | 
|  | 2585 | define build-odmimage-target | 
|  | 2586 | $(call pretty,"Target odm fs image: $(INSTALLED_ODMIMAGE_TARGET)") | 
|  | 2587 | @mkdir -p $(TARGET_OUT_ODM) | 
|  | 2588 | @mkdir -p $(odmimage_intermediates) && rm -rf $(odmimage_intermediates)/odm_image_info.txt | 
|  | 2589 | $(call generate-userimage-prop-dictionary, $(odmimage_intermediates)/odm_image_info.txt, skip_fsck=true) | 
|  | 2590 | $(if $(BOARD_ODM_KERNEL_MODULES), \ | 
|  | 2591 | $(call build-image-kernel-modules,$(BOARD_ODM_KERNEL_MODULES),$(TARGET_OUT_ODM),odm/,$(call intermediates-dir-for,PACKAGING,depmod_odm))) | 
|  | 2592 | $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \ | 
|  | 2593 | ./build/tools/releasetools/build_image.py \ | 
|  | 2594 | $(TARGET_OUT_ODM) $(odmimage_intermediates)/odm_image_info.txt $(INSTALLED_ODMIMAGE_TARGET) $(TARGET_OUT) \ | 
|  | 2595 | $(odmimage_intermediates)/generated_odm_image_info.txt | 
|  | 2596 | $(hide) $(call assert-max-image-size,$(INSTALLED_ODMIMAGE_TARGET),\ | 
|  | 2597 | $(call read-image-prop-dictionary,\ | 
|  | 2598 | $(odmimage_intermediates)/generated_odm_image_info.txt,odm_size)) | 
|  | 2599 | endef | 
|  | 2600 |  | 
|  | 2601 | # We just build this directly to the install location. | 
|  | 2602 | INSTALLED_ODMIMAGE_TARGET := $(BUILT_ODMIMAGE_TARGET) | 
|  | 2603 | $(INSTALLED_ODMIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) $(INTERNAL_ODMIMAGE_FILES) $(INSTALLED_FILES_FILE_ODM) $(BUILD_IMAGE_SRCS) $(DEPMOD) $(BOARD_ODM_KERNEL_MODULES) | 
|  | 2604 | $(build-odmimage-target) | 
|  | 2605 |  | 
|  | 2606 | .PHONY: odmimage-nodeps onod | 
|  | 2607 | odmimage-nodeps onod: | $(INTERNAL_USERIMAGES_DEPS) $(DEPMOD) | 
|  | 2608 | $(build-odmimage-target) | 
|  | 2609 |  | 
|  | 2610 | sync: $(INTERNAL_ODMIMAGE_FILES) | 
|  | 2611 |  | 
|  | 2612 | else ifdef BOARD_PREBUILT_ODMIMAGE | 
|  | 2613 | INSTALLED_ODMIMAGE_TARGET := $(PRODUCT_OUT)/odm.img | 
|  | 2614 | $(eval $(call copy-one-file,$(BOARD_PREBUILT_ODMIMAGE),$(INSTALLED_ODMIMAGE_TARGET))) | 
|  | 2615 | endif | 
|  | 2616 |  | 
|  | 2617 | # ----------------------------------------------------------------- | 
| Yueyao Zhu | 211c901 | 2017-04-27 00:34:50 -0700 | [diff] [blame] | 2618 | # dtbo image | 
|  | 2619 | ifdef BOARD_PREBUILT_DTBOIMAGE | 
|  | 2620 | INSTALLED_DTBOIMAGE_TARGET := $(PRODUCT_OUT)/dtbo.img | 
|  | 2621 |  | 
|  | 2622 | ifeq ($(BOARD_AVB_ENABLE),true) | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2623 | $(INSTALLED_DTBOIMAGE_TARGET): $(BOARD_PREBUILT_DTBOIMAGE) $(AVBTOOL) $(BOARD_AVB_DTBO_KEY_PATH) | 
| Yueyao Zhu | 211c901 | 2017-04-27 00:34:50 -0700 | [diff] [blame] | 2624 | cp $(BOARD_PREBUILT_DTBOIMAGE) $@ | 
|  | 2625 | $(AVBTOOL) add_hash_footer \ | 
|  | 2626 | --image $@ \ | 
|  | 2627 | --partition_size $(BOARD_DTBOIMG_PARTITION_SIZE) \ | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2628 | --partition_name dtbo $(INTERNAL_AVB_DTBO_SIGNING_ARGS) \ | 
| Yueyao Zhu | 211c901 | 2017-04-27 00:34:50 -0700 | [diff] [blame] | 2629 | $(BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS) | 
|  | 2630 | else | 
|  | 2631 | $(INSTALLED_DTBOIMAGE_TARGET): $(BOARD_PREBUILT_DTBOIMAGE) | 
|  | 2632 | cp $(BOARD_PREBUILT_DTBOIMAGE) $@ | 
|  | 2633 | endif | 
|  | 2634 |  | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2635 | endif # BOARD_PREBUILT_DTBOIMAGE | 
|  | 2636 |  | 
|  | 2637 | # Returns a list of image targets corresponding to the given list of partitions. For example, it | 
|  | 2638 | # returns "$(INSTALLED_PRODUCTIMAGE_TARGET)" for "product", or "$(INSTALLED_SYSTEMIMAGE_TARGET) | 
|  | 2639 | # $(INSTALLED_VENDORIMAGE_TARGET)" for "system vendor". | 
|  | 2640 | # (1): list of partitions like "system", "vendor" or "system product product_services". | 
|  | 2641 | define images-for-partitions | 
|  | 2642 | $(strip $(foreach item,$(1),$(INSTALLED_$(call to-upper,$(item))IMAGE_TARGET))) | 
|  | 2643 | endef | 
| Yueyao Zhu | 211c901 | 2017-04-27 00:34:50 -0700 | [diff] [blame] | 2644 |  | 
|  | 2645 | # ----------------------------------------------------------------- | 
| Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 2646 | # vbmeta image | 
|  | 2647 | ifeq ($(BOARD_AVB_ENABLE),true) | 
|  | 2648 |  | 
|  | 2649 | BUILT_VBMETAIMAGE_TARGET := $(PRODUCT_OUT)/vbmeta.img | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2650 | AVB_CHAIN_KEY_DIR := $(TARGET_OUT_INTERMEDIATES)/avb_chain_keys | 
| Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 2651 |  | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2652 | ifdef BOARD_AVB_KEY_PATH | 
|  | 2653 | $(if $(BOARD_AVB_ALGORITHM),,$(error BOARD_AVB_ALGORITHM is not defined)) | 
|  | 2654 | else | 
|  | 2655 | # If key path isn't specified, use the 4096-bit test key. | 
|  | 2656 | BOARD_AVB_ALGORITHM := SHA256_RSA4096 | 
|  | 2657 | BOARD_AVB_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem | 
|  | 2658 | endif | 
|  | 2659 |  | 
| Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2660 | INTERNAL_AVB_PARTITIONS_IN_CHAINED_VBMETA_IMAGES := \ | 
|  | 2661 | $(BOARD_AVB_VBMETA_MAINLINE) \ | 
|  | 2662 | $(BOARD_AVB_VBMETA_VENDOR) | 
|  | 2663 |  | 
|  | 2664 | # Not allowing the same partition to appear in multiple groups. | 
|  | 2665 | ifneq ($(words $(sort $(INTERNAL_AVB_PARTITIONS_IN_CHAINED_VBMETA_IMAGES))),$(words $(INTERNAL_AVB_PARTITIONS_IN_CHAINED_VBMETA_IMAGES))) | 
|  | 2666 | $(error BOARD_AVB_VBMETA_MAINLINE and BOARD_AVB_VBMETA_VENDOR cannot have duplicates) | 
|  | 2667 | endif | 
|  | 2668 |  | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2669 | BOOT_FOOTER_ARGS := BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS | 
|  | 2670 | DTBO_FOOTER_ARGS := BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS | 
|  | 2671 | SYSTEM_FOOTER_ARGS := BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS | 
|  | 2672 | VENDOR_FOOTER_ARGS := BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS | 
| David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 2673 | RECOVERY_FOOTER_ARGS := BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2674 | PRODUCT_FOOTER_ARGS := BOARD_AVB_PRODUCT_ADD_HASHTREE_FOOTER_ARGS | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2675 | PRODUCT_SERVICES_FOOTER_ARGS := BOARD_AVB_PRODUCT_SERVICES_ADD_HASHTREE_FOOTER_ARGS | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 2676 | ODM_FOOTER_ARGS := BOARD_AVB_ODM_ADD_HASHTREE_FOOTER_ARGS | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2677 |  | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2678 | # Helper function that checks and sets required build variables for an AVB chained partition. | 
| Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2679 | # $(1): the partition to enable AVB chain, e.g., boot or system or vbmeta_mainline. | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2680 | define _check-and-set-avb-chain-args | 
|  | 2681 | $(eval part := $(1)) | 
|  | 2682 | $(eval PART=$(call to-upper,$(part))) | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2683 |  | 
|  | 2684 | $(eval _key_path := BOARD_AVB_$(PART)_KEY_PATH) | 
|  | 2685 | $(eval _signing_algorithm := BOARD_AVB_$(PART)_ALGORITHM) | 
|  | 2686 | $(eval _rollback_index := BOARD_AVB_$(PART)_ROLLBACK_INDEX) | 
|  | 2687 | $(eval _rollback_index_location := BOARD_AVB_$(PART)_ROLLBACK_INDEX_LOCATION) | 
|  | 2688 | $(if $($(_key_path)),,$(error $(_key_path) is not defined)) | 
|  | 2689 | $(if $($(_signing_algorithm)),,$(error $(_signing_algorithm) is not defined)) | 
|  | 2690 | $(if $($(_rollback_index)),,$(error $(_rollback_index) is not defined)) | 
|  | 2691 | $(if $($(_rollback_index_location)),,$(error $(_rollback_index_location) is not defined)) | 
|  | 2692 |  | 
|  | 2693 | # Set INTERNAL_AVB_(PART)_SIGNING_ARGS | 
|  | 2694 | $(eval _signing_args := INTERNAL_AVB_$(PART)_SIGNING_ARGS) | 
|  | 2695 | $(eval $(_signing_args) := \ | 
|  | 2696 | --algorithm $($(_signing_algorithm)) --key $($(_key_path))) | 
|  | 2697 |  | 
|  | 2698 | $(eval INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += \ | 
|  | 2699 | --chain_partition $(part):$($(_rollback_index_location)):$(AVB_CHAIN_KEY_DIR)/$(part).avbpubkey) | 
|  | 2700 |  | 
| Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2701 | # Set rollback_index via footer args for non-chained vbmeta image. Chained vbmeta image will pick up | 
|  | 2702 | # the index via a separate flag (e.g. BOARD_AVB_VBMETA_MAINLINE_ROLLBACK_INDEX). | 
|  | 2703 | $(if $(filter $(part),$(part:vbmeta_%=%)),\ | 
|  | 2704 | $(eval _footer_args := $(PART)_FOOTER_ARGS) \ | 
|  | 2705 | $(eval $($(_footer_args)) += --rollback_index $($(_rollback_index)))) | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2706 | endef | 
|  | 2707 |  | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2708 | # Checks and sets the required build variables for an AVB partition. The partition will be | 
|  | 2709 | # 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] | 2710 | # image descriptor will be included into vbmeta.img, unless it has been already added to any chained | 
|  | 2711 | # VBMeta image. | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2712 | # $(1): Partition name, e.g. boot or system. | 
|  | 2713 | define check-and-set-avb-args | 
| Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2714 | $(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] | 2715 | $(if $(BOARD_AVB_$(call to-upper,$(1))_KEY_PATH),\ | 
| Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2716 | $(if $(_in_chained_vbmeta),\ | 
|  | 2717 | $(error Chaining partition "$(1)" in chained VBMeta image is not supported)) \ | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2718 | $(call _check-and-set-avb-chain-args,$(1)),\ | 
| Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2719 | $(if $(_in_chained_vbmeta),,\ | 
|  | 2720 | $(eval INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += \ | 
|  | 2721 | --include_descriptors_from_image $(call images-for-partitions,$(1))))) | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2722 | endef | 
|  | 2723 |  | 
| Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 2724 | ifdef INSTALLED_BOOTIMAGE_TARGET | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2725 | $(eval $(call check-and-set-avb-args,boot)) | 
| Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 2726 | endif | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2727 |  | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2728 | $(eval $(call check-and-set-avb-args,system)) | 
| Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 2729 |  | 
|  | 2730 | ifdef INSTALLED_VENDORIMAGE_TARGET | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2731 | $(eval $(call check-and-set-avb-args,vendor)) | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2732 | endif | 
| Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 2733 |  | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2734 | ifdef INSTALLED_PRODUCTIMAGE_TARGET | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2735 | $(eval $(call check-and-set-avb-args,product)) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2736 | endif | 
|  | 2737 |  | 
| Tao Bao | cee6d04 | 2018-08-22 23:39:03 -0700 | [diff] [blame] | 2738 | ifdef INSTALLED_PRODUCT_SERVICESIMAGE_TARGET | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2739 | $(eval $(call check-and-set-avb-args,product_services)) | 
| Tao Bao | cee6d04 | 2018-08-22 23:39:03 -0700 | [diff] [blame] | 2740 | endif | 
|  | 2741 |  | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 2742 | ifdef INSTALLED_ODMIMAGE_TARGET | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2743 | $(eval $(call check-and-set-avb-args,odm)) | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 2744 | endif | 
|  | 2745 |  | 
| Yueyao Zhu | 211c901 | 2017-04-27 00:34:50 -0700 | [diff] [blame] | 2746 | ifdef INSTALLED_DTBOIMAGE_TARGET | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2747 | $(eval $(call check-and-set-avb-args,dtbo)) | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2748 | endif | 
| Yueyao Zhu | 211c901 | 2017-04-27 00:34:50 -0700 | [diff] [blame] | 2749 |  | 
| David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 2750 | ifdef INSTALLED_RECOVERYIMAGE_TARGET | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2751 | $(eval $(call check-and-set-avb-args,recovery)) | 
| David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 2752 | endif | 
| Bowgo Tsai | 53cf999 | 2017-06-13 11:27:06 +0800 | [diff] [blame] | 2753 |  | 
| Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2754 | # Not using INSTALLED_VBMETA_MAINLINEIMAGE_TARGET as it won't be set yet. | 
|  | 2755 | ifdef BOARD_AVB_VBMETA_MAINLINE | 
|  | 2756 | $(eval $(call check-and-set-avb-args,vbmeta_mainline)) | 
|  | 2757 | endif | 
|  | 2758 |  | 
|  | 2759 | ifdef BOARD_AVB_VBMETA_VENDOR | 
|  | 2760 | $(eval $(call check-and-set-avb-args,vbmeta_vendor)) | 
|  | 2761 | endif | 
|  | 2762 |  | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2763 | # Add kernel cmdline descriptor for kernel to mount system.img as root with | 
|  | 2764 | # dm-verity. This works when system.img is either chained or not-chained: | 
|  | 2765 | # - chained: The --setup_as_rootfs_from_kernel option will add dm-verity kernel | 
|  | 2766 | #   cmdline descriptor to system.img | 
|  | 2767 | # - not-chained: The --include_descriptors_from_image option for make_vbmeta_image | 
|  | 2768 | #   will include the kernel cmdline descriptor from system.img into vbmeta.img | 
| Bowgo Tsai | 9b37760 | 2017-04-14 18:50:11 +0800 | [diff] [blame] | 2769 | ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2770 | BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS += --setup_as_rootfs_from_kernel | 
| Bowgo Tsai | 9b37760 | 2017-04-14 18:50:11 +0800 | [diff] [blame] | 2771 | endif | 
|  | 2772 |  | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2773 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --padding_size 4096 | 
| Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2774 | BOARD_AVB_MAKE_VBMETA_MAINLINE_IMAGE_ARGS += --padding_size 4096 | 
|  | 2775 | BOARD_AVB_MAKE_VBMETA_VENDOR_IMAGE_ARGS += --padding_size 4096 | 
|  | 2776 |  | 
|  | 2777 | ifeq (eng,$(filter eng, $(TARGET_BUILD_VARIANT))) | 
|  | 2778 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --set_hashtree_disabled_flag | 
|  | 2779 | BOARD_AVB_MAKE_VBMETA_MAINLINE_IMAGE_ARGS += --set_hashtree_disabled_flag | 
|  | 2780 | BOARD_AVB_MAKE_VBMETA_VENDOR_IMAGE_ARGS += --set_hashtree_disabled_flag | 
|  | 2781 | endif | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2782 |  | 
| Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 2783 | ifdef BOARD_AVB_ROLLBACK_INDEX | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2784 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --rollback_index $(BOARD_AVB_ROLLBACK_INDEX) | 
| Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 2785 | endif | 
|  | 2786 |  | 
| Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2787 | ifdef BOARD_AVB_VBMETA_MAINLINE_ROLLBACK_INDEX | 
|  | 2788 | BOARD_AVB_MAKE_VBMETA_MAINLINE_IMAGE_ARGS += \ | 
|  | 2789 | --rollback_index $(BOARD_AVB_VBMETA_MAINLINE_ROLLBACK_INDEX) | 
|  | 2790 | endif | 
|  | 2791 |  | 
|  | 2792 | ifdef BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX | 
|  | 2793 | BOARD_AVB_MAKE_VBMETA_VENDOR_IMAGE_ARGS += \ | 
|  | 2794 | --rollback_index $(BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX) | 
| John Reck | 0588b43 | 2018-05-03 13:20:01 -0700 | [diff] [blame] | 2795 | endif | 
|  | 2796 |  | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2797 | # $(1): the directory to extract public keys to | 
|  | 2798 | define extract-avb-chain-public-keys | 
|  | 2799 | $(if $(BOARD_AVB_BOOT_KEY_PATH),\ | 
|  | 2800 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_BOOT_KEY_PATH) \ | 
|  | 2801 | --output $(1)/boot.avbpubkey) | 
|  | 2802 | $(if $(BOARD_AVB_SYSTEM_KEY_PATH),\ | 
|  | 2803 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_SYSTEM_KEY_PATH) \ | 
|  | 2804 | --output $(1)/system.avbpubkey) | 
|  | 2805 | $(if $(BOARD_AVB_VENDOR_KEY_PATH),\ | 
|  | 2806 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_VENDOR_KEY_PATH) \ | 
|  | 2807 | --output $(1)/vendor.avbpubkey) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2808 | $(if $(BOARD_AVB_PRODUCT_KEY_PATH),\ | 
|  | 2809 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_PRODUCT_KEY_PATH) \ | 
|  | 2810 | --output $(1)/product.avbpubkey) | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2811 | $(if $(BOARD_AVB_PRODUCT_SERVICES_KEY_PATH),\ | 
|  | 2812 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_PRODUCT_SERVICES_KEY_PATH) \ | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 2813 | --output $(1)/product_services.avbpubkey) | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 2814 | $(if $(BOARD_AVB_ODM_KEY_PATH),\ | 
|  | 2815 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_ODM_KEY_PATH) \ | 
|  | 2816 | --output $(1)/odm.avbpubkey) | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2817 | $(if $(BOARD_AVB_DTBO_KEY_PATH),\ | 
|  | 2818 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_DTBO_KEY_PATH) \ | 
|  | 2819 | --output $(1)/dtbo.avbpubkey) | 
| David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 2820 | $(if $(BOARD_AVB_RECOVERY_KEY_PATH),\ | 
|  | 2821 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_RECOVERY_KEY_PATH) \ | 
|  | 2822 | --output $(1)/recovery.avbpubkey) | 
| Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2823 | $(if $(BOARD_AVB_VBMETA_MAINLINE_KEY_PATH),\ | 
|  | 2824 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_VBMETA_MAINLINE_KEY_PATH) \ | 
|  | 2825 | --output $(1)/vbmeta_mainline.avbpubkey) | 
|  | 2826 | $(if $(BOARD_AVB_VBMETA_VENDOR_KEY_PATH),\ | 
|  | 2827 | $(hide) $(AVBTOOL) extract_public_key --key $(BOARD_AVB_VBMETA_VENDOR_KEY_PATH) \ | 
|  | 2828 | --output $(1)/vbmeta_vendor.avbpubkey) | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2829 | endef | 
|  | 2830 |  | 
| Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2831 | # Builds a chained VBMeta image. This VBMeta image will contain the descriptors for the partitions | 
|  | 2832 | # specified in BOARD_AVB_VBMETA_<NAME>. The built VBMeta image will be included into the top-level | 
|  | 2833 | # vbmeta image as a chained partition. For example, if a target defines `BOARD_AVB_VBMETA_MAINLINE | 
|  | 2834 | # := system product_services`, `vbmeta_mainline.img` will be created that includes the descriptors | 
|  | 2835 | # for `system.img` and `product_services.img`. `vbmeta_mainline.img` itself will be included into | 
|  | 2836 | # `vbmeta.img` as a chained partition. | 
|  | 2837 | # $(1): VBMeta image name, such as "vbmeta_mainline", "vbmeta_vendor" etc. | 
|  | 2838 | # $(2): Output filename. | 
|  | 2839 | define build-chained-vbmeta-image | 
|  | 2840 | $(call pretty,"Target chained vbmeta image: $@") | 
|  | 2841 | $(hide) $(AVBTOOL) make_vbmeta_image \ | 
|  | 2842 | $(INTERNAL_AVB_$(call to-upper,$(1))_SIGNING_ARGS) \ | 
|  | 2843 | $(BOARD_AVB_MAKE_$(call to-upper,$(1))_IMAGE_ARGS) \ | 
|  | 2844 | $(foreach image,$(BOARD_AVB_$(call to-upper,$(1))), \ | 
|  | 2845 | --include_descriptors_from_image $(call images-for-partitions,$(image))) \ | 
|  | 2846 | --output $@ | 
|  | 2847 | endef | 
|  | 2848 |  | 
|  | 2849 | ifdef BOARD_AVB_VBMETA_MAINLINE | 
|  | 2850 | INSTALLED_VBMETA_MAINLINEIMAGE_TARGET := $(PRODUCT_OUT)/vbmeta_mainline.img | 
|  | 2851 | $(INSTALLED_VBMETA_MAINLINEIMAGE_TARGET): \ | 
|  | 2852 | $(AVBTOOL) \ | 
|  | 2853 | $(call images-for-partitions,$(BOARD_AVB_VBMETA_MAINLINE)) \ | 
|  | 2854 | $(BOARD_AVB_VBMETA_MAINLINE_KEY_PATH) | 
|  | 2855 | $(call build-chained-vbmeta-image,vbmeta_mainline) | 
|  | 2856 | endif | 
|  | 2857 |  | 
|  | 2858 | ifdef BOARD_AVB_VBMETA_VENDOR | 
|  | 2859 | INSTALLED_VBMETA_VENDORIMAGE_TARGET := $(PRODUCT_OUT)/vbmeta_vendor.img | 
|  | 2860 | $(INSTALLED_VBMETA_VENDORIMAGE_TARGET): \ | 
|  | 2861 | $(AVBTOOL) \ | 
|  | 2862 | $(call images-for-partitions,$(BOARD_AVB_VBMETA_VENDOR)) \ | 
|  | 2863 | $(BOARD_AVB_VBMETA_VENDOR_KEY_PATH) | 
|  | 2864 | $(call build-chained-vbmeta-image,vbmeta_vendor) | 
|  | 2865 | endif | 
|  | 2866 |  | 
| Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 2867 | define build-vbmetaimage-target | 
|  | 2868 | $(call pretty,"Target vbmeta image: $(INSTALLED_VBMETAIMAGE_TARGET)") | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2869 | $(hide) mkdir -p $(AVB_CHAIN_KEY_DIR) | 
|  | 2870 | $(call extract-avb-chain-public-keys, $(AVB_CHAIN_KEY_DIR)) | 
| Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 2871 | $(hide) $(AVBTOOL) make_vbmeta_image \ | 
|  | 2872 | $(INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS) \ | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2873 | $(PRIVATE_AVB_VBMETA_SIGNING_ARGS) \ | 
| Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 2874 | $(BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS) \ | 
|  | 2875 | --output $@ | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 2876 | $(hide) rm -rf $(AVB_CHAIN_KEY_DIR) | 
| Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 2877 | endef | 
|  | 2878 |  | 
|  | 2879 | INSTALLED_VBMETAIMAGE_TARGET := $(BUILT_VBMETAIMAGE_TARGET) | 
| Tao Bao | 0da4347 | 2018-08-22 22:53:41 -0700 | [diff] [blame] | 2880 | $(INSTALLED_VBMETAIMAGE_TARGET): PRIVATE_AVB_VBMETA_SIGNING_ARGS := \ | 
|  | 2881 | --algorithm $(BOARD_AVB_ALGORITHM) --key $(BOARD_AVB_KEY_PATH) | 
|  | 2882 |  | 
| David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 2883 | $(INSTALLED_VBMETAIMAGE_TARGET): \ | 
|  | 2884 | $(AVBTOOL) \ | 
|  | 2885 | $(INSTALLED_BOOTIMAGE_TARGET) \ | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2886 | $(INSTALLED_SYSTEMIMAGE_TARGET) \ | 
| David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 2887 | $(INSTALLED_VENDORIMAGE_TARGET) \ | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 2888 | $(INSTALLED_PRODUCTIMAGE_TARGET) \ | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 2889 | $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) \ | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 2890 | $(INSTALLED_ODMIMAGE_TARGET) \ | 
| David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 2891 | $(INSTALLED_DTBOIMAGE_TARGET) \ | 
|  | 2892 | $(INSTALLED_RECOVERYIMAGE_TARGET) \ | 
| Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2893 | $(INSTALLED_VBMETA_MAINLINEIMAGE_TARGET) \ | 
|  | 2894 | $(INSTALLED_VBMETA_VENDORIMAGE_TARGET) \ | 
|  | 2895 | $(BOARD_AVB_VBMETA_MAINLINE_KEY_PATH) \ | 
|  | 2896 | $(BOARD_AVB_VBMETA_VENDOR_KEY_PATH) \ | 
| David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 2897 | $(BOARD_AVB_KEY_PATH) | 
| Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 2898 | $(build-vbmetaimage-target) | 
|  | 2899 |  | 
|  | 2900 | .PHONY: vbmetaimage-nodeps | 
|  | 2901 | vbmetaimage-nodeps: | 
|  | 2902 | $(build-vbmetaimage-target) | 
|  | 2903 |  | 
| Bowgo Tsai | 8ee4a3d | 2017-03-31 15:21:26 +0800 | [diff] [blame] | 2904 | endif # BOARD_AVB_ENABLE | 
|  | 2905 |  | 
|  | 2906 | # ----------------------------------------------------------------- | 
| Yifan Hong | 37c0c7c | 2018-07-24 17:45:08 -0700 | [diff] [blame] | 2907 | # super partition image | 
|  | 2908 |  | 
| Yifan Hong | 37c0c7c | 2018-07-24 17:45:08 -0700 | [diff] [blame] | 2909 | # (1): list of items like "system", "vendor", "product", "product_services" | 
|  | 2910 | # return: map each item into a command ( wrapped in $$() ) that reads the size | 
|  | 2911 | define read-size-of-partitions | 
|  | 2912 | $(foreach p,$(1),$(call read-image-prop-dictionary,$($(p)image_intermediates)/generated_$(p)_image_info.txt,$(p)_size)) | 
|  | 2913 | endef | 
|  | 2914 |  | 
| Yifan Hong | 2dae572 | 2018-07-31 12:47:27 -0700 | [diff] [blame] | 2915 | ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION)) | 
| Yifan Hong | 37c0c7c | 2018-07-24 17:45:08 -0700 | [diff] [blame] | 2916 |  | 
|  | 2917 | # BOARD_SUPER_PARTITION_SIZE must be defined to build super image. | 
|  | 2918 | ifdef BOARD_SUPER_PARTITION_SIZE | 
|  | 2919 |  | 
|  | 2920 | INSTALLED_SUPERIMAGE_TARGET := $(PRODUCT_OUT)/super.img | 
| David Anderson | 433f822 | 2018-08-13 13:01:14 -0700 | [diff] [blame] | 2921 | INSTALLED_SUPERIMAGE_EMPTY_TARGET := $(PRODUCT_OUT)/super_empty.img | 
|  | 2922 |  | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2923 | $(INSTALLED_SUPERIMAGE_TARGET): $(call images-for-partitions,$(BOARD_SUPER_PARTITION_PARTITION_LIST)) | 
| Yifan Hong | 37c0c7c | 2018-07-24 17:45:08 -0700 | [diff] [blame] | 2924 |  | 
|  | 2925 | # For A/B devices, super partition always contains sub-partitions in the _a slot, because this | 
|  | 2926 | # image should only be used for bootstrapping / initializing the device. When flashing the image, | 
|  | 2927 | # bootloader fastboot should always mark _a slot as bootable. | 
|  | 2928 | ifeq ($(AB_OTA_UPDATER),true) | 
| David Anderson | 433f822 | 2018-08-13 13:01:14 -0700 | [diff] [blame] | 2929 | $(INSTALLED_SUPERIMAGE_TARGET) $(INSTALLED_SUPERIMAGE_EMPTY_TARGET): PRIVATE_PARTITION_SUFFIX=_a | 
| Yifan Hong | 37c0c7c | 2018-07-24 17:45:08 -0700 | [diff] [blame] | 2930 | endif # AB_OTA_UPDATER | 
|  | 2931 |  | 
| David Anderson | 1ef03e2 | 2018-08-30 13:11:47 -0700 | [diff] [blame] | 2932 | $(INSTALLED_SUPERIMAGE_TARGET) $(INSTALLED_SUPERIMAGE_EMPTY_TARGET): $(LPMAKE) | 
|  | 2933 |  | 
|  | 2934 | # $(1): slot A suffix (_a or empty) | 
|  | 2935 | # $(2): include images or not (true or empty) | 
|  | 2936 | define build-superimage-target-args | 
|  | 2937 | $(if $(2), --sparse) \ | 
|  | 2938 | --metadata-size 65536 \ | 
|  | 2939 | --metadata-slots $(if $(1),2,1) \ | 
|  | 2940 | --device-size $(BOARD_SUPER_PARTITION_SIZE) \ | 
|  | 2941 | $(foreach name,$(BOARD_SUPER_PARTITION_PARTITION_LIST), \ | 
|  | 2942 | --partition $(name)$(1):$$($(UUIDGEN) $(name)$(1)):readonly:$(if $(2),$(call read-size-of-partitions,$(name)),0) \ | 
|  | 2943 | $(if $(2), --image $(name)$(1)=$(call images-for-partitions,$(name))) \ | 
|  | 2944 | $(if $(1), --partition $(name)_b:$$($(UUIDGEN) $(name)_b):readonly:0) \ | 
|  | 2945 | ) | 
|  | 2946 | endef | 
| Yifan Hong | 251a02f | 2018-08-22 11:58:35 -0700 | [diff] [blame] | 2947 |  | 
|  | 2948 | # $(1): output image path | 
|  | 2949 | # $(2): slot A suffix (_a or empty) | 
|  | 2950 | # $(3): include images or not (true or empty) | 
|  | 2951 | define build-superimage-target | 
|  | 2952 | $(HOST_OUT_EXECUTABLES)/lpmake \ | 
| David Anderson | 1ef03e2 | 2018-08-30 13:11:47 -0700 | [diff] [blame] | 2953 | $(call build-superimage-target-args,$(2),$(3)) \ | 
|  | 2954 | --output $(1) | 
| Yifan Hong | 251a02f | 2018-08-22 11:58:35 -0700 | [diff] [blame] | 2955 | endef | 
|  | 2956 |  | 
|  | 2957 | $(INSTALLED_SUPERIMAGE_TARGET): | 
|  | 2958 | $(call pretty,"Target super fs image: $@") | 
|  | 2959 | $(call build-superimage-target,$@,$(PRIVATE_PARTITION_SUFFIX),true) | 
| Yifan Hong | 37c0c7c | 2018-07-24 17:45:08 -0700 | [diff] [blame] | 2960 |  | 
|  | 2961 | $(call dist-for-goals,dist_files,$(INSTALLED_SUPERIMAGE_TARGET)) | 
|  | 2962 |  | 
| Yifan Hong | 251a02f | 2018-08-22 11:58:35 -0700 | [diff] [blame] | 2963 | $(INSTALLED_SUPERIMAGE_EMPTY_TARGET): | 
|  | 2964 | $(call pretty,"Target empty super fs image: $@") | 
|  | 2965 | $(call build-superimage-target,$@,$(PRIVATE_PARTITION_SUFFIX)) | 
| David Anderson | 433f822 | 2018-08-13 13:01:14 -0700 | [diff] [blame] | 2966 |  | 
|  | 2967 | $(call dist-for-goals,dist_files,$(INSTALLED_SUPERIMAGE_EMPTY_TARGET)) | 
|  | 2968 |  | 
| Yifan Hong | 37c0c7c | 2018-07-24 17:45:08 -0700 | [diff] [blame] | 2969 | endif # BOARD_SUPER_PARTITION_SIZE | 
| Yifan Hong | 2dae572 | 2018-07-31 12:47:27 -0700 | [diff] [blame] | 2970 | endif # PRODUCT_BUILD_SUPER_PARTITION | 
| Yifan Hong | 37c0c7c | 2018-07-24 17:45:08 -0700 | [diff] [blame] | 2971 |  | 
|  | 2972 | # ----------------------------------------------------------------- | 
| Yifan Hong | 17dd45d | 2018-07-20 16:45:57 -0700 | [diff] [blame] | 2973 | # Check image sizes <= size of super partition | 
|  | 2974 |  | 
|  | 2975 | ifeq (,$(TARGET_BUILD_APPS)) | 
|  | 2976 | # Do not check for apps-only build | 
|  | 2977 |  | 
| Yifan Hong | 2dae572 | 2018-07-31 12:47:27 -0700 | [diff] [blame] | 2978 | ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION)) | 
| Yifan Hong | 17dd45d | 2018-07-20 16:45:57 -0700 | [diff] [blame] | 2979 | ifdef BOARD_SUPER_PARTITION_SIZE | 
|  | 2980 | ifdef BOARD_SUPER_PARTITION_PARTITION_LIST | 
|  | 2981 |  | 
|  | 2982 | droid_targets: check_android_partition_sizes | 
|  | 2983 |  | 
|  | 2984 | .PHONY: check_android_partition_sizes | 
|  | 2985 |  | 
| Yifan Hong | 17dd45d | 2018-07-20 16:45:57 -0700 | [diff] [blame] | 2986 | # Add image dependencies so that generated_*_image_info.txt are written before checking. | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 2987 | check_android_partition_sizes: $(call images-for-partitions,$(BOARD_SUPER_PARTITION_PARTITION_LIST)) | 
| Yifan Hong | 17dd45d | 2018-07-20 16:45:57 -0700 | [diff] [blame] | 2988 |  | 
|  | 2989 | check_android_partition_sizes: | 
| Yifan Hong | 37c0c7c | 2018-07-24 17:45:08 -0700 | [diff] [blame] | 2990 | partition_size_list="$(call read-size-of-partitions,$(BOARD_SUPER_PARTITION_PARTITION_LIST))"; \ | 
| Yifan Hong | 17dd45d | 2018-07-20 16:45:57 -0700 | [diff] [blame] | 2991 | sum_sizes_expr=$$(sed -e 's/ /+/g' <<< "$${partition_size_list}"); \ | 
|  | 2992 | if [ $$(( $${sum_sizes_expr} )) -gt $(BOARD_SUPER_PARTITION_SIZE) ]; then \ | 
|  | 2993 | echo 'The sum of sizes of all logical partitions is larger than BOARD_SUPER_PARTITION_SIZE.'; \ | 
|  | 2994 | echo $${sum_sizes_expr} '==' $$(( $${sum_sizes_expr} )) '>' $(BOARD_SUPER_PARTITION_SIZE); \ | 
|  | 2995 | exit 1; \ | 
|  | 2996 | else \ | 
|  | 2997 | echo 'The sum of sizes of all logical partitions is within BOARD_SUPER_PARTITION_SIZE:' \ | 
|  | 2998 | $${sum_sizes_expr} '==' $$(( $${sum_sizes_expr} )) '<=' $(BOARD_SUPER_PARTITION_SIZE); \ | 
|  | 2999 | fi | 
|  | 3000 |  | 
|  | 3001 | endif # BOARD_SUPER_PARTITION_PARTITION_LIST | 
|  | 3002 | endif # BOARD_SUPER_PARTITION_SIZE | 
| Yifan Hong | 2dae572 | 2018-07-31 12:47:27 -0700 | [diff] [blame] | 3003 | endif # PRODUCT_BUILD_SUPER_PARTITION | 
| Yifan Hong | 17dd45d | 2018-07-20 16:45:57 -0700 | [diff] [blame] | 3004 |  | 
|  | 3005 | endif # TARGET_BUILD_APPS | 
|  | 3006 |  | 
|  | 3007 | # ----------------------------------------------------------------- | 
| Greg Hartman | 2ebfef4 | 2014-11-04 21:17:06 -0800 | [diff] [blame] | 3008 | # bring in the installer image generation defines if necessary | 
|  | 3009 | ifeq ($(TARGET_USE_DISKINSTALLER),true) | 
|  | 3010 | include bootable/diskinstaller/config.mk | 
|  | 3011 | endif | 
|  | 3012 |  | 
|  | 3013 | # ----------------------------------------------------------------- | 
| Colin Cross | c312f31 | 2012-04-19 13:54:39 -0700 | [diff] [blame] | 3014 | # host tools needed to build dist and OTA packages | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3015 |  | 
| Ying Wang | bd2d024 | 2015-09-22 11:17:52 -0700 | [diff] [blame] | 3016 | build_ota_package := true | 
|  | 3017 | ifeq ($(TARGET_SKIP_OTA_PACKAGE),true) | 
|  | 3018 | build_ota_package := false | 
|  | 3019 | endif | 
|  | 3020 | ifeq ($(BUILD_OS),darwin) | 
|  | 3021 | build_ota_package := false | 
|  | 3022 | endif | 
|  | 3023 | ifneq ($(strip $(SANITIZE_TARGET)),) | 
|  | 3024 | build_ota_package := false | 
|  | 3025 | endif | 
|  | 3026 | ifeq ($(TARGET_PRODUCT),sdk) | 
|  | 3027 | build_ota_package := false | 
|  | 3028 | endif | 
|  | 3029 | ifneq ($(filter generic%,$(TARGET_DEVICE)),) | 
|  | 3030 | build_ota_package := false | 
|  | 3031 | endif | 
|  | 3032 | ifeq ($(TARGET_NO_KERNEL),true) | 
|  | 3033 | build_ota_package := false | 
|  | 3034 | endif | 
|  | 3035 | ifeq ($(recovery_fstab),) | 
|  | 3036 | build_ota_package := false | 
|  | 3037 | endif | 
| Colin Cross | 481cc5a | 2016-02-04 15:09:23 -0800 | [diff] [blame] | 3038 | ifeq ($(TARGET_BUILD_PDK),true) | 
|  | 3039 | build_ota_package := false | 
|  | 3040 | endif | 
| Ying Wang | bd2d024 | 2015-09-22 11:17:52 -0700 | [diff] [blame] | 3041 |  | 
|  | 3042 | ifeq ($(build_ota_package),true) | 
| Ying Wang | 09c4b68 | 2015-08-11 11:24:19 -0700 | [diff] [blame] | 3043 | OTATOOLS :=  $(HOST_OUT_EXECUTABLES)/minigzip \ | 
|  | 3044 | $(HOST_OUT_EXECUTABLES)/aapt \ | 
| Michael Schwartz | 6473e75 | 2017-11-08 11:45:14 -0800 | [diff] [blame] | 3045 | $(HOST_OUT_EXECUTABLES)/checkvintf \ | 
| Ying Wang | c45a47b | 2015-04-08 12:24:37 -0700 | [diff] [blame] | 3046 | $(HOST_OUT_EXECUTABLES)/mkbootfs \ | 
|  | 3047 | $(HOST_OUT_EXECUTABLES)/mkbootimg \ | 
|  | 3048 | $(HOST_OUT_EXECUTABLES)/fs_config \ | 
|  | 3049 | $(HOST_OUT_EXECUTABLES)/zipalign \ | 
|  | 3050 | $(HOST_OUT_EXECUTABLES)/bsdiff \ | 
|  | 3051 | $(HOST_OUT_EXECUTABLES)/imgdiff \ | 
|  | 3052 | $(HOST_OUT_JAVA_LIBRARIES)/dumpkey.jar \ | 
|  | 3053 | $(HOST_OUT_JAVA_LIBRARIES)/signapk.jar \ | 
|  | 3054 | $(HOST_OUT_JAVA_LIBRARIES)/BootSignature.jar \ | 
| Tao Bao | e8ef8f70 | 2017-05-17 11:41:50 -0700 | [diff] [blame] | 3055 | $(HOST_OUT_JAVA_LIBRARIES)/VeritySigner.jar \ | 
| Tao Bao | bcc3109 | 2017-01-06 14:24:18 -0800 | [diff] [blame] | 3056 | $(HOST_OUT_EXECUTABLES)/mke2fs \ | 
| Tianjie Xu | 5733222 | 2018-08-15 16:16:21 -0700 | [diff] [blame] | 3057 | $(HOST_OUT_EXECUTABLES)/mkuserimg_mke2fs \ | 
| Tao Bao | bcc3109 | 2017-01-06 14:24:18 -0800 | [diff] [blame] | 3058 | $(HOST_OUT_EXECUTABLES)/e2fsdroid \ | 
| Tao Bao | cffaf73 | 2016-04-14 12:11:36 -0700 | [diff] [blame] | 3059 | $(HOST_OUT_EXECUTABLES)/mksquashfsimage.sh \ | 
|  | 3060 | $(HOST_OUT_EXECUTABLES)/mksquashfs \ | 
|  | 3061 | $(HOST_OUT_EXECUTABLES)/mkf2fsuserimg.sh \ | 
|  | 3062 | $(HOST_OUT_EXECUTABLES)/make_f2fs \ | 
| Jaegeuk Kim | 2ea1eba | 2017-11-28 19:21:28 -0800 | [diff] [blame] | 3063 | $(HOST_OUT_EXECUTABLES)/sload_f2fs \ | 
| Ying Wang | c45a47b | 2015-04-08 12:24:37 -0700 | [diff] [blame] | 3064 | $(HOST_OUT_EXECUTABLES)/simg2img \ | 
|  | 3065 | $(HOST_OUT_EXECUTABLES)/e2fsck \ | 
| Baligh Uddin | c8bef14 | 2017-12-18 10:40:57 -0800 | [diff] [blame] | 3066 | $(HOST_OUT_EXECUTABLES)/generate_verity_key \ | 
| Ying Wang | c45a47b | 2015-04-08 12:24:37 -0700 | [diff] [blame] | 3067 | $(HOST_OUT_EXECUTABLES)/verity_signer \ | 
| Tao Bao | 7f02f34 | 2016-11-18 17:04:24 -0800 | [diff] [blame] | 3068 | $(HOST_OUT_EXECUTABLES)/verity_verifier \ | 
| Ying Wang | c45a47b | 2015-04-08 12:24:37 -0700 | [diff] [blame] | 3069 | $(HOST_OUT_EXECUTABLES)/append2simg \ | 
| Mohamad Ayyash | 353265b | 2015-06-24 15:42:19 -0700 | [diff] [blame] | 3070 | $(HOST_OUT_EXECUTABLES)/img2simg \ | 
| Sami Tolvanen | f99b531 | 2015-05-20 07:30:57 +0100 | [diff] [blame] | 3071 | $(HOST_OUT_EXECUTABLES)/boot_signer \ | 
| Tao Bao | f8e6fbe | 2016-01-04 09:57:32 -0800 | [diff] [blame] | 3072 | $(HOST_OUT_EXECUTABLES)/fec \ | 
| Tao Bao | 6d8a8cc | 2016-01-19 14:47:17 -0800 | [diff] [blame] | 3073 | $(HOST_OUT_EXECUTABLES)/brillo_update_payload \ | 
|  | 3074 | $(HOST_OUT_EXECUTABLES)/lib/shflags/shflags \ | 
| Tao Bao | f54216f | 2016-03-29 15:12:37 -0700 | [diff] [blame] | 3075 | $(HOST_OUT_EXECUTABLES)/delta_generator \ | 
| Tianjie Xu | ccbae48 | 2018-08-15 14:28:27 -0700 | [diff] [blame] | 3076 | $(HOST_OUT_EXECUTABLES)/care_map_generator \ | 
| David Anderson | 1ef03e2 | 2018-08-30 13:11:47 -0700 | [diff] [blame] | 3077 | $(LPMAKE) \ | 
| Tao Bao | 3cba374 | 2017-05-16 16:27:25 -0700 | [diff] [blame] | 3078 | $(AVBTOOL) \ | 
| Tianjie Xu | b0a29ad | 2017-07-06 15:13:59 -0700 | [diff] [blame] | 3079 | $(BLK_ALLOC_TO_BASE_FS) \ | 
| Tao Bao | b4ec6d7 | 2018-03-15 23:21:28 -0700 | [diff] [blame] | 3080 | $(BROTLI) \ | 
|  | 3081 | $(BUILD_VERITY_METADATA) \ | 
|  | 3082 | $(BUILD_VERITY_TREE) | 
| Tao Bao | 5e04c38 | 2017-02-22 16:38:19 -0800 | [diff] [blame] | 3083 |  | 
|  | 3084 | ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT)) | 
|  | 3085 | OTATOOLS += \ | 
| Tao Bao | 69ad150 | 2017-02-23 11:03:45 -0800 | [diff] [blame] | 3086 | $(FUTILITY) \ | 
|  | 3087 | $(VBOOT_SIGNER) | 
| Tao Bao | 5e04c38 | 2017-02-22 16:38:19 -0800 | [diff] [blame] | 3088 | endif | 
| Tao Bao | f8e6fbe | 2016-01-04 09:57:32 -0800 | [diff] [blame] | 3089 |  | 
| Ying Wang | c45a47b | 2015-04-08 12:24:37 -0700 | [diff] [blame] | 3090 | # Shared libraries. | 
| Ying Wang | 09c4b68 | 2015-08-11 11:24:19 -0700 | [diff] [blame] | 3091 | OTATOOLS += \ | 
| Mark Salyzyn | c506e74 | 2015-04-13 09:01:24 -0700 | [diff] [blame] | 3092 | $(HOST_LIBRARY_PATH)/libc++$(HOST_SHLIB_SUFFIX) \ | 
|  | 3093 | $(HOST_LIBRARY_PATH)/liblog$(HOST_SHLIB_SUFFIX) \ | 
|  | 3094 | $(HOST_LIBRARY_PATH)/libcutils$(HOST_SHLIB_SUFFIX) \ | 
| Claes Elgemark | d0ec665 | 2015-06-03 08:35:52 +0200 | [diff] [blame] | 3095 | $(HOST_LIBRARY_PATH)/libselinux$(HOST_SHLIB_SUFFIX) \ | 
| Baligh Uddin | c8bef14 | 2017-12-18 10:40:57 -0800 | [diff] [blame] | 3096 | $(HOST_LIBRARY_PATH)/libcrypto_utils$(HOST_SHLIB_SUFFIX) \ | 
| Claes Elgemark | d0ec665 | 2015-06-03 08:35:52 +0200 | [diff] [blame] | 3097 | $(HOST_LIBRARY_PATH)/libcrypto-host$(HOST_SHLIB_SUFFIX) \ | 
| Alex Deymo | 0d79956 | 2015-12-09 18:02:56 -0800 | [diff] [blame] | 3098 | $(HOST_LIBRARY_PATH)/libext2fs-host$(HOST_SHLIB_SUFFIX) \ | 
|  | 3099 | $(HOST_LIBRARY_PATH)/libext2_blkid-host$(HOST_SHLIB_SUFFIX) \ | 
|  | 3100 | $(HOST_LIBRARY_PATH)/libext2_com_err-host$(HOST_SHLIB_SUFFIX) \ | 
|  | 3101 | $(HOST_LIBRARY_PATH)/libext2_e2p-host$(HOST_SHLIB_SUFFIX) \ | 
| Baligh Uddin | b24470e | 2017-01-30 12:41:31 -0800 | [diff] [blame] | 3102 | $(HOST_LIBRARY_PATH)/libext2_misc$(HOST_SHLIB_SUFFIX) \ | 
| Alex Deymo | 0d79956 | 2015-12-09 18:02:56 -0800 | [diff] [blame] | 3103 | $(HOST_LIBRARY_PATH)/libext2_profile-host$(HOST_SHLIB_SUFFIX) \ | 
|  | 3104 | $(HOST_LIBRARY_PATH)/libext2_quota-host$(HOST_SHLIB_SUFFIX) \ | 
| Alex Klyubin | 9667b18 | 2015-12-10 13:38:50 -0800 | [diff] [blame] | 3105 | $(HOST_LIBRARY_PATH)/libext2_uuid-host$(HOST_SHLIB_SUFFIX) \ | 
| Tao Bao | f8e6fbe | 2016-01-04 09:57:32 -0800 | [diff] [blame] | 3106 | $(HOST_LIBRARY_PATH)/libconscrypt_openjdk_jni$(HOST_SHLIB_SUFFIX) \ | 
|  | 3107 | $(HOST_LIBRARY_PATH)/libbrillo$(HOST_SHLIB_SUFFIX) \ | 
|  | 3108 | $(HOST_LIBRARY_PATH)/libbrillo-stream$(HOST_SHLIB_SUFFIX) \ | 
| Tao Bao | f8e6fbe | 2016-01-04 09:57:32 -0800 | [diff] [blame] | 3109 | $(HOST_LIBRARY_PATH)/libchrome$(HOST_SHLIB_SUFFIX) \ | 
|  | 3110 | $(HOST_LIBRARY_PATH)/libcurl-host$(HOST_SHLIB_SUFFIX) \ | 
| Dan Willemsen | 8c2b6bb | 2016-07-22 23:16:30 +0000 | [diff] [blame] | 3111 | $(HOST_LIBRARY_PATH)/libevent-host$(HOST_SHLIB_SUFFIX) \ | 
| Tao Bao | fdd2693 | 2016-02-11 09:50:41 -0800 | [diff] [blame] | 3112 | $(HOST_LIBRARY_PATH)/libprotobuf-cpp-lite$(HOST_SHLIB_SUFFIX) \ | 
| Tao Bao | f8e6fbe | 2016-01-04 09:57:32 -0800 | [diff] [blame] | 3113 | $(HOST_LIBRARY_PATH)/libssl-host$(HOST_SHLIB_SUFFIX) \ | 
| Johan Redestig | 8f800df | 2016-03-24 13:57:03 +0100 | [diff] [blame] | 3114 | $(HOST_LIBRARY_PATH)/libz-host$(HOST_SHLIB_SUFFIX) \ | 
| Tao Bao | 138986b | 2017-01-26 08:16:57 -0800 | [diff] [blame] | 3115 | $(HOST_LIBRARY_PATH)/libsparse-host$(HOST_SHLIB_SUFFIX) \ | 
| Vikram Dattu | 8be4467 | 2016-12-16 16:33:03 +0100 | [diff] [blame] | 3116 | $(HOST_LIBRARY_PATH)/libbase$(HOST_SHLIB_SUFFIX) \ | 
| Tianjie Xu | b0a29ad | 2017-07-06 15:13:59 -0700 | [diff] [blame] | 3117 | $(HOST_LIBRARY_PATH)/libpcre2$(HOST_SHLIB_SUFFIX) \ | 
| David Anderson | 1ef03e2 | 2018-08-30 13:11:47 -0700 | [diff] [blame] | 3118 | $(HOST_LIBRARY_PATH)/libbrotli$(HOST_SHLIB_SUFFIX) \ | 
|  | 3119 | $(HOST_LIBRARY_PATH)/liblp$(HOST_SHLIB_SUFFIX) \ | 
|  | 3120 | $(HOST_LIBRARY_PATH)/libext4_utils$(HOST_SHLIB_SUFFIX) | 
| Tianjie Xu | b0a29ad | 2017-07-06 15:13:59 -0700 | [diff] [blame] | 3121 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3122 |  | 
| Ying Wang | 0689866 | 2010-06-17 17:52:18 -0700 | [diff] [blame] | 3123 | .PHONY: otatools | 
|  | 3124 | otatools: $(OTATOOLS) | 
|  | 3125 |  | 
| Doug Zongker | f22b0f4 | 2014-08-22 08:04:58 -0700 | [diff] [blame] | 3126 | BUILT_OTATOOLS_PACKAGE := $(PRODUCT_OUT)/otatools.zip | 
| Ying Wang | 62925a9 | 2015-04-08 16:37:34 -0700 | [diff] [blame] | 3127 | $(BUILT_OTATOOLS_PACKAGE): zip_root := $(call intermediates-dir-for,PACKAGING,otatools)/otatools | 
| Doug Zongker | f22b0f4 | 2014-08-22 08:04:58 -0700 | [diff] [blame] | 3128 |  | 
| Tao Bao | e8ef8f70 | 2017-05-17 11:41:50 -0700 | [diff] [blame] | 3129 | OTATOOLS_DEPS := \ | 
| Tao Bao | e8ef8f70 | 2017-05-17 11:41:50 -0700 | [diff] [blame] | 3130 | system/extras/ext4_utils/mke2fs.conf \ | 
| Tao Bao | 2d0e512 | 2018-05-23 09:23:28 -0700 | [diff] [blame] | 3131 | $(sort $(shell find external/avb/test/data -type f -name "testkey_*.pem" -o \ | 
|  | 3132 | -name "atx_metadata.bin")) \ | 
| Dan Willemsen | 60c6644 | 2018-05-01 19:07:27 -0700 | [diff] [blame] | 3133 | $(sort $(shell find system/update_engine/scripts -name "*.pyc" -prune -o -type f -print)) \ | 
|  | 3134 | $(sort $(shell find build/target/product/security -type f -name "*.x509.pem" -o -name "*.pk8" -o \ | 
| Tao Bao | 5232f09 | 2018-02-10 04:03:32 +0000 | [diff] [blame] | 3135 | -name verity_key)) \ | 
| Dan Willemsen | 60c6644 | 2018-05-01 19:07:27 -0700 | [diff] [blame] | 3136 | $(sort $(shell find device $(wildcard vendor) -type f -name "*.pk8" -o -name "verifiedboot*" -o \ | 
|  | 3137 | -name "*.x509.pem" -o -name "oem*.prop")) | 
| Tao Bao | e8ef8f70 | 2017-05-17 11:41:50 -0700 | [diff] [blame] | 3138 |  | 
|  | 3139 | OTATOOLS_RELEASETOOLS := \ | 
| Dan Willemsen | 60c6644 | 2018-05-01 19:07:27 -0700 | [diff] [blame] | 3140 | $(sort $(shell find build/make/tools/releasetools -name "*.pyc" -prune -o -type f)) | 
| Tao Bao | e8ef8f70 | 2017-05-17 11:41:50 -0700 | [diff] [blame] | 3141 |  | 
|  | 3142 | ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT)) | 
|  | 3143 | OTATOOLS_DEPS += \ | 
| Tao Bao | 5232f09 | 2018-02-10 04:03:32 +0000 | [diff] [blame] | 3144 | $(sort $(shell find external/vboot_reference/tests/devkeys -type f)) | 
| Tao Bao | e8ef8f70 | 2017-05-17 11:41:50 -0700 | [diff] [blame] | 3145 | endif | 
|  | 3146 |  | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 3147 | $(BUILT_OTATOOLS_PACKAGE): $(OTATOOLS) $(OTATOOLS_DEPS) $(OTATOOLS_RELEASETOOLS) | $(ACP) | 
| Doug Zongker | f22b0f4 | 2014-08-22 08:04:58 -0700 | [diff] [blame] | 3148 | @echo "Package OTA tools: $@" | 
|  | 3149 | $(hide) rm -rf $@ $(zip_root) | 
| Tao Bao | e8ef8f70 | 2017-05-17 11:41:50 -0700 | [diff] [blame] | 3150 | $(hide) mkdir -p $(dir $@) $(zip_root)/bin $(zip_root)/framework $(zip_root)/releasetools | 
| Ying Wang | c45a47b | 2015-04-08 12:24:37 -0700 | [diff] [blame] | 3151 | $(call copy-files-with-structure,$(OTATOOLS),$(HOST_OUT)/,$(zip_root)) | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 3152 | $(hide) $(ACP) -r -d -p build/make/tools/releasetools/* $(zip_root)/releasetools | 
| Doug Zongker | f22b0f4 | 2014-08-22 08:04:58 -0700 | [diff] [blame] | 3153 | $(hide) rm -rf $@ $(zip_root)/releasetools/*.pyc | 
| Colin Cross | 0cbf03b | 2018-09-18 02:35:05 +0000 | [diff] [blame] | 3154 | $(hide) (cd $(zip_root) && zip -qryX $(abspath $@) *) | 
|  | 3155 | $(hide) echo $(OTATOOLS_DEPS) | xargs zip -qryX $(abspath $@)>/dev/null || true | 
| Doug Zongker | f22b0f4 | 2014-08-22 08:04:58 -0700 | [diff] [blame] | 3156 |  | 
|  | 3157 | .PHONY: otatools-package | 
|  | 3158 | otatools-package: $(BUILT_OTATOOLS_PACKAGE) | 
|  | 3159 |  | 
| Ying Wang | bd2d024 | 2015-09-22 11:17:52 -0700 | [diff] [blame] | 3160 | endif # build_ota_package | 
| Doug Zongker | f22b0f4 | 2014-08-22 08:04:58 -0700 | [diff] [blame] | 3161 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3162 | # ----------------------------------------------------------------- | 
|  | 3163 | # A zip of the directories that map to the target filesystem. | 
|  | 3164 | # This zip can be used to create an OTA package or filesystem image | 
|  | 3165 | # as a post-build step. | 
|  | 3166 | # | 
|  | 3167 | name := $(TARGET_PRODUCT) | 
|  | 3168 | ifeq ($(TARGET_BUILD_TYPE),debug) | 
|  | 3169 | name := $(name)_debug | 
|  | 3170 | endif | 
|  | 3171 | name := $(name)-target_files-$(FILE_NAME_TAG) | 
|  | 3172 |  | 
|  | 3173 | intermediates := $(call intermediates-dir-for,PACKAGING,target_files) | 
|  | 3174 | BUILT_TARGET_FILES_PACKAGE := $(intermediates)/$(name).zip | 
|  | 3175 | $(BUILT_TARGET_FILES_PACKAGE): intermediates := $(intermediates) | 
|  | 3176 | $(BUILT_TARGET_FILES_PACKAGE): \ | 
|  | 3177 | zip_root := $(intermediates)/$(name) | 
|  | 3178 |  | 
|  | 3179 | # $(1): Directory to copy | 
|  | 3180 | # $(2): Location to copy it to | 
|  | 3181 | # The "ls -A" is to prevent "acp s/* d" from failing if s is empty. | 
|  | 3182 | define package_files-copy-root | 
|  | 3183 | if [ -d "$(strip $(1))" -a "$$(ls -A $(1))" ]; then \ | 
|  | 3184 | mkdir -p $(2) && \ | 
|  | 3185 | $(ACP) -rd $(strip $(1))/* $(2); \ | 
|  | 3186 | fi | 
|  | 3187 | endef | 
|  | 3188 |  | 
| Tao Bao | a04fca3 | 2015-11-30 12:22:24 -0800 | [diff] [blame] | 3189 | built_ota_tools := | 
| Ying Wang | e6e544e | 2015-06-22 18:35:35 -0700 | [diff] [blame] | 3190 |  | 
|  | 3191 | # We can't build static executables when SANITIZE_TARGET=address | 
| Ivan Krasin | 74b32b8 | 2015-09-18 11:54:43 -0700 | [diff] [blame] | 3192 | ifeq ($(strip $(SANITIZE_TARGET)),) | 
| Ying Wang | e6e544e | 2015-06-22 18:35:35 -0700 | [diff] [blame] | 3193 | built_ota_tools += \ | 
| Ying Wang | e6e544e | 2015-06-22 18:35:35 -0700 | [diff] [blame] | 3194 | $(call intermediates-dir-for,EXECUTABLES,updater,,,$(TARGET_PREFER_32_BIT))/updater | 
|  | 3195 | endif | 
|  | 3196 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3197 | $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_OTA_TOOLS := $(built_ota_tools) | 
|  | 3198 |  | 
| Doug Zongker | b1134dd | 2009-06-17 17:09:40 -0700 | [diff] [blame] | 3199 | $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_RECOVERY_API_VERSION := $(RECOVERY_API_VERSION) | 
| Ken Sumrall | 31ce31f | 2013-02-21 16:27:25 -0800 | [diff] [blame] | 3200 | $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_RECOVERY_FSTAB_VERSION := $(RECOVERY_FSTAB_VERSION) | 
| Doug Zongker | b1134dd | 2009-06-17 17:09:40 -0700 | [diff] [blame] | 3201 |  | 
| Doug Zongker | c18736b | 2009-09-30 09:20:32 -0700 | [diff] [blame] | 3202 | ifeq ($(TARGET_RELEASETOOLS_EXTENSIONS),) | 
|  | 3203 | # default to common dir for device vendor | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3204 | tool_extensions := $(TARGET_DEVICE_DIR)/../common | 
| Doug Zongker | c18736b | 2009-09-30 09:20:32 -0700 | [diff] [blame] | 3205 | else | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3206 | tool_extensions := $(TARGET_RELEASETOOLS_EXTENSIONS) | 
| Doug Zongker | c18736b | 2009-09-30 09:20:32 -0700 | [diff] [blame] | 3207 | endif | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3208 | tool_extension := $(wildcard $(tool_extensions)/releasetools.py) | 
|  | 3209 | $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_TOOL_EXTENSIONS := $(tool_extensions) | 
|  | 3210 | $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_TOOL_EXTENSION := $(tool_extension) | 
| Doug Zongker | c18736b | 2009-09-30 09:20:32 -0700 | [diff] [blame] | 3211 |  | 
| Sen Jiang | 4438fd9 | 2016-03-07 16:51:01 -0800 | [diff] [blame] | 3212 | ifeq ($(AB_OTA_UPDATER),true) | 
| Sen Jiang | 4393563 | 2017-12-19 15:24:43 -0800 | [diff] [blame] | 3213 | updater_dep := system/update_engine/update_engine.conf | 
| Sen Jiang | 4438fd9 | 2016-03-07 16:51:01 -0800 | [diff] [blame] | 3214 | else | 
| Steve Fung | 48e49f5 | 2015-10-01 23:53:31 -0700 | [diff] [blame] | 3215 | # Build OTA tools if not using the AB Updater. | 
| Shinichiro Hamaji | ee2d211 | 2016-05-10 16:40:38 +0900 | [diff] [blame] | 3216 | updater_dep := $(built_ota_tools) | 
| Steve Fung | 48e49f5 | 2015-10-01 23:53:31 -0700 | [diff] [blame] | 3217 | endif | 
| Shinichiro Hamaji | ee2d211 | 2016-05-10 16:40:38 +0900 | [diff] [blame] | 3218 | $(BUILT_TARGET_FILES_PACKAGE): $(updater_dep) | 
| Steve Fung | 48e49f5 | 2015-10-01 23:53:31 -0700 | [diff] [blame] | 3219 |  | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 3220 | # If we are using recovery as boot, output recovery files to BOOT/. | 
|  | 3221 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) | 
|  | 3222 | $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_RECOVERY_OUT := BOOT | 
|  | 3223 | else | 
|  | 3224 | $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_RECOVERY_OUT := RECOVERY | 
|  | 3225 | endif | 
|  | 3226 |  | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3227 | ifeq ($(AB_OTA_UPDATER),true) | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3228 | ifdef OSRELEASED_DIRECTORY | 
|  | 3229 | $(BUILT_TARGET_FILES_PACKAGE): $(TARGET_OUT_OEM)/$(OSRELEASED_DIRECTORY)/product_id | 
|  | 3230 | $(BUILT_TARGET_FILES_PACKAGE): $(TARGET_OUT_OEM)/$(OSRELEASED_DIRECTORY)/product_version | 
|  | 3231 | $(BUILT_TARGET_FILES_PACKAGE): $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)/system_version | 
|  | 3232 | endif | 
|  | 3233 | endif | 
|  | 3234 |  | 
| Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 3235 | # Run fs_config while creating the target files package | 
|  | 3236 | # $1: root directory | 
|  | 3237 | # $2: add prefix | 
|  | 3238 | define fs_config | 
| Luis Hector Chavez | 440da2d | 2018-02-07 09:49:52 -0800 | [diff] [blame] | 3239 | (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] | 3240 | endef | 
|  | 3241 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3242 | # Depending on the various images guarantees that the underlying | 
|  | 3243 | # directories are up-to-date. | 
|  | 3244 | $(BUILT_TARGET_FILES_PACKAGE): \ | 
| Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 3245 | $(INSTALLED_RAMDISK_TARGET) \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3246 | $(INSTALLED_BOOTIMAGE_TARGET) \ | 
|  | 3247 | $(INSTALLED_RADIOIMAGE_TARGET) \ | 
|  | 3248 | $(INSTALLED_RECOVERYIMAGE_TARGET) \ | 
| Dan Willemsen | aadd499 | 2017-03-21 16:01:02 -0700 | [diff] [blame] | 3249 | $(FULL_SYSTEMIMAGE_DEPS) \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3250 | $(INSTALLED_USERDATAIMAGE_TARGET) \ | 
| Ying Wang | 9f8e8db | 2011-11-04 11:37:01 -0700 | [diff] [blame] | 3251 | $(INSTALLED_CACHEIMAGE_TARGET) \ | 
| Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 3252 | $(INSTALLED_VENDORIMAGE_TARGET) \ | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3253 | $(INSTALLED_PRODUCTIMAGE_TARGET) \ | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3254 | $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) \ | 
| Bowgo Tsai | 6a74979 | 2017-09-01 22:55:44 +0800 | [diff] [blame] | 3255 | $(INSTALLED_VBMETAIMAGE_TARGET) \ | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3256 | $(INSTALLED_ODMIMAGE_TARGET) \ | 
| Yueyao Zhu | 211c901 | 2017-04-27 00:34:50 -0700 | [diff] [blame] | 3257 | $(INSTALLED_DTBOIMAGE_TARGET) \ | 
| Dan Willemsen | aadd499 | 2017-03-21 16:01:02 -0700 | [diff] [blame] | 3258 | $(INTERNAL_SYSTEMOTHERIMAGE_FILES) \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3259 | $(INSTALLED_ANDROID_INFO_TXT_TARGET) \ | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3260 | $(INSTALLED_KERNEL_TARGET) \ | 
|  | 3261 | $(INSTALLED_2NDBOOTLOADER_TARGET) \ | 
| cfig | 2868740 | 2018-08-22 16:21:41 +0800 | [diff] [blame] | 3262 | $(BOARD_PREBUILT_DTBOIMAGE) \ | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3263 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_BASE_FS_PATH) \ | 
|  | 3264 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_BASE_FS_PATH) \ | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3265 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_BASE_FS_PATH) \ | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3266 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_SERVICES_BASE_FS_PATH) \ | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3267 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ODM_BASE_FS_PATH) \ | 
| David Anderson | 1ef03e2 | 2018-08-30 13:11:47 -0700 | [diff] [blame] | 3268 | $(LPMAKE) \ | 
| Nick Kralevich | 0eb17d9 | 2013-09-07 17:10:29 -0700 | [diff] [blame] | 3269 | $(SELINUX_FC) \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3270 | $(APKCERTS_FILE) \ | 
| Dan Willemsen | 5e29cad | 2016-08-06 20:15:06 -0700 | [diff] [blame] | 3271 | $(SOONG_ZIP) \ | 
| Doug Zongker | 283e2a1 | 2010-03-15 17:52:32 -0700 | [diff] [blame] | 3272 | $(HOST_OUT_EXECUTABLES)/fs_config \ | 
| Dan Willemsen | d79a08f | 2017-03-23 22:09:06 -0700 | [diff] [blame] | 3273 | $(HOST_OUT_EXECUTABLES)/imgdiff \ | 
|  | 3274 | $(HOST_OUT_EXECUTABLES)/bsdiff \ | 
| Tianjie Xu | 19174ba | 2018-09-04 15:33:58 -0700 | [diff] [blame] | 3275 | $(HOST_OUT_EXECUTABLES)/care_map_generator \ | 
| Dan Willemsen | aadd499 | 2017-03-21 16:01:02 -0700 | [diff] [blame] | 3276 | $(BUILD_IMAGE_SRCS) \ | 
| Steven Moreland | 627debe | 2018-05-01 09:54:21 -0700 | [diff] [blame] | 3277 | $(BUILT_ASSEMBLED_SYSTEM_MANIFEST) \ | 
|  | 3278 | $(BUILT_ASSEMBLED_VENDOR_MANIFEST) \ | 
|  | 3279 | $(BUILT_SYSTEM_MATRIX) \ | 
| Steven Moreland | 915f351 | 2018-01-25 10:44:47 -0800 | [diff] [blame] | 3280 | $(BUILT_VENDOR_MATRIX) \ | 
| Ying Wang | 5d88770 | 2015-11-04 10:06:25 -0800 | [diff] [blame] | 3281 | | $(ACP) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3282 | @echo "Package target files: $@" | 
| Dan Willemsen | f75d7fa | 2017-03-23 13:09:21 -0700 | [diff] [blame] | 3283 | $(call create-system-vendor-symlink) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3284 | $(call create-system-product-symlink) | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 3285 | $(call create-system-product_services-symlink) | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3286 | $(call create-vendor-odm-symlink) | 
| Dan Willemsen | 5e29cad | 2016-08-06 20:15:06 -0700 | [diff] [blame] | 3287 | $(hide) rm -rf $@ $@.list $(zip_root) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3288 | $(hide) mkdir -p $(dir $@) $(zip_root) | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 3289 | 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] | 3290 | @# Components of the recovery image | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 3291 | $(hide) mkdir -p $(zip_root)/$(PRIVATE_RECOVERY_OUT) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3292 | $(hide) $(call package_files-copy-root, \ | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 3293 | $(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] | 3294 | ifdef INSTALLED_KERNEL_TARGET | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3295 | $(hide) 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] | 3296 | endif | 
|  | 3297 | ifdef INSTALLED_2NDBOOTLOADER_TARGET | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3298 | $(hide) 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] | 3299 | endif | 
| Hridya Valsaraju | e74a38b | 2018-03-21 12:15:11 -0700 | [diff] [blame] | 3300 | ifdef BOARD_INCLUDE_RECOVERY_DTBO | 
| cfig | 2868740 | 2018-08-22 16:21:41 +0800 | [diff] [blame] | 3301 | $(hide) cp $(BOARD_PREBUILT_DTBOIMAGE) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/recovery_dtbo | 
| Hridya Valsaraju | e74a38b | 2018-03-21 12:15:11 -0700 | [diff] [blame] | 3302 | endif | 
| Dan Willemsen | c1f17ff | 2016-10-05 16:57:27 -0700 | [diff] [blame] | 3303 | ifdef INTERNAL_KERNEL_CMDLINE | 
|  | 3304 | $(hide) 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] | 3305 | endif | 
| Doug Zongker | 38a649f | 2009-06-17 09:07:09 -0700 | [diff] [blame] | 3306 | ifdef BOARD_KERNEL_BASE | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 3307 | $(hide) echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/base | 
| Doug Zongker | 38a649f | 2009-06-17 09:07:09 -0700 | [diff] [blame] | 3308 | endif | 
| Ying Wang | 4de6b5b | 2010-08-25 14:29:34 -0700 | [diff] [blame] | 3309 | ifdef BOARD_KERNEL_PAGESIZE | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 3310 | $(hide) echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/pagesize | 
| Ying Wang | 4de6b5b | 2010-08-25 14:29:34 -0700 | [diff] [blame] | 3311 | endif | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 3312 | 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] | 3313 | @# Components of the boot image | 
|  | 3314 | $(hide) mkdir -p $(zip_root)/BOOT | 
| Tao Bao | 62bd479 | 2015-07-21 18:01:20 -0700 | [diff] [blame] | 3315 | $(hide) mkdir -p $(zip_root)/ROOT | 
|  | 3316 | $(hide) $(call package_files-copy-root, \ | 
|  | 3317 | $(TARGET_ROOT_OUT),$(zip_root)/ROOT) | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 3318 | ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3319 | $(hide) $(call package_files-copy-root, \ | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 3320 | $(TARGET_RAMDISK_OUT),$(zip_root)/BOOT/RAMDISK) | 
| Tao Bao | 62bd479 | 2015-07-21 18:01:20 -0700 | [diff] [blame] | 3321 | endif | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 3322 | @# If we are using recovery as boot, this is already done when processing recovery. | 
|  | 3323 | ifneq ($(BOARD_USES_RECOVERY_AS_BOOT),true) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3324 | ifdef INSTALLED_KERNEL_TARGET | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3325 | $(hide) cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/BOOT/kernel | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3326 | endif | 
|  | 3327 | ifdef INSTALLED_2NDBOOTLOADER_TARGET | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3328 | $(hide) cp $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/BOOT/second | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3329 | endif | 
| Dan Willemsen | c1f17ff | 2016-10-05 16:57:27 -0700 | [diff] [blame] | 3330 | ifdef INTERNAL_KERNEL_CMDLINE | 
|  | 3331 | $(hide) echo "$(INTERNAL_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3332 | endif | 
| Doug Zongker | 38a649f | 2009-06-17 09:07:09 -0700 | [diff] [blame] | 3333 | ifdef BOARD_KERNEL_BASE | 
|  | 3334 | $(hide) echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/BOOT/base | 
|  | 3335 | endif | 
| Ying Wang | 4de6b5b | 2010-08-25 14:29:34 -0700 | [diff] [blame] | 3336 | ifdef BOARD_KERNEL_PAGESIZE | 
|  | 3337 | $(hide) echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/BOOT/pagesize | 
|  | 3338 | endif | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 3339 | endif # BOARD_USES_RECOVERY_AS_BOOT | 
| Doug Zongker | e01100c | 2009-06-19 17:12:18 -0700 | [diff] [blame] | 3340 | $(hide) $(foreach t,$(INSTALLED_RADIOIMAGE_TARGET),\ | 
|  | 3341 | mkdir -p $(zip_root)/RADIO; \ | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3342 | cp $(t) $(zip_root)/RADIO/$(notdir $(t));) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3343 | @# Contents of the system image | 
|  | 3344 | $(hide) $(call package_files-copy-root, \ | 
|  | 3345 | $(SYSTEMIMAGE_SOURCE_DIR),$(zip_root)/SYSTEM) | 
|  | 3346 | @# Contents of the data image | 
|  | 3347 | $(hide) $(call package_files-copy-root, \ | 
|  | 3348 | $(TARGET_OUT_DATA),$(zip_root)/DATA) | 
| Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 3349 | ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE | 
|  | 3350 | @# Contents of the vendor image | 
|  | 3351 | $(hide) $(call package_files-copy-root, \ | 
|  | 3352 | $(TARGET_OUT_VENDOR),$(zip_root)/VENDOR) | 
|  | 3353 | endif | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3354 | ifdef BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE | 
|  | 3355 | @# Contents of the product image | 
|  | 3356 | $(hide) $(call package_files-copy-root, \ | 
|  | 3357 | $(TARGET_OUT_PRODUCT),$(zip_root)/PRODUCT) | 
|  | 3358 | endif | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3359 | ifdef BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 3360 | @# Contents of the product_services image | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3361 | $(hide) $(call package_files-copy-root, \ | 
| Yifan Hong | 35be6ca | 2018-08-17 21:01:25 +0000 | [diff] [blame] | 3362 | $(TARGET_OUT_PRODUCT_SERVICES),$(zip_root)/PRODUCT_SERVICES) | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3363 | endif | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3364 | ifdef BOARD_ODMIMAGE_FILE_SYSTEM_TYPE | 
|  | 3365 | @# Contents of the odm image | 
|  | 3366 | $(hide) $(call package_files-copy-root, \ | 
|  | 3367 | $(TARGET_OUT_ODM),$(zip_root)/ODM) | 
|  | 3368 | endif | 
| Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 3369 | ifdef INSTALLED_SYSTEMOTHERIMAGE_TARGET | 
|  | 3370 | @# Contents of the system_other image | 
|  | 3371 | $(hide) $(call package_files-copy-root, \ | 
|  | 3372 | $(TARGET_OUT_SYSTEM_OTHER),$(zip_root)/SYSTEM_OTHER) | 
|  | 3373 | endif | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3374 | @# Extra contents of the OTA package | 
| Steve Fung | 48e49f5 | 2015-10-01 23:53:31 -0700 | [diff] [blame] | 3375 | $(hide) mkdir -p $(zip_root)/OTA | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3376 | $(hide) cp $(INSTALLED_ANDROID_INFO_TXT_TARGET) $(zip_root)/OTA/ | 
| Steve Fung | 48e49f5 | 2015-10-01 23:53:31 -0700 | [diff] [blame] | 3377 | ifneq ($(AB_OTA_UPDATER),true) | 
| Ying Wang | 03b6e8b | 2015-12-07 10:45:19 -0800 | [diff] [blame] | 3378 | ifneq ($(built_ota_tools),) | 
| Steve Fung | 48e49f5 | 2015-10-01 23:53:31 -0700 | [diff] [blame] | 3379 | $(hide) mkdir -p $(zip_root)/OTA/bin | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3380 | $(hide) cp $(PRIVATE_OTA_TOOLS) $(zip_root)/OTA/bin/ | 
| Steve Fung | 48e49f5 | 2015-10-01 23:53:31 -0700 | [diff] [blame] | 3381 | endif | 
| Ying Wang | 03b6e8b | 2015-12-07 10:45:19 -0800 | [diff] [blame] | 3382 | endif | 
| Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 3383 | @# 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] | 3384 | @# build them. | 
|  | 3385 | $(hide) mkdir -p $(zip_root)/META | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3386 | $(hide) cp $(APKCERTS_FILE) $(zip_root)/META/apkcerts.txt | 
|  | 3387 | ifneq ($(tool_extension),) | 
|  | 3388 | $(hide) cp $(PRIVATE_TOOL_EXTENSION) $(zip_root)/META/ | 
|  | 3389 | endif | 
| Ying Wang | 0eabd4f | 2015-03-24 19:07:40 -0700 | [diff] [blame] | 3390 | $(hide) echo "$(PRODUCT_OTA_PUBLIC_KEYS)" > $(zip_root)/META/otakeys.txt | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3391 | $(hide) cp $(SELINUX_FC) $(zip_root)/META/file_contexts.bin | 
| Doug Zongker | 3797473 | 2010-09-16 17:44:38 -0700 | [diff] [blame] | 3392 | $(hide) echo "recovery_api_version=$(PRIVATE_RECOVERY_API_VERSION)" > $(zip_root)/META/misc_info.txt | 
| Ken Sumrall | 31ce31f | 2013-02-21 16:27:25 -0800 | [diff] [blame] | 3393 | $(hide) echo "fstab_version=$(PRIVATE_RECOVERY_FSTAB_VERSION)" >> $(zip_root)/META/misc_info.txt | 
| Doug Zongker | b4c7d32 | 2010-07-01 15:30:11 -0700 | [diff] [blame] | 3394 | ifdef BOARD_FLASH_BLOCK_SIZE | 
| Doug Zongker | 3797473 | 2010-09-16 17:44:38 -0700 | [diff] [blame] | 3395 | $(hide) echo "blocksize=$(BOARD_FLASH_BLOCK_SIZE)" >> $(zip_root)/META/misc_info.txt | 
| Doug Zongker | b4c7d32 | 2010-07-01 15:30:11 -0700 | [diff] [blame] | 3396 | endif | 
|  | 3397 | ifdef BOARD_BOOTIMAGE_PARTITION_SIZE | 
| Ying Wang | 0083671 | 2011-01-14 11:30:56 -0800 | [diff] [blame] | 3398 | $(hide) echo "boot_size=$(BOARD_BOOTIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt | 
| Doug Zongker | b4c7d32 | 2010-07-01 15:30:11 -0700 | [diff] [blame] | 3399 | endif | 
| Tao Bao | db45efa | 2015-10-27 19:25:18 -0700 | [diff] [blame] | 3400 | ifeq ($(INSTALLED_RECOVERYIMAGE_TARGET),) | 
|  | 3401 | $(hide) echo "no_recovery=true" >> $(zip_root)/META/misc_info.txt | 
|  | 3402 | endif | 
| Hridya Valsaraju | e74a38b | 2018-03-21 12:15:11 -0700 | [diff] [blame] | 3403 | ifdef BOARD_INCLUDE_RECOVERY_DTBO | 
|  | 3404 | $(hide) echo "include_recovery_dtbo=true" >> $(zip_root)/META/misc_info.txt | 
|  | 3405 | endif | 
| Doug Zongker | b4c7d32 | 2010-07-01 15:30:11 -0700 | [diff] [blame] | 3406 | ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE | 
| Ying Wang | 0083671 | 2011-01-14 11:30:56 -0800 | [diff] [blame] | 3407 | $(hide) echo "recovery_size=$(BOARD_RECOVERYIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt | 
| Doug Zongker | b4c7d32 | 2010-07-01 15:30:11 -0700 | [diff] [blame] | 3408 | endif | 
| JP Abgrall | 6ea5bd6 | 2014-10-22 20:01:22 -0700 | [diff] [blame] | 3409 | ifdef TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS | 
|  | 3410 | @# TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS can be empty to indicate that nothing but defaults should be used. | 
|  | 3411 | $(hide) echo "recovery_mount_options=$(TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS)" >> $(zip_root)/META/misc_info.txt | 
|  | 3412 | else | 
|  | 3413 | $(hide) echo "recovery_mount_options=$(DEFAULT_TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS)" >> $(zip_root)/META/misc_info.txt | 
|  | 3414 | endif | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3415 | $(hide) echo "tool_extensions=$(PRIVATE_TOOL_EXTENSIONS)" >> $(zip_root)/META/misc_info.txt | 
| Ying Wang | 3c21fe5 | 2011-10-04 10:50:08 -0700 | [diff] [blame] | 3416 | $(hide) echo "default_system_dev_certificate=$(DEFAULT_SYSTEM_DEV_CERTIFICATE)" >> $(zip_root)/META/misc_info.txt | 
| Doug Zongker | 5d4808d | 2011-03-16 07:49:13 -0700 | [diff] [blame] | 3417 | ifdef PRODUCT_EXTRA_RECOVERY_KEYS | 
|  | 3418 | $(hide) echo "extra_recovery_keys=$(PRODUCT_EXTRA_RECOVERY_KEYS)" >> $(zip_root)/META/misc_info.txt | 
| Doug Zongker | e121d6a | 2011-02-01 14:13:52 -0800 | [diff] [blame] | 3419 | endif | 
| Jianxun Zhang | 0984949 | 2013-04-17 15:19:19 -0700 | [diff] [blame] | 3420 | $(hide) echo 'mkbootimg_args=$(BOARD_MKBOOTIMG_ARGS)' >> $(zip_root)/META/misc_info.txt | 
| Sami Tolvanen | 3303d90 | 2016-03-15 16:49:30 +0000 | [diff] [blame] | 3421 | $(hide) echo 'mkbootimg_version_args=$(INTERNAL_MKBOOTIMG_VERSION_ARGS)' >> $(zip_root)/META/misc_info.txt | 
| Doug Zongker | 9b23f2c | 2013-11-25 14:44:12 -0800 | [diff] [blame] | 3422 | $(hide) echo "multistage_support=1" >> $(zip_root)/META/misc_info.txt | 
| Tao Bao | 8fad03e | 2017-03-01 14:36:26 -0800 | [diff] [blame] | 3423 | $(hide) echo "blockimgdiff_versions=3,4" >> $(zip_root)/META/misc_info.txt | 
| Ying Wang | e24e17a | 2014-10-07 18:42:11 -0700 | [diff] [blame] | 3424 | ifneq ($(OEM_THUMBPRINT_PROPERTIES),) | 
| Jeff Sharkey | 26e1a28 | 2014-03-21 16:20:05 -0700 | [diff] [blame] | 3425 | # OTA scripts are only interested in fingerprint related properties | 
| Ying Wang | e24e17a | 2014-10-07 18:42:11 -0700 | [diff] [blame] | 3426 | $(hide) echo "oem_fingerprint_properties=$(OEM_THUMBPRINT_PROPERTIES)" >> $(zip_root)/META/misc_info.txt | 
| Vineeta Srivastava | 2726211 | 2014-09-18 14:34:00 -0700 | [diff] [blame] | 3427 | endif | 
| Tao Bao | f54216f | 2016-03-29 15:12:37 -0700 | [diff] [blame] | 3428 | ifneq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_BASE_FS_PATH),) | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3429 | $(hide) cp $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_BASE_FS_PATH) \ | 
| Tao Bao | f54216f | 2016-03-29 15:12:37 -0700 | [diff] [blame] | 3430 | $(zip_root)/META/$(notdir $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_BASE_FS_PATH)) | 
|  | 3431 | endif | 
|  | 3432 | ifneq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_BASE_FS_PATH),) | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3433 | $(hide) cp $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_BASE_FS_PATH) \ | 
| Tao Bao | f54216f | 2016-03-29 15:12:37 -0700 | [diff] [blame] | 3434 | $(zip_root)/META/$(notdir $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_BASE_FS_PATH)) | 
|  | 3435 | endif | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3436 | ifneq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_BASE_FS_PATH),) | 
|  | 3437 | $(hide) cp $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_BASE_FS_PATH) \ | 
|  | 3438 | $(zip_root)/META/$(notdir $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_BASE_FS_PATH)) | 
|  | 3439 | endif | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3440 | ifneq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_SERVICES_BASE_FS_PATH),) | 
|  | 3441 | $(hide) cp $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_SERVICES_BASE_FS_PATH) \ | 
|  | 3442 | $(zip_root)/META/$(notdir $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_SERVICES_BASE_FS_PATH)) | 
|  | 3443 | endif | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3444 | ifneq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ODM_BASE_FS_PATH),) | 
|  | 3445 | $(hide) cp $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ODM_BASE_FS_PATH) \ | 
|  | 3446 | $(zip_root)/META/$(notdir $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ODM_BASE_FS_PATH)) | 
|  | 3447 | endif | 
| Ivan Krasin | 74b32b8 | 2015-09-18 11:54:43 -0700 | [diff] [blame] | 3448 | ifneq ($(strip $(SANITIZE_TARGET)),) | 
| Ying Wang | 2a04839 | 2015-06-25 13:56:53 -0700 | [diff] [blame] | 3449 | # We need to create userdata.img with real data because the instrumented libraries are in userdata.img. | 
|  | 3450 | $(hide) echo "userdata_img_with_data=true" >> $(zip_root)/META/misc_info.txt | 
|  | 3451 | endif | 
| Tao Bao | 8beab69 | 2015-07-22 12:33:18 -0700 | [diff] [blame] | 3452 | ifeq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true) | 
|  | 3453 | $(hide) echo "full_recovery_image=true" >> $(zip_root)/META/misc_info.txt | 
|  | 3454 | endif | 
| David Zeuthen | 0eb1097 | 2016-09-28 17:55:27 -0400 | [diff] [blame] | 3455 | ifeq ($(BOARD_AVB_ENABLE),true) | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3456 | $(hide) echo "avb_enable=true" >> $(zip_root)/META/misc_info.txt | 
|  | 3457 | $(hide) echo "avb_vbmeta_key_path=$(BOARD_AVB_KEY_PATH)" >> $(zip_root)/META/misc_info.txt | 
|  | 3458 | $(hide) echo "avb_vbmeta_algorithm=$(BOARD_AVB_ALGORITHM)" >> $(zip_root)/META/misc_info.txt | 
|  | 3459 | $(hide) echo "avb_vbmeta_args=$(BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS)" >> $(zip_root)/META/misc_info.txt | 
|  | 3460 | $(hide) echo "avb_boot_add_hash_footer_args=$(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS)" >> $(zip_root)/META/misc_info.txt | 
|  | 3461 | ifdef BOARD_AVB_BOOT_KEY_PATH | 
|  | 3462 | $(hide) echo "avb_boot_key_path=$(BOARD_AVB_BOOT_KEY_PATH)" >> $(zip_root)/META/misc_info.txt | 
|  | 3463 | $(hide) echo "avb_boot_algorithm=$(BOARD_AVB_BOOT_ALGORITHM)" >> $(zip_root)/META/misc_info.txt | 
|  | 3464 | $(hide) echo "avb_boot_rollback_index_location=$(BOARD_AVB_BOOT_ROLLBACK_INDEX_LOCATION)" >> $(zip_root)/META/misc_info.txt | 
|  | 3465 | endif # BOARD_AVB_BOOT_KEY_PATH | 
| David Zeuthen | 8fecb28 | 2017-12-01 16:24:01 -0500 | [diff] [blame] | 3466 | $(hide) echo "avb_recovery_add_hash_footer_args=$(BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS)" >> $(zip_root)/META/misc_info.txt | 
|  | 3467 | ifdef BOARD_AVB_RECOVERY_KEY_PATH | 
|  | 3468 | $(hide) echo "avb_recovery_key_path=$(BOARD_AVB_RECOVERY_KEY_PATH)" >> $(zip_root)/META/misc_info.txt | 
|  | 3469 | $(hide) echo "avb_recovery_algorithm=$(BOARD_AVB_RECOVERY_ALGORITHM)" >> $(zip_root)/META/misc_info.txt | 
|  | 3470 | $(hide) echo "avb_recovery_rollback_index_location=$(BOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION)" >> $(zip_root)/META/misc_info.txt | 
|  | 3471 | endif # BOARD_AVB_RECOVERY_KEY_PATH | 
| Tao Bao | 744c4c7 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3472 | ifneq (,$(strip $(BOARD_AVB_VBMETA_MAINLINE))) | 
|  | 3473 | $(hide) echo "avb_vbmeta_mainline=$(BOARD_AVB_VBMETA_MAINLINE)" >> $(zip_root)/META/misc_info.txt | 
|  | 3474 | $(hide) echo "avb_vbmeta_mainline_args=$(BOARD_AVB_MAKE_VBMETA_MAINLINE_IMAGE_ARGS)" >> $(zip_root)/META/misc_info.txt | 
|  | 3475 | $(hide) echo "avb_vbmeta_mainline_key_path=$(BOARD_AVB_VBMETA_MAINLINE_KEY_PATH)" >> $(zip_root)/META/misc_info.txt | 
|  | 3476 | $(hide) echo "avb_vbmeta_mainline_algorithm=$(BOARD_AVB_VBMETA_MAINLINE_ALGORITHM)" >> $(zip_root)/META/misc_info.txt | 
|  | 3477 | $(hide) echo "avb_vbmeta_mainline_rollback_index_location=$(BOARD_AVB_VBMETA_MAINLINE_ROLLBACK_INDEX_LOCATION)" >> $(zip_root)/META/misc_info.txt | 
|  | 3478 | endif # BOARD_AVB_VBMETA_MAINLINE | 
|  | 3479 | ifneq (,$(strip $(BOARD_AVB_VBMETA_VENDOR))) | 
|  | 3480 | $(hide) echo "avb_vbmeta_vendor=$(BOARD_AVB_VBMETA_VENDOR)" >> $(zip_root)/META/misc_info.txt | 
|  | 3481 | $(hide) echo "avb_vbmeta_vendor_args=$(BOARD_AVB_MAKE_VBMETA_MAINLINE_IMAGE_ARGS)" >> $(zip_root)/META/misc_info.txt | 
|  | 3482 | $(hide) echo "avb_vbmeta_vendor_key_path=$(BOARD_AVB_VBMETA_VENDOR_KEY_PATH)" >> $(zip_root)/META/misc_info.txt | 
|  | 3483 | $(hide) echo "avb_vbmeta_vendor_algorithm=$(BOARD_AVB_VBMETA_VENDOR_ALGORITHM)" >> $(zip_root)/META/misc_info.txt | 
|  | 3484 | $(hide) echo "avb_vbmeta_vendor_rollback_index_location=$(BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX_LOCATION)" >> $(zip_root)/META/misc_info.txt | 
|  | 3485 | endif # BOARD_AVB_VBMETA_VENDOR_KEY_PATH | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3486 | endif # BOARD_AVB_ENABLE | 
| David Zeuthen | 2532862 | 2016-04-08 15:08:03 -0400 | [diff] [blame] | 3487 | ifdef BOARD_BPT_INPUT_FILES | 
|  | 3488 | $(hide) echo "board_bpt_enable=true" >> $(zip_root)/META/misc_info.txt | 
|  | 3489 | $(hide) echo "board_bpt_make_table_args=$(BOARD_BPT_MAKE_TABLE_ARGS)" >> $(zip_root)/META/misc_info.txt | 
|  | 3490 | $(hide) echo "board_bpt_input_files=$(BOARD_BPT_INPUT_FILES)" >> $(zip_root)/META/misc_info.txt | 
|  | 3491 | endif | 
|  | 3492 | ifdef BOARD_BPT_DISK_SIZE | 
|  | 3493 | $(hide) echo "board_bpt_disk_size=$(BOARD_BPT_DISK_SIZE)" >> $(zip_root)/META/misc_info.txt | 
|  | 3494 | endif | 
| Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame] | 3495 | $(call generate-userimage-prop-dictionary, $(zip_root)/META/misc_info.txt) | 
| Tao Bao | cbc6dc2 | 2015-08-18 18:03:56 -0700 | [diff] [blame] | 3496 | ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),) | 
| Per Astrand | cab6699 | 2015-03-25 14:06:30 +0100 | [diff] [blame] | 3497 | $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \ | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 3498 | build/make/tools/releasetools/make_recovery_patch $(zip_root) $(zip_root) | 
| Tao Bao | cbc6dc2 | 2015-08-18 18:03:56 -0700 | [diff] [blame] | 3499 | endif | 
| Alex Deymo | 70067ac | 2015-09-29 19:05:37 -0700 | [diff] [blame] | 3500 | ifeq ($(AB_OTA_UPDATER),true) | 
|  | 3501 | @# 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] | 3502 | $(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] | 3503 | $(hide) for part in $(AB_OTA_PARTITIONS); do \ | 
| Alex Deymo | 8925d33 | 2015-10-01 17:38:09 -0700 | [diff] [blame] | 3504 | echo "$${part}" >> $(zip_root)/META/ab_partitions.txt; \ | 
|  | 3505 | done | 
| Sen Jiang | 8f22e2a | 2015-11-12 13:53:25 -0800 | [diff] [blame] | 3506 | $(hide) for conf in $(AB_OTA_POSTINSTALL_CONFIG); do \ | 
|  | 3507 | echo "$${conf}" >> $(zip_root)/META/postinstall_config.txt; \ | 
|  | 3508 | done | 
| Steve Fung | 4044b38 | 2015-11-05 02:04:04 -0800 | [diff] [blame] | 3509 | @# Include the build type in META/misc_info.txt so the server can easily differentiate production builds. | 
|  | 3510 | $(hide) echo "build_type=$(TARGET_BUILD_VARIANT)" >> $(zip_root)/META/misc_info.txt | 
| Daniel Rosenberg | d80bef2 | 2015-11-10 19:21:34 -0800 | [diff] [blame] | 3511 | $(hide) echo "ab_update=true" >> $(zip_root)/META/misc_info.txt | 
| Bertrand SIMONNET | 4af7259 | 2015-10-08 15:32:40 -0700 | [diff] [blame] | 3512 | ifdef OSRELEASED_DIRECTORY | 
| Dan Willemsen | 653bea9 | 2017-03-21 15:47:37 -0700 | [diff] [blame] | 3513 | $(hide) cp $(TARGET_OUT_OEM)/$(OSRELEASED_DIRECTORY)/product_id $(zip_root)/META/product_id.txt | 
|  | 3514 | $(hide) cp $(TARGET_OUT_OEM)/$(OSRELEASED_DIRECTORY)/product_version $(zip_root)/META/product_version.txt | 
|  | 3515 | $(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] | 3516 | endif | 
| Alex Deymo | 70067ac | 2015-09-29 19:05:37 -0700 | [diff] [blame] | 3517 | endif | 
| Steve Fung | dfbab49 | 2015-09-24 18:12:33 -0700 | [diff] [blame] | 3518 | ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true) | 
| Alex Deymo | 70067ac | 2015-09-29 19:05:37 -0700 | [diff] [blame] | 3519 | @# If breakpad symbols have been generated, add them to the zip. | 
| Steve Fung | dfbab49 | 2015-09-24 18:12:33 -0700 | [diff] [blame] | 3520 | $(hide) $(ACP) -r $(TARGET_OUT_BREAKPAD) $(zip_root)/BREAKPAD | 
|  | 3521 | endif | 
| Dan Willemsen | 6c3e79b | 2016-06-17 14:07:37 -0700 | [diff] [blame] | 3522 | ifdef BOARD_PREBUILT_VENDORIMAGE | 
|  | 3523 | $(hide) mkdir -p $(zip_root)/IMAGES | 
|  | 3524 | $(hide) cp $(INSTALLED_VENDORIMAGE_TARGET) $(zip_root)/IMAGES/ | 
|  | 3525 | endif | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3526 | ifdef BOARD_PREBUILT_PRODUCTIMAGE | 
|  | 3527 | $(hide) mkdir -p $(zip_root)/IMAGES | 
|  | 3528 | $(hide) cp $(INSTALLED_PRODUCTIMAGE_TARGET) $(zip_root)/IMAGES/ | 
|  | 3529 | endif | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3530 | ifdef BOARD_PREBUILT_PRODUCT_SERVICESIMAGE | 
|  | 3531 | $(hide) mkdir -p $(zip_root)/IMAGES | 
|  | 3532 | $(hide) cp $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) $(zip_root)/IMAGES/ | 
|  | 3533 | endif | 
| Michael Schwartz | 0dc6f21 | 2017-07-18 10:05:13 -0700 | [diff] [blame] | 3534 | ifdef BOARD_PREBUILT_BOOTIMAGE | 
|  | 3535 | $(hide) mkdir -p $(zip_root)/IMAGES | 
|  | 3536 | $(hide) cp $(INSTALLED_BOOTIMAGE_TARGET) $(zip_root)/IMAGES/ | 
|  | 3537 | endif | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3538 | ifdef BOARD_PREBUILT_ODMIMAGE | 
|  | 3539 | $(hide) mkdir -p $(zip_root)/IMAGES | 
|  | 3540 | $(hide) cp $(INSTALLED_ODMIMAGE_TARGET) $(zip_root)/IMAGES/ | 
|  | 3541 | endif | 
| Yueyao Zhu | 889ee5e | 2017-05-12 17:50:46 -0700 | [diff] [blame] | 3542 | ifdef BOARD_PREBUILT_DTBOIMAGE | 
| Tao Bao | c633ed0 | 2017-05-30 21:46:33 -0700 | [diff] [blame] | 3543 | $(hide) mkdir -p $(zip_root)/PREBUILT_IMAGES | 
|  | 3544 | $(hide) cp $(INSTALLED_DTBOIMAGE_TARGET) $(zip_root)/PREBUILT_IMAGES/ | 
|  | 3545 | $(hide) echo "has_dtbo=true" >> $(zip_root)/META/misc_info.txt | 
|  | 3546 | ifeq ($(BOARD_AVB_ENABLE),true) | 
|  | 3547 | $(hide) echo "dtbo_size=$(BOARD_DTBOIMG_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3548 | $(hide) echo "avb_dtbo_add_hash_footer_args=$(BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS)" >> $(zip_root)/META/misc_info.txt | 
|  | 3549 | ifdef BOARD_AVB_DTBO_KEY_PATH | 
|  | 3550 | $(hide) echo "avb_dtbo_key_path=$(BOARD_AVB_DTBO_KEY_PATH)" >> $(zip_root)/META/misc_info.txt | 
|  | 3551 | $(hide) echo "avb_dtbo_algorithm=$(BOARD_AVB_DTBO_ALGORITHM)" >> $(zip_root)/META/misc_info.txt | 
|  | 3552 | $(hide) echo "avb_dtbo_rollback_index_location=$(BOARD_AVB_DTBO_ROLLBACK_INDEX_LOCATION)" \ | 
| Tao Bao | c633ed0 | 2017-05-30 21:46:33 -0700 | [diff] [blame] | 3553 | >> $(zip_root)/META/misc_info.txt | 
| Bowgo Tsai | 3e599ea | 2017-05-26 18:30:04 +0800 | [diff] [blame] | 3554 | endif # BOARD_AVB_DTBO_KEY_PATH | 
|  | 3555 | endif # BOARD_AVB_ENABLE | 
|  | 3556 | endif # BOARD_PREBUILT_DTBOIMAGE | 
| Tao Bao | 95a95c3 | 2017-06-16 15:30:23 -0700 | [diff] [blame] | 3557 | @# The radio images in BOARD_PACK_RADIOIMAGES will be additionally copied from RADIO/ into | 
|  | 3558 | @# IMAGES/, which then will be added into <product>-img.zip. Such images must be listed in | 
|  | 3559 | @# INSTALLED_RADIOIMAGE_TARGET. | 
|  | 3560 | $(hide) $(foreach part,$(BOARD_PACK_RADIOIMAGES), \ | 
|  | 3561 | echo $(part) >> $(zip_root)/META/pack_radioimages.txt;) | 
| Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 3562 | @# Run fs_config on all the system, vendor, boot ramdisk, | 
|  | 3563 | @# and recovery ramdisk files in the zip, and save the output | 
|  | 3564 | $(hide) $(call fs_config,$(zip_root)/SYSTEM,system/) > $(zip_root)/META/filesystem_config.txt | 
|  | 3565 | ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE | 
|  | 3566 | $(hide) $(call fs_config,$(zip_root)/VENDOR,vendor/) > $(zip_root)/META/vendor_filesystem_config.txt | 
|  | 3567 | endif | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3568 | ifdef BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE | 
|  | 3569 | $(hide) $(call fs_config,$(zip_root)/PRODUCT,product/) > $(zip_root)/META/product_filesystem_config.txt | 
|  | 3570 | endif | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3571 | ifdef BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 3572 | $(hide) $(call fs_config,$(zip_root)/PRODUCT_SERVICES,product_services/) > $(zip_root)/META/product_services_filesystem_config.txt | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3573 | endif | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3574 | ifdef BOARD_ODMIMAGE_FILE_SYSTEM_TYPE | 
|  | 3575 | $(hide) $(call fs_config,$(zip_root)/ODM,odm/) > $(zip_root)/META/odm_filesystem_config.txt | 
|  | 3576 | endif | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 3577 | @# ROOT always contains the files for the root under normal boot. | 
| Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 3578 | $(hide) $(call fs_config,$(zip_root)/ROOT,) > $(zip_root)/META/root_filesystem_config.txt | 
| Tom Cherry | d14b895 | 2018-08-09 14:26:00 -0700 | [diff] [blame] | 3579 | ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) | 
|  | 3580 | @# BOOT/RAMDISK exists only if additionally using BOARD_USES_RECOVERY_AS_BOOT. | 
| Tao Bao | da01b21 | 2018-02-28 21:20:08 -0800 | [diff] [blame] | 3581 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) | 
| Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 3582 | $(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] | 3583 | endif | 
|  | 3584 | else # BOARD_BUILD_SYSTEM_ROOT_IMAGE != true | 
|  | 3585 | $(hide) $(call fs_config,$(zip_root)/BOOT/RAMDISK,) > $(zip_root)/META/boot_filesystem_config.txt | 
|  | 3586 | endif | 
| Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 3587 | ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),) | 
|  | 3588 | $(hide) $(call fs_config,$(zip_root)/RECOVERY/RAMDISK,) > $(zip_root)/META/recovery_filesystem_config.txt | 
|  | 3589 | endif | 
|  | 3590 | ifdef INSTALLED_SYSTEMOTHERIMAGE_TARGET | 
|  | 3591 | $(hide) $(call fs_config,$(zip_root)/SYSTEM_OTHER,system/) > $(zip_root)/META/system_other_filesystem_config.txt | 
|  | 3592 | endif | 
| Michael Schwartz | 4d9cb56 | 2017-04-04 13:01:18 -0700 | [diff] [blame] | 3593 | @# Metadata for compatibility verification. | 
| Steven Moreland | 42a0afc | 2018-05-01 11:06:15 -0700 | [diff] [blame] | 3594 | $(hide) cp $(BUILT_SYSTEM_MATRIX) $(zip_root)/META/system_matrix.xml | 
| Steven Moreland | 627debe | 2018-05-01 09:54:21 -0700 | [diff] [blame] | 3595 | $(hide) cp $(BUILT_ASSEMBLED_SYSTEM_MANIFEST) $(zip_root)/META/system_manifest.xml | 
|  | 3596 | ifdef BUILT_ASSEMBLED_VENDOR_MANIFEST | 
|  | 3597 | $(hide) cp $(BUILT_ASSEMBLED_VENDOR_MANIFEST) $(zip_root)/META/vendor_manifest.xml | 
| Michael Schwartz | 4d9cb56 | 2017-04-04 13:01:18 -0700 | [diff] [blame] | 3598 | endif | 
| Yifan Hong | aa21221 | 2017-04-14 00:00:46 -0700 | [diff] [blame] | 3599 | ifdef BUILT_VENDOR_MATRIX | 
|  | 3600 | $(hide) cp $(BUILT_VENDOR_MATRIX) $(zip_root)/META/vendor_matrix.xml | 
| Michael Schwartz | 4d9cb56 | 2017-04-04 13:01:18 -0700 | [diff] [blame] | 3601 | endif | 
| David Anderson | 1ef03e2 | 2018-08-30 13:11:47 -0700 | [diff] [blame] | 3602 | ifdef BOARD_SUPER_PARTITION_SIZE | 
|  | 3603 | $(hide) echo "super_size=$(BOARD_SUPER_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt | 
|  | 3604 | $(hide) echo "lpmake=$(notdir $(LPMAKE))" >> $(zip_root)/META/misc_info.txt | 
|  | 3605 | $(hide) echo -n "lpmake_args=" >> $(zip_root)/META/misc_info.txt | 
|  | 3606 | $(hide) echo $(call build-superimage-target-args,$(if $(filter true,$(AB_OTA_UPDATER)),_a,)) \ | 
|  | 3607 | >> $(zip_root)/META/misc_info.txt | 
|  | 3608 | endif | 
| Michael Schwartz | 4d9cb56 | 2017-04-04 13:01:18 -0700 | [diff] [blame] | 3609 |  | 
| Dan Willemsen | 2a5a34f | 2017-03-05 19:56:52 -0800 | [diff] [blame] | 3610 | $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \ | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 3611 | build/make/tools/releasetools/add_img_to_target_files -a -v -p $(HOST_OUT) $(zip_root) | 
| Alex Deymo | 92cfd6f | 2016-01-26 18:47:44 -0800 | [diff] [blame] | 3612 | @# Zip everything up, preserving symlinks and placing META/ files first to | 
|  | 3613 | @# help early validation of the .zip file while uploading it. | 
| Dan Willemsen | 5e29cad | 2016-08-06 20:15:06 -0700 | [diff] [blame] | 3614 | $(hide) find $(zip_root)/META | sort >$@.list | 
| Nan Zhang | cabecd9 | 2017-03-20 18:22:43 -0700 | [diff] [blame] | 3615 | $(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] | 3616 | $(hide) $(SOONG_ZIP) -d -o $@ -C $(zip_root) -l $@.list | 
| Doug Zongker | 283e2a1 | 2010-03-15 17:52:32 -0700 | [diff] [blame] | 3617 |  | 
| Ying Wang | a0febe5 | 2013-03-20 11:02:05 -0700 | [diff] [blame] | 3618 | .PHONY: target-files-package | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3619 | target-files-package: $(BUILT_TARGET_FILES_PACKAGE) | 
|  | 3620 |  | 
| Ying Wang | 4709d7c | 2014-04-14 17:25:43 -0700 | [diff] [blame] | 3621 | ifneq ($(filter $(MAKECMDGOALS),target-files-package),) | 
|  | 3622 | $(call dist-for-goals, target-files-package, $(BUILT_TARGET_FILES_PACKAGE)) | 
|  | 3623 | endif | 
| Doug Zongker | 367910f | 2009-06-15 18:56:51 -0700 | [diff] [blame] | 3624 |  | 
| Dan Albert | 4d32333 | 2016-10-14 13:23:06 -0700 | [diff] [blame] | 3625 | # ----------------------------------------------------------------- | 
|  | 3626 | # NDK Sysroot Package | 
|  | 3627 | NDK_SYSROOT_TARGET := $(PRODUCT_OUT)/ndk_sysroot.tar.bz2 | 
| Dan Willemsen | 14e1026 | 2018-06-17 21:54:21 -0700 | [diff] [blame] | 3628 | $(NDK_SYSROOT_TARGET): $(SOONG_OUT_DIR)/ndk.timestamp | 
| Dan Albert | 4d32333 | 2016-10-14 13:23:06 -0700 | [diff] [blame] | 3629 | @echo Package NDK sysroot... | 
|  | 3630 | $(hide) tar cjf $@ -C $(SOONG_OUT_DIR) ndk | 
|  | 3631 |  | 
|  | 3632 | $(call dist-for-goals,sdk,$(NDK_SYSROOT_TARGET)) | 
|  | 3633 |  | 
| Ying Wang | 09c4b68 | 2015-08-11 11:24:19 -0700 | [diff] [blame] | 3634 | ifeq ($(build_ota_package),true) | 
| Ying Wang | 09a00a6 | 2010-10-20 14:01:09 -0700 | [diff] [blame] | 3635 | # ----------------------------------------------------------------- | 
|  | 3636 | # OTA update package | 
|  | 3637 |  | 
| Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 3638 | name := $(TARGET_PRODUCT) | 
|  | 3639 | ifeq ($(TARGET_BUILD_TYPE),debug) | 
|  | 3640 | name := $(name)_debug | 
|  | 3641 | endif | 
|  | 3642 | name := $(name)-ota-$(FILE_NAME_TAG) | 
|  | 3643 |  | 
|  | 3644 | INTERNAL_OTA_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip | 
|  | 3645 |  | 
|  | 3646 | $(INTERNAL_OTA_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR) | 
|  | 3647 |  | 
| Tao Bao | e53c6e7 | 2017-04-19 15:54:22 -0700 | [diff] [blame] | 3648 | ifeq ($(AB_OTA_UPDATER),true) | 
|  | 3649 | $(INTERNAL_OTA_PACKAGE_TARGET): $(BRILLO_UPDATE_PAYLOAD) | 
| Tianjie Xu | b0a29ad | 2017-07-06 15:13:59 -0700 | [diff] [blame] | 3650 | else | 
| Alex Deymo | b10e07a | 2017-11-09 23:53:42 +0100 | [diff] [blame] | 3651 | $(INTERNAL_OTA_PACKAGE_TARGET): $(BROTLI) | 
| Tao Bao | e53c6e7 | 2017-04-19 15:54:22 -0700 | [diff] [blame] | 3652 | endif | 
|  | 3653 |  | 
| Shinichiro Hamaji | ee2d211 | 2016-05-10 16:40:38 +0900 | [diff] [blame] | 3654 | $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) \ | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 3655 | build/make/tools/releasetools/ota_from_target_files | 
| Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 3656 | @echo "Package OTA: $@" | 
| Ying Wang | 9d252e1 | 2015-02-09 17:20:06 -0800 | [diff] [blame] | 3657 | $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \ | 
| Colin Cross | fdea893 | 2017-12-06 14:38:40 -0800 | [diff] [blame] | 3658 | build/make/tools/releasetools/ota_from_target_files -v \ | 
| Doug Zongker | 26e6619 | 2014-02-20 13:22:07 -0800 | [diff] [blame] | 3659 | --block \ | 
| Dan Willemsen | cea5cd2 | 2017-03-21 14:44:27 -0700 | [diff] [blame] | 3660 | --extracted_input_target_files $(patsubst %.zip,%,$(BUILT_TARGET_FILES_PACKAGE)) \ | 
| Doug Zongker | 602a84e | 2009-06-18 08:35:12 -0700 | [diff] [blame] | 3661 | -p $(HOST_OUT) \ | 
| Stephen Smalley | 56882bf | 2012-02-09 13:36:21 -0500 | [diff] [blame] | 3662 | -k $(KEY_CERT_PAIR) \ | 
| Michael Runge | 6e83611 | 2014-04-15 17:40:21 -0700 | [diff] [blame] | 3663 | $(if $(OEM_OTA_CONFIG), -o $(OEM_OTA_CONFIG)) \ | 
| Stephen Smalley | 56882bf | 2012-02-09 13:36:21 -0500 | [diff] [blame] | 3664 | $(BUILT_TARGET_FILES_PACKAGE) $@ | 
| Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 3665 |  | 
|  | 3666 | .PHONY: otapackage | 
|  | 3667 | otapackage: $(INTERNAL_OTA_PACKAGE_TARGET) | 
|  | 3668 |  | 
| Ying Wang | 09c4b68 | 2015-08-11 11:24:19 -0700 | [diff] [blame] | 3669 | endif    # build_ota_package | 
| Ying Wang | f8824af | 2014-06-03 14:07:27 -0700 | [diff] [blame] | 3670 |  | 
| Ying Wang | 09a00a6 | 2010-10-20 14:01:09 -0700 | [diff] [blame] | 3671 | # ----------------------------------------------------------------- | 
|  | 3672 | # The update package | 
|  | 3673 |  | 
|  | 3674 | name := $(TARGET_PRODUCT) | 
|  | 3675 | ifeq ($(TARGET_BUILD_TYPE),debug) | 
|  | 3676 | name := $(name)_debug | 
|  | 3677 | endif | 
|  | 3678 | name := $(name)-img-$(FILE_NAME_TAG) | 
|  | 3679 |  | 
|  | 3680 | INTERNAL_UPDATE_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip | 
|  | 3681 |  | 
| Dan Willemsen | 5e29cad | 2016-08-06 20:15:06 -0700 | [diff] [blame] | 3682 | $(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(ZIP2ZIP) | 
| Ying Wang | 09a00a6 | 2010-10-20 14:01:09 -0700 | [diff] [blame] | 3683 | @echo "Package: $@" | 
| Dan Willemsen | 5e29cad | 2016-08-06 20:15:06 -0700 | [diff] [blame] | 3684 | $(hide) $(ZIP2ZIP) -i $(BUILT_TARGET_FILES_PACKAGE) -o $@ \ | 
|  | 3685 | OTA/android-info.txt:android-info.txt "IMAGES/*.img:." | 
| Ying Wang | 09a00a6 | 2010-10-20 14:01:09 -0700 | [diff] [blame] | 3686 |  | 
|  | 3687 | .PHONY: updatepackage | 
|  | 3688 | updatepackage: $(INTERNAL_UPDATE_PACKAGE_TARGET) | 
|  | 3689 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3690 | # ----------------------------------------------------------------- | 
| Dario Freni | d101127 | 2018-07-23 20:20:15 +0100 | [diff] [blame] | 3691 | # A zip of the appcompat directory containing logs | 
|  | 3692 | APPCOMPAT_ZIP := $(PRODUCT_OUT)/appcompat.zip | 
|  | 3693 | # For apps_only build we'll establish the dependency later in build/make/core/main.mk. | 
|  | 3694 | ifndef TARGET_BUILD_APPS | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3695 | $(APPCOMPAT_ZIP): $(INSTALLED_SYSTEMIMAGE_TARGET) \ | 
| Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 3696 | $(INSTALLED_RAMDISK_TARGET) \ | 
| Dario Freni | d101127 | 2018-07-23 20:20:15 +0100 | [diff] [blame] | 3697 | $(INSTALLED_BOOTIMAGE_TARGET) \ | 
|  | 3698 | $(INSTALLED_USERDATAIMAGE_TARGET) \ | 
|  | 3699 | $(INSTALLED_VENDORIMAGE_TARGET) \ | 
|  | 3700 | $(INSTALLED_PRODUCTIMAGE_TARGET) \ | 
|  | 3701 | $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) | 
|  | 3702 | endif | 
|  | 3703 | $(APPCOMPAT_ZIP): PRIVATE_LIST_FILE := $(call intermediates-dir-for,PACKAGING,appcompat)/filelist | 
|  | 3704 | $(APPCOMPAT_ZIP): $(SOONG_ZIP) | 
|  | 3705 | @echo "appcompat logs: $@" | 
|  | 3706 | $(hide) rm -rf $@ $(PRIVATE_LIST_FILE) | 
|  | 3707 | $(hide) mkdir -p $(dir $@) $(PRODUCT_OUT)/appcompat $(dir $(PRIVATE_LIST_FILE)) | 
|  | 3708 | $(hide) find $(PRODUCT_OUT)/appcompat | sort >$(PRIVATE_LIST_FILE) | 
|  | 3709 | $(hide) $(SOONG_ZIP) -d -o $@ -C $(PRODUCT_OUT)/appcompat -l $(PRIVATE_LIST_FILE) | 
|  | 3710 |  | 
|  | 3711 |  | 
|  | 3712 | # ----------------------------------------------------------------- | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3713 | # A zip of the symbols directory.  Keep the full paths to make it | 
|  | 3714 | # more obvious where these files came from. | 
|  | 3715 | # | 
|  | 3716 | name := $(TARGET_PRODUCT) | 
|  | 3717 | ifeq ($(TARGET_BUILD_TYPE),debug) | 
|  | 3718 | name := $(name)_debug | 
|  | 3719 | endif | 
|  | 3720 | name := $(name)-symbols-$(FILE_NAME_TAG) | 
|  | 3721 |  | 
|  | 3722 | SYMBOLS_ZIP := $(PRODUCT_OUT)/$(name).zip | 
| Colin Cross | 6cdc5d2 | 2017-10-20 11:37:33 -0700 | [diff] [blame] | 3723 | # 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] | 3724 | ifndef TARGET_BUILD_APPS | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3725 | $(SYMBOLS_ZIP): $(INSTALLED_SYSTEMIMAGE_TARGET) \ | 
| Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 3726 | $(INSTALLED_RAMDISK_TARGET) \ | 
| Shinichiro Hamaji | ee2d211 | 2016-05-10 16:40:38 +0900 | [diff] [blame] | 3727 | $(INSTALLED_BOOTIMAGE_TARGET) \ | 
|  | 3728 | $(INSTALLED_USERDATAIMAGE_TARGET) \ | 
|  | 3729 | $(INSTALLED_VENDORIMAGE_TARGET) \ | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3730 | $(INSTALLED_PRODUCTIMAGE_TARGET) \ | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3731 | $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) \ | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3732 | $(INSTALLED_ODMIMAGE_TARGET) \ | 
| Shinichiro Hamaji | ee2d211 | 2016-05-10 16:40:38 +0900 | [diff] [blame] | 3733 | $(updater_dep) | 
| Ying Wang | da3b972 | 2014-10-24 11:36:59 -0700 | [diff] [blame] | 3734 | endif | 
| Dan Willemsen | 5e29cad | 2016-08-06 20:15:06 -0700 | [diff] [blame] | 3735 | $(SYMBOLS_ZIP): PRIVATE_LIST_FILE := $(call intermediates-dir-for,PACKAGING,symbols)/filelist | 
|  | 3736 | $(SYMBOLS_ZIP): $(SOONG_ZIP) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3737 | @echo "Package symbols: $@" | 
| Dan Willemsen | 5e29cad | 2016-08-06 20:15:06 -0700 | [diff] [blame] | 3738 | $(hide) rm -rf $@ $(PRIVATE_LIST_FILE) | 
|  | 3739 | $(hide) mkdir -p $(dir $@) $(TARGET_OUT_UNSTRIPPED) $(dir $(PRIVATE_LIST_FILE)) | 
|  | 3740 | $(hide) find $(TARGET_OUT_UNSTRIPPED) | sort >$(PRIVATE_LIST_FILE) | 
| Dan Willemsen | 6cf21a7 | 2017-01-30 20:42:28 -0800 | [diff] [blame] | 3741 | $(hide) $(SOONG_ZIP) -d -o $@ -C $(OUT_DIR)/.. -l $(PRIVATE_LIST_FILE) | 
| Ryan Campbell | 81c9d29 | 2016-09-12 13:56:50 -0700 | [diff] [blame] | 3742 | # ----------------------------------------------------------------- | 
|  | 3743 | # A zip of the coverage directory. | 
|  | 3744 | # | 
|  | 3745 | name := $(TARGET_PRODUCT) | 
|  | 3746 | ifeq ($(TARGET_BUILD_TYPE),debug) | 
|  | 3747 | name := $(name)_debug | 
|  | 3748 | endif | 
|  | 3749 | name := $(name)-coverage-$(FILE_NAME_TAG) | 
|  | 3750 | COVERAGE_ZIP := $(PRODUCT_OUT)/$(name).zip | 
|  | 3751 | ifndef TARGET_BUILD_APPS | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3752 | $(COVERAGE_ZIP): $(INSTALLED_SYSTEMIMAGE_TARGET) \ | 
| Tao Bao | b1a2e35 | 2018-08-14 16:17:12 -0700 | [diff] [blame] | 3753 | $(INSTALLED_RAMDISK_TARGET) \ | 
| Ryan Campbell | 81c9d29 | 2016-09-12 13:56:50 -0700 | [diff] [blame] | 3754 | $(INSTALLED_BOOTIMAGE_TARGET) \ | 
|  | 3755 | $(INSTALLED_USERDATAIMAGE_TARGET) \ | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3756 | $(INSTALLED_VENDORIMAGE_TARGET) \ | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3757 | $(INSTALLED_PRODUCTIMAGE_TARGET) \ | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3758 | $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) \ | 
|  | 3759 | $(INSTALLED_ODMIMAGE_TARGET) | 
| Ryan Campbell | 81c9d29 | 2016-09-12 13:56:50 -0700 | [diff] [blame] | 3760 | endif | 
|  | 3761 | $(COVERAGE_ZIP): PRIVATE_LIST_FILE := $(call intermediates-dir-for,PACKAGING,coverage)/filelist | 
|  | 3762 | $(COVERAGE_ZIP): $(SOONG_ZIP) | 
|  | 3763 | @echo "Package coverage: $@" | 
|  | 3764 | $(hide) rm -rf $@ $(PRIVATE_LIST_FILE) | 
|  | 3765 | $(hide) mkdir -p $(dir $@) $(TARGET_OUT_COVERAGE) $(dir $(PRIVATE_LIST_FILE)) | 
|  | 3766 | $(hide) find $(TARGET_OUT_COVERAGE) | sort >$(PRIVATE_LIST_FILE) | 
|  | 3767 | $(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] | 3768 |  | 
|  | 3769 | # ----------------------------------------------------------------- | 
|  | 3770 | # A zip of the Android Apps. Not keeping full path so that we don't | 
|  | 3771 | # include product names when distributing | 
|  | 3772 | # | 
|  | 3773 | name := $(TARGET_PRODUCT) | 
|  | 3774 | ifeq ($(TARGET_BUILD_TYPE),debug) | 
|  | 3775 | name := $(name)_debug | 
|  | 3776 | endif | 
|  | 3777 | name := $(name)-apps-$(FILE_NAME_TAG) | 
|  | 3778 |  | 
|  | 3779 | APPS_ZIP := $(PRODUCT_OUT)/$(name).zip | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3780 | $(APPS_ZIP): $(INSTALLED_SYSTEMIMAGE_TARGET) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3781 | @echo "Package apps: $@" | 
|  | 3782 | $(hide) rm -rf $@ | 
|  | 3783 | $(hide) mkdir -p $(dir $@) | 
| Gaurav Shah | 67c2ed3 | 2015-08-23 09:40:05 -0700 | [diff] [blame] | 3784 | $(hide) apps_to_zip=`find $(TARGET_OUT_APPS) $(TARGET_OUT_APPS_PRIVILEGED) -mindepth 2 -maxdepth 3 -name "*.apk"`; \ | 
|  | 3785 | if [ -z "$$apps_to_zip" ]; then \ | 
|  | 3786 | echo "No apps to zip up. Generating empty apps archive." ; \ | 
|  | 3787 | a=$$(mktemp /tmp/XXXXXXX) && touch $$a && zip $@ $$a && zip -d $@ $$a; \ | 
|  | 3788 | else \ | 
| Dan Willemsen | 48a621c | 2015-10-29 16:33:05 -0700 | [diff] [blame] | 3789 | zip -qjX $@ $$apps_to_zip; \ | 
| Gaurav Shah | 67c2ed3 | 2015-08-23 09:40:05 -0700 | [diff] [blame] | 3790 | fi | 
| Guang Zhu | 0198d6e | 2010-04-23 11:54:37 -0700 | [diff] [blame] | 3791 |  | 
| Ying Wang | bc415dd | 2012-08-15 12:22:44 -0700 | [diff] [blame] | 3792 | ifeq (true,$(EMMA_INSTRUMENT)) | 
| Colin Cross | a6bc3a8 | 2017-09-27 14:28:41 -0700 | [diff] [blame] | 3793 | #------------------------------------------------------------------ | 
|  | 3794 | # An archive of classes for use in generating code-coverage reports | 
|  | 3795 | # These are the uninstrumented versions of any classes that were | 
|  | 3796 | # to be instrumented. | 
| Colin Cross | 6cdc5d2 | 2017-10-20 11:37:33 -0700 | [diff] [blame] | 3797 | # Any dependencies are set up later in build/make/core/main.mk. | 
| Jeff Gaston | aaae43c | 2017-04-11 16:36:46 -0700 | [diff] [blame] | 3798 |  | 
| Colin Cross | a6bc3a8 | 2017-09-27 14:28:41 -0700 | [diff] [blame] | 3799 | JACOCO_REPORT_CLASSES_ALL := $(PRODUCT_OUT)/jacoco-report-classes-all.jar | 
| Jeff Gaston | aaae43c | 2017-04-11 16:36:46 -0700 | [diff] [blame] | 3800 | $(JACOCO_REPORT_CLASSES_ALL) : | 
|  | 3801 | @echo "Collecting uninstrumented classes" | 
|  | 3802 | $(hide) find $(TARGET_COMMON_OUT_ROOT) $(HOST_COMMON_OUT_ROOT) -name "jacoco-report-classes.jar" | \ | 
|  | 3803 | zip -@ -0 -q -X $@ | 
|  | 3804 | # Meaning of these options: | 
|  | 3805 | # -@ scan stdin for file paths to add to the zip | 
|  | 3806 | # -0 don't do any compression | 
|  | 3807 | # -q supress most output | 
|  | 3808 | # -X skip storing extended file attributes | 
|  | 3809 |  | 
| Ying Wang | bc415dd | 2012-08-15 12:22:44 -0700 | [diff] [blame] | 3810 | endif # EMMA_INSTRUMENT=true | 
|  | 3811 |  | 
| Jeff Gaston | aaae43c | 2017-04-11 16:36:46 -0700 | [diff] [blame] | 3812 |  | 
| Ying Wang | ae9115a | 2013-08-22 20:52:47 -0700 | [diff] [blame] | 3813 | #------------------------------------------------------------------ | 
|  | 3814 | # A zip of Proguard obfuscation dictionary files. | 
|  | 3815 | # Only for apps_only build. | 
|  | 3816 | # | 
|  | 3817 | ifdef TARGET_BUILD_APPS | 
| Ying Wang | c62c92c | 2013-08-28 18:38:25 -0700 | [diff] [blame] | 3818 | PROGUARD_DICT_ZIP := $(PRODUCT_OUT)/$(TARGET_PRODUCT)-proguard-dict-$(FILE_NAME_TAG).zip | 
| Colin Cross | 6cdc5d2 | 2017-10-20 11:37:33 -0700 | [diff] [blame] | 3819 | # the dependency will be set up later in build/make/core/main.mk. | 
| Ying Wang | ae9115a | 2013-08-22 20:52:47 -0700 | [diff] [blame] | 3820 | $(PROGUARD_DICT_ZIP) : | 
|  | 3821 | @echo "Packaging Proguard obfuscation dictionary files." | 
| Colin Cross | a6bc3a8 | 2017-09-27 14:28:41 -0700 | [diff] [blame] | 3822 | $(hide) dict_files=`find $(TARGET_OUT_COMMON_INTERMEDIATES)/APPS -name proguard_dictionary`; \ | 
| Ying Wang | ae9115a | 2013-08-22 20:52:47 -0700 | [diff] [blame] | 3823 | if [ -n "$$dict_files" ]; then \ | 
| Ying Wang | 33d6459 | 2013-11-25 17:39:50 -0800 | [diff] [blame] | 3824 | unobfuscated_jars=$${dict_files//proguard_dictionary/classes.jar}; \ | 
| Dan Willemsen | 48a621c | 2015-10-29 16:33:05 -0700 | [diff] [blame] | 3825 | zip -qX $@ $$dict_files $$unobfuscated_jars; \ | 
| Ying Wang | ae9115a | 2013-08-22 20:52:47 -0700 | [diff] [blame] | 3826 | else \ | 
| Ying Wang | dcd9083 | 2015-02-26 09:36:27 -0800 | [diff] [blame] | 3827 | touch $(dir $@)/zipdummy; \ | 
|  | 3828 | (cd $(dir $@) && zip -q $(notdir $@) zipdummy); \ | 
|  | 3829 | zip -qd $@ zipdummy; \ | 
|  | 3830 | rm $(dir $@)/zipdummy; \ | 
| Ying Wang | ae9115a | 2013-08-22 20:52:47 -0700 | [diff] [blame] | 3831 | fi | 
|  | 3832 |  | 
|  | 3833 | endif # TARGET_BUILD_APPS | 
|  | 3834 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3835 | # ----------------------------------------------------------------- | 
|  | 3836 | # dalvik something | 
|  | 3837 | .PHONY: dalvikfiles | 
|  | 3838 | dalvikfiles: $(INTERNAL_DALVIK_MODULES) | 
|  | 3839 |  | 
| Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 3840 | ifeq ($(BUILD_QEMU_IMAGES),true) | 
|  | 3841 | INSTALLED_QEMU_SYSTEMIMAGE := $(PRODUCT_OUT)/system-qemu.img | 
|  | 3842 | MK_QEMU_IMAGE_SH := device/generic/goldfish/tools/mk_qemu_image.sh | 
|  | 3843 | SGDISK_HOST := $(HOST_OUT_EXECUTABLES)/sgdisk | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3844 | $(INSTALLED_QEMU_SYSTEMIMAGE): $(INSTALLED_SYSTEMIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) $(SIMG2IMG) | 
| Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 3845 | @echo Create system-qemu.img | 
| Isaac Chen | b9b51b1 | 2018-08-03 18:34:55 +0000 | [diff] [blame] | 3846 | (export SGDISK=$(SGDISK_HOST) SIMG2IMG=$(SIMG2IMG); $(MK_QEMU_IMAGE_SH) ${PRODUCT_OUT}/system.img) | 
| Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 3847 |  | 
|  | 3848 | systemimage: $(INSTALLED_QEMU_SYSTEMIMAGE) | 
|  | 3849 | droidcore: $(INSTALLED_QEMU_SYSTEMIMAGE) | 
|  | 3850 | ifeq ($(BOARD_USES_VENDORIMAGE),true) | 
|  | 3851 | INSTALLED_QEMU_VENDORIMAGE := $(PRODUCT_OUT)/vendor-qemu.img | 
| Isaac Chen | b9b51b1 | 2018-08-03 18:34:55 +0000 | [diff] [blame] | 3852 | $(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] | 3853 | @echo Create vendor-qemu.img | 
| Isaac Chen | b9b51b1 | 2018-08-03 18:34:55 +0000 | [diff] [blame] | 3854 | (export SGDISK=$(SGDISK_HOST) SIMG2IMG=$(SIMG2IMG); $(MK_QEMU_IMAGE_SH) ${PRODUCT_OUT}/vendor.img) | 
| Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 3855 |  | 
|  | 3856 | vendorimage: $(INSTALLED_QEMU_VENDORIMAGE) | 
|  | 3857 | droidcore: $(INSTALLED_QEMU_VENDORIMAGE) | 
|  | 3858 | endif | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3859 | ifeq ($(BOARD_USES_PRODUCTIMAGE),true) | 
|  | 3860 | INSTALLED_QEMU_PRODUCTIMAGE := $(PRODUCT_OUT)/product-qemu.img | 
| Isaac Chen | b9b51b1 | 2018-08-03 18:34:55 +0000 | [diff] [blame] | 3861 | $(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] | 3862 | @echo Create product-qemu.img | 
| Isaac Chen | b9b51b1 | 2018-08-03 18:34:55 +0000 | [diff] [blame] | 3863 | (export SGDISK=$(SGDISK_HOST) SIMG2IMG=$(SIMG2IMG); $(MK_QEMU_IMAGE_SH) ${PRODUCT_OUT}/product.img) | 
| Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 3864 |  | 
|  | 3865 | productimage: $(INSTALLED_QEMU_PRODUCTIMAGE) | 
|  | 3866 | droidcore: $(INSTALLED_QEMU_PRODUCTIMAGE) | 
|  | 3867 | endif | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3868 | ifeq ($(BOARD_USES_PRODUCT_SERVICESIMAGE),true) | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 3869 | INSTALLED_QEMU_PRODUCT_SERVICESIMAGE := $(PRODUCT_OUT)/product_services-qemu.img | 
| Isaac Chen | b9b51b1 | 2018-08-03 18:34:55 +0000 | [diff] [blame] | 3870 | $(INSTALLED_QEMU_PRODUCT_SERVICESIMAGE): $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) $(SIMG2IMG) | 
| Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 3871 | @echo Create product_services-qemu.img | 
|  | 3872 | (export SGDISK=$(SGDISK_HOST) SIMG2IMG=$(SIMG2IMG); $(MK_QEMU_IMAGE_SH) ${PRODUCT_OUT}/product_services.img) | 
| Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 3873 |  | 
|  | 3874 | productservicesimage: $(INSTALLED_QEMU_PRODUCT_SERVICESIMAGE) | 
|  | 3875 | droidcore: $(INSTALLED_QEMU_PRODUCT_SERVICESIMAGE) | 
|  | 3876 | endif | 
| Bowgo Tsai | d624fa6 | 2017-11-14 23:42:30 +0800 | [diff] [blame] | 3877 | ifeq ($(BOARD_USES_ODMIMAGE),true) | 
|  | 3878 | INSTALLED_QEMU_ODMIMAGE := $(PRODUCT_OUT)/odm-qemu.img | 
|  | 3879 | $(INSTALLED_QEMU_ODMIMAGE): $(INSTALLED_ODMIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) | 
|  | 3880 | @echo Create odm-qemu.img | 
|  | 3881 | (export SGDISK=$(SGDISK_HOST); $(MK_QEMU_IMAGE_SH) ${PRODUCT_OUT}/odm.img) | 
|  | 3882 |  | 
|  | 3883 | odmimage: $(INSTALLED_QEMU_ODMIMAGE) | 
|  | 3884 | droidcore: $(INSTALLED_QEMU_ODMIMAGE) | 
|  | 3885 | endif | 
| Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 3886 | endif | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3887 | # ----------------------------------------------------------------- | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3888 | # The emulator package | 
| Ying Wang | 7d8c535 | 2012-07-26 10:15:21 -0700 | [diff] [blame] | 3889 | ifeq ($(BUILD_EMULATOR),true) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3890 | INTERNAL_EMULATOR_PACKAGE_FILES += \ | 
|  | 3891 | $(HOST_OUT_EXECUTABLES)/emulator$(HOST_EXECUTABLE_SUFFIX) \ | 
| Jean-Baptiste Queru | 5ea72ef | 2012-01-06 16:44:06 -0800 | [diff] [blame] | 3892 | prebuilts/qemu-kernel/$(TARGET_ARCH)/kernel-qemu \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3893 | $(INSTALLED_RAMDISK_TARGET) \ | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3894 | $(INSTALLED_SYSTEMIMAGE_TARGET) \ | 
|  | 3895 | $(INSTALLED_USERDATAIMAGE_TARGET) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3896 |  | 
|  | 3897 | name := $(TARGET_PRODUCT)-emulator-$(FILE_NAME_TAG) | 
|  | 3898 |  | 
|  | 3899 | INTERNAL_EMULATOR_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip | 
|  | 3900 |  | 
| Ying Wang | 5d88770 | 2015-11-04 10:06:25 -0800 | [diff] [blame] | 3901 | $(INTERNAL_EMULATOR_PACKAGE_TARGET): $(INTERNAL_EMULATOR_PACKAGE_FILES) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3902 | @echo "Package: $@" | 
| Dan Willemsen | 48a621c | 2015-10-29 16:33:05 -0700 | [diff] [blame] | 3903 | $(hide) zip -qjX $@ $(INTERNAL_EMULATOR_PACKAGE_FILES) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3904 |  | 
| Ying Wang | 7d8c535 | 2012-07-26 10:15:21 -0700 | [diff] [blame] | 3905 | endif | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3906 | # ----------------------------------------------------------------- | 
| Keun young Park | 7fc7aad | 2012-02-27 15:49:23 -0800 | [diff] [blame] | 3907 | # Old PDK stuffs, retired | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3908 | # The pdk package (Platform Development Kit) | 
|  | 3909 |  | 
| Keun young Park | 7fc7aad | 2012-02-27 15:49:23 -0800 | [diff] [blame] | 3910 | #ifneq (,$(filter pdk,$(MAKECMDGOALS))) | 
|  | 3911 | #  include development/pdk/Pdk.mk | 
|  | 3912 | #endif | 
|  | 3913 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3914 |  | 
|  | 3915 | # ----------------------------------------------------------------- | 
|  | 3916 | # The SDK | 
|  | 3917 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3918 | # The SDK includes host-specific components, so it belongs under HOST_OUT. | 
| Ying Wang | d7af176 | 2014-06-02 16:16:53 -0700 | [diff] [blame] | 3919 | sdk_dir := $(HOST_OUT)/sdk/$(TARGET_PRODUCT) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3920 |  | 
|  | 3921 | # Build a name that looks like: | 
|  | 3922 | # | 
|  | 3923 | #     linux-x86   --> android-sdk_12345_linux-x86 | 
|  | 3924 | #     darwin-x86  --> android-sdk_12345_mac-x86 | 
|  | 3925 | #     windows-x86 --> android-sdk_12345_windows | 
|  | 3926 | # | 
|  | 3927 | sdk_name := android-sdk_$(FILE_NAME_TAG) | 
|  | 3928 | ifeq ($(HOST_OS),darwin) | 
| Joe Onorato | 03fbe40 | 2009-04-13 08:31:16 -0700 | [diff] [blame] | 3929 | INTERNAL_SDK_HOST_OS_NAME := mac | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3930 | else | 
| Joe Onorato | 03fbe40 | 2009-04-13 08:31:16 -0700 | [diff] [blame] | 3931 | INTERNAL_SDK_HOST_OS_NAME := $(HOST_OS) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3932 | endif | 
|  | 3933 | ifneq ($(HOST_OS),windows) | 
| Ying Wang | 2713fce | 2014-06-09 12:31:12 -0700 | [diff] [blame] | 3934 | 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] | 3935 | endif | 
| Joe Onorato | 03fbe40 | 2009-04-13 08:31:16 -0700 | [diff] [blame] | 3936 | sdk_name := $(sdk_name)_$(INTERNAL_SDK_HOST_OS_NAME) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3937 |  | 
|  | 3938 | sdk_dep_file := $(sdk_dir)/sdk_deps.mk | 
|  | 3939 |  | 
|  | 3940 | ATREE_FILES := | 
|  | 3941 | -include $(sdk_dep_file) | 
|  | 3942 |  | 
|  | 3943 | # if we don't have a real list, then use "everything" | 
|  | 3944 | ifeq ($(strip $(ATREE_FILES)),) | 
|  | 3945 | ATREE_FILES := \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3946 | $(ALL_DEFAULT_INSTALLED_MODULES) \ | 
|  | 3947 | $(INSTALLED_RAMDISK_TARGET) \ | 
|  | 3948 | $(ALL_DOCS) \ | 
| Nan Zhang | cb0a688 | 2018-08-07 15:26:32 -0700 | [diff] [blame] | 3949 | $(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] | 3950 | $(ALL_SDK_FILES) | 
|  | 3951 | endif | 
|  | 3952 |  | 
|  | 3953 | atree_dir := development/build | 
|  | 3954 |  | 
| David 'Digit' Turner | 74b0c36 | 2011-03-23 11:20:14 +0100 | [diff] [blame] | 3955 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3956 | sdk_atree_files := \ | 
|  | 3957 | $(atree_dir)/sdk.exclude.atree \ | 
| Ying Wang | 2713fce | 2014-06-09 12:31:12 -0700 | [diff] [blame] | 3958 | $(atree_dir)/sdk-$(HOST_OS)-$(SDK_HOST_ARCH).atree | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3959 |  | 
| David 'Digit' Turner | 77ec16a | 2011-06-23 12:49:02 +0200 | [diff] [blame] | 3960 | # development/build/sdk-android-<abi>.atree is used to differentiate | 
|  | 3961 | # between architecture models (e.g. ARMv5TE versus ARMv7) when copying | 
|  | 3962 | # files like the kernel image. We use TARGET_CPU_ABI because we don't | 
|  | 3963 | # have a better way to distinguish between CPU models. | 
|  | 3964 | ifneq (,$(strip $(wildcard $(atree_dir)/sdk-android-$(TARGET_CPU_ABI).atree))) | 
|  | 3965 | sdk_atree_files += $(atree_dir)/sdk-android-$(TARGET_CPU_ABI).atree | 
|  | 3966 | endif | 
|  | 3967 |  | 
| Griff Hazen | 433febb | 2014-02-28 08:45:59 -0800 | [diff] [blame] | 3968 | ifneq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SDK_ATREE_FILES),) | 
|  | 3969 | sdk_atree_files += $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SDK_ATREE_FILES) | 
|  | 3970 | else | 
|  | 3971 | sdk_atree_files += $(atree_dir)/sdk.atree | 
|  | 3972 | endif | 
|  | 3973 |  | 
| Deepanshu Gupta | 7a864ea | 2014-08-11 15:20:02 -0700 | [diff] [blame] | 3974 | include $(BUILD_SYSTEM)/sdk_font.mk | 
| Deepanshu Gupta | 4e5e582 | 2014-08-01 10:14:15 -0700 | [diff] [blame] | 3975 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3976 | deps := \ | 
|  | 3977 | $(target_notice_file_txt) \ | 
|  | 3978 | $(tools_notice_file_txt) \ | 
|  | 3979 | $(OUT_DOCS)/offline-sdk-timestamp \ | 
| Ying Wang | 139e332 | 2010-03-31 17:29:04 -0700 | [diff] [blame] | 3980 | $(SYMBOLS_ZIP) \ | 
| Ryan Campbell | 81c9d29 | 2016-09-12 13:56:50 -0700 | [diff] [blame] | 3981 | $(COVERAGE_ZIP) \ | 
| Dario Freni | d101127 | 2018-07-23 20:20:15 +0100 | [diff] [blame] | 3982 | $(APPCOMPAT_ZIP) \ | 
| Tao Bao | e9d61b0 | 2018-08-20 21:09:07 -0700 | [diff] [blame] | 3983 | $(INSTALLED_SYSTEMIMAGE_TARGET) \ | 
| Bo Hu | f0d50bb | 2017-08-01 19:02:09 +0000 | [diff] [blame] | 3984 | $(INSTALLED_QEMU_SYSTEMIMAGE) \ | 
| bohu | 18d1868 | 2017-08-14 14:52:20 -0700 | [diff] [blame] | 3985 | $(INSTALLED_QEMU_VENDORIMAGE) \ | 
| Doug Zongker | dddd957 | 2009-06-15 21:25:32 -0700 | [diff] [blame] | 3986 | $(INSTALLED_USERDATAIMAGE_TARGET) \ | 
|  | 3987 | $(INSTALLED_RAMDISK_TARGET) \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3988 | $(INSTALLED_SDK_BUILD_PROP_TARGET) \ | 
| Ying Wang | 139e332 | 2010-03-31 17:29:04 -0700 | [diff] [blame] | 3989 | $(INSTALLED_BUILD_PROP_TARGET) \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3990 | $(ATREE_FILES) \ | 
| Ying Wang | 0c0a4ce | 2014-02-18 14:29:59 -0800 | [diff] [blame] | 3991 | $(sdk_atree_files) \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3992 | $(HOST_OUT_EXECUTABLES)/atree \ | 
| Deepanshu Gupta | 4e5e582 | 2014-08-01 10:14:15 -0700 | [diff] [blame] | 3993 | $(HOST_OUT_EXECUTABLES)/line_endings \ | 
| Deepanshu Gupta | 7a864ea | 2014-08-11 15:20:02 -0700 | [diff] [blame] | 3994 | $(SDK_FONT_DEPS) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 3995 |  | 
|  | 3996 | INTERNAL_SDK_TARGET := $(sdk_dir)/$(sdk_name).zip | 
|  | 3997 | $(INTERNAL_SDK_TARGET): PRIVATE_NAME := $(sdk_name) | 
|  | 3998 | $(INTERNAL_SDK_TARGET): PRIVATE_DIR := $(sdk_dir)/$(sdk_name) | 
|  | 3999 | $(INTERNAL_SDK_TARGET): PRIVATE_DEP_FILE := $(sdk_dep_file) | 
|  | 4000 | $(INTERNAL_SDK_TARGET): PRIVATE_INPUT_FILES := $(sdk_atree_files) | 
|  | 4001 |  | 
|  | 4002 | # Set SDK_GNU_ERROR to non-empty to fail when a GNU target is built. | 
|  | 4003 | # | 
|  | 4004 | #SDK_GNU_ERROR := true | 
|  | 4005 |  | 
| Ying Wang | 5d88770 | 2015-11-04 10:06:25 -0800 | [diff] [blame] | 4006 | $(INTERNAL_SDK_TARGET): $(deps) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4007 | @echo "Package SDK: $@" | 
|  | 4008 | $(hide) rm -rf $(PRIVATE_DIR) $@ | 
|  | 4009 | $(hide) for f in $(target_gnu_MODULES); do \ | 
|  | 4010 | if [ -f $$f ]; then \ | 
|  | 4011 | echo SDK: $(if $(SDK_GNU_ERROR),ERROR:,warning:) \ | 
|  | 4012 | including GNU target $$f >&2; \ | 
|  | 4013 | FAIL=$(SDK_GNU_ERROR); \ | 
|  | 4014 | fi; \ | 
|  | 4015 | done; \ | 
|  | 4016 | if [ $$FAIL ]; then exit 1; fi | 
| Deepanshu Gupta | 88a307e | 2014-08-12 10:23:58 -0700 | [diff] [blame] | 4017 | $(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] | 4018 | $(hide) ( \ | 
| Dan Willemsen | 6f57b28 | 2018-06-01 10:53:55 -0700 | [diff] [blame] | 4019 | ATREE_STRIP="$(HOST_STRIP) -x" \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4020 | $(HOST_OUT_EXECUTABLES)/atree \ | 
|  | 4021 | $(addprefix -f ,$(PRIVATE_INPUT_FILES)) \ | 
|  | 4022 | -m $(PRIVATE_DEP_FILE) \ | 
|  | 4023 | -I . \ | 
|  | 4024 | -I $(PRODUCT_OUT) \ | 
|  | 4025 | -I $(HOST_OUT) \ | 
|  | 4026 | -I $(TARGET_COMMON_OUT_ROOT) \ | 
|  | 4027 | -v "PLATFORM_NAME=android-$(PLATFORM_VERSION)" \ | 
| Raphael Moll | 7558ad5 | 2011-01-05 14:58:17 -0800 | [diff] [blame] | 4028 | -v "OUT_DIR=$(OUT_DIR)" \ | 
| Raphael | 2a53317 | 2011-11-15 16:29:16 -0800 | [diff] [blame] | 4029 | -v "HOST_OUT=$(HOST_OUT)" \ | 
| Bruce Beare | 18a130e | 2011-02-18 15:06:20 -0800 | [diff] [blame] | 4030 | -v "TARGET_ARCH=$(TARGET_ARCH)" \ | 
|  | 4031 | -v "TARGET_CPU_ABI=$(TARGET_CPU_ABI)" \ | 
| David 'Digit' Turner | 557c51f | 2011-08-25 14:28:03 +0200 | [diff] [blame] | 4032 | -v "DLL_EXTENSION=$(HOST_SHLIB_SUFFIX)" \ | 
| Deepanshu Gupta | 7a864ea | 2014-08-11 15:20:02 -0700 | [diff] [blame] | 4033 | -v "FONT_OUT=$(SDK_FONT_TEMP)" \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4034 | -o $(PRIVATE_DIR) && \ | 
|  | 4035 | cp -f $(target_notice_file_txt) \ | 
| Xavier Ducrohet | 6de7bc6 | 2011-09-21 10:22:19 -0700 | [diff] [blame] | 4036 | $(PRIVATE_DIR)/system-images/android-$(PLATFORM_VERSION)/$(TARGET_CPU_ABI)/NOTICE.txt && \ | 
| Xavier Ducrohet | 4216a8c | 2011-03-15 13:28:40 -0700 | [diff] [blame] | 4037 | cp -f $(tools_notice_file_txt) $(PRIVATE_DIR)/platform-tools/NOTICE.txt && \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4038 | HOST_OUT_EXECUTABLES=$(HOST_OUT_EXECUTABLES) HOST_OS=$(HOST_OS) \ | 
| Raphael | 7a6a9c3 | 2011-02-01 13:30:00 -0800 | [diff] [blame] | 4039 | development/build/tools/sdk_clean.sh $(PRIVATE_DIR) && \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4040 | chmod -R ug+rwX $(PRIVATE_DIR) && \ | 
| Dan Willemsen | 48a621c | 2015-10-29 16:33:05 -0700 | [diff] [blame] | 4041 | cd $(dir $@) && zip -rqX $(notdir $@) $(PRIVATE_NAME) \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4042 | ) || ( rm -rf $(PRIVATE_DIR) $@ && exit 44 ) | 
|  | 4043 |  | 
| Raphael | 3d224a0 | 2010-04-16 17:50:09 -0700 | [diff] [blame] | 4044 |  | 
|  | 4045 | # Is a Windows SDK requested? If so, we need some definitions from here | 
|  | 4046 | # in order to find the Linux SDK used to create the Windows one. | 
| Raphael | c4d4731 | 2011-02-15 16:09:36 -0800 | [diff] [blame] | 4047 | MAIN_SDK_NAME := $(sdk_name) | 
|  | 4048 | MAIN_SDK_DIR  := $(sdk_dir) | 
|  | 4049 | MAIN_SDK_ZIP  := $(INTERNAL_SDK_TARGET) | 
| Ying Wang | ff1fe68 | 2015-01-27 12:47:10 -0800 | [diff] [blame] | 4050 | ifneq ($(filter win_sdk winsdk-tools,$(MAKECMDGOALS)),) | 
| Raphael | 3d224a0 | 2010-04-16 17:50:09 -0700 | [diff] [blame] | 4051 | include $(TOPDIR)development/build/tools/windows_sdk.mk | 
|  | 4052 | endif | 
|  | 4053 |  | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4054 | # ----------------------------------------------------------------- | 
|  | 4055 | # Findbugs | 
|  | 4056 | INTERNAL_FINDBUGS_XML_TARGET := $(PRODUCT_OUT)/findbugs.xml | 
|  | 4057 | INTERNAL_FINDBUGS_HTML_TARGET := $(PRODUCT_OUT)/findbugs.html | 
|  | 4058 | $(INTERNAL_FINDBUGS_XML_TARGET): $(ALL_FINDBUGS_FILES) | 
|  | 4059 | @echo UnionBugs: $@ | 
| Yuncheol Heo | 623d706 | 2014-05-20 17:04:16 +0900 | [diff] [blame] | 4060 | $(hide) $(FINDBUGS_DIR)/unionBugs $(ALL_FINDBUGS_FILES) \ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4061 | > $@ | 
|  | 4062 | $(INTERNAL_FINDBUGS_HTML_TARGET): $(INTERNAL_FINDBUGS_XML_TARGET) | 
|  | 4063 | @echo ConvertXmlToText: $@ | 
| Yuncheol Heo | 623d706 | 2014-05-20 17:04:16 +0900 | [diff] [blame] | 4064 | $(hide) $(FINDBUGS_DIR)/convertXmlToText -html:fancy.xsl \ | 
| Ying Wang | ad7fd29 | 2013-08-08 16:34:29 -0700 | [diff] [blame] | 4065 | $(INTERNAL_FINDBUGS_XML_TARGET) > $@ | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4066 |  | 
|  | 4067 | # ----------------------------------------------------------------- | 
|  | 4068 | # Findbugs | 
|  | 4069 |  | 
|  | 4070 | # ----------------------------------------------------------------- | 
|  | 4071 | # These are some additional build tasks that need to be run. | 
| Ying Wang | ad7fd29 | 2013-08-08 16:34:29 -0700 | [diff] [blame] | 4072 | ifneq ($(dont_bother),true) | 
| The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 4073 | include $(sort $(wildcard $(BUILD_SYSTEM)/tasks/*.mk)) | 
| Claes Elgemark | e22ad67 | 2010-11-12 15:46:00 +0100 | [diff] [blame] | 4074 | -include $(sort $(wildcard vendor/*/build/tasks/*.mk)) | 
| Andrew Boie | f34a9ba | 2012-04-16 10:03:16 -0700 | [diff] [blame] | 4075 | -include $(sort $(wildcard device/*/build/tasks/*.mk)) | 
| Lee Campbell | 04ba312 | 2015-08-20 15:39:56 -0700 | [diff] [blame] | 4076 | -include $(sort $(wildcard product/*/build/tasks/*.mk)) | 
| Ying Wang | 66c78e4 | 2014-09-05 17:47:34 -0700 | [diff] [blame] | 4077 | # Also the project-specific tasks | 
|  | 4078 | -include $(sort $(wildcard vendor/*/*/build/tasks/*.mk)) | 
|  | 4079 | -include $(sort $(wildcard device/*/*/build/tasks/*.mk)) | 
| Lee Campbell | 04ba312 | 2015-08-20 15:39:56 -0700 | [diff] [blame] | 4080 | -include $(sort $(wildcard product/*/*/build/tasks/*.mk)) | 
| Guang Zhu | 8322be7 | 2016-06-20 22:03:24 -0700 | [diff] [blame] | 4081 | # Also add test specifc tasks | 
|  | 4082 | include $(sort $(wildcard platform_testing/build/tasks/*.mk)) | 
| Keun Soo Yim | 199a710 | 2016-08-31 09:20:51 -0700 | [diff] [blame] | 4083 | include $(sort $(wildcard test/vts/tools/build/tasks/*.mk)) | 
| Ying Wang | ad7fd29 | 2013-08-08 16:34:29 -0700 | [diff] [blame] | 4084 | endif | 
| Raphael | c4d4731 | 2011-02-15 16:09:36 -0800 | [diff] [blame] | 4085 |  | 
| Ying Wang | 67132ba | 2015-10-28 16:42:39 -0700 | [diff] [blame] | 4086 | include $(BUILD_SYSTEM)/product-graph.mk | 
|  | 4087 |  | 
| Raphael | c4d4731 | 2011-02-15 16:09:36 -0800 | [diff] [blame] | 4088 | # ----------------------------------------------------------------- | 
|  | 4089 | # Create SDK repository packages. Must be done after tasks/* since | 
|  | 4090 | # we need the addon rules defined. | 
|  | 4091 | ifneq ($(sdk_repo_goal),) | 
|  | 4092 | include $(TOPDIR)development/build/tools/sdk_repo.mk | 
|  | 4093 | endif | 
| Jayant Chowdhary | 67e0cc5 | 2018-02-23 16:50:39 -0800 | [diff] [blame] | 4094 |  | 
|  | 4095 | #------------------------------------------------------------------ | 
|  | 4096 | # Find lsdump paths | 
|  | 4097 | FIND_LSDUMPS_FILE := $(PRODUCT_OUT)/lsdump_paths.txt | 
|  | 4098 | $(FIND_LSDUMPS_FILE) : $(LSDUMP_PATHS) | 
| Yi-yo Chiang | ac0d49f | 2018-07-25 13:34:28 +0800 | [diff] [blame] | 4099 | $(hide) rm -rf $@ && echo "$^" | sed -e 's/ /\n/g' > $@ |