Merge "Make the target_files zip reflect the recent partition change" into main am: ad30396b0e

Original change: https://android-review.googlesource.com/c/platform/build/+/2755427

Change-Id: Ia774c1bc53a257ebec365341a7b79e36c22cec9e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-09-20 20:18:29 +00:00 committed by Automerger Merge Worker
commit 39b4166c95

View file

@ -5949,6 +5949,20 @@ define package_files-copy-root
fi fi
endef endef
# This is the same as the non-hermetic version, but also accepts a list of files in the directory
# to copy. It will only copy those files. This is so that we don't copy extra files that could've
# been built in the staging directories by prior builds.
# $(1): Directory to copy
# $(2): Location to copy it to
# $(3): A list of files in the $(1) directory, only these files will be copied
define package_files-copy-root-hermetic
$(if $(BUILD_BROKEN_INCORRECT_PARTITION_IMAGES),
$(call package_files-copy-root,$(1),$(2)),
$(foreach f,$(filter $(strip $(1))/%,$(3)), \
mkdir -p $(strip $(2))/$(dir $(patsubst $(strip $(1))/%,%,$(f)))$(newline) \
$(ACP) -d $(f) $(strip $(2))/$(patsubst $(strip $(1))/%,%,$(f))$(newline)))
endef
built_ota_tools := built_ota_tools :=
# We can't build static executables when SANITIZE_TARGET=address # We can't build static executables when SANITIZE_TARGET=address
@ -6298,7 +6312,7 @@ $(BUILT_TARGET_FILES_DIR): \
$(BUILT_KERNEL_VERSION_FILE) \ $(BUILT_KERNEL_VERSION_FILE) \
| $(ACP) | $(ACP)
@echo "Building target files: $@" @echo "Building target files: $@"
$(hide) rm -rf $@ $@.list $(zip_root) $(hide) rm -rf $@ $(zip_root)
$(hide) mkdir -p $(dir $@) $(zip_root) $(hide) mkdir -p $(dir $@) $(zip_root)
ifneq (,$(INSTALLED_RECOVERYIMAGE_TARGET)$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT))$(filter true,$(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT))) ifneq (,$(INSTALLED_RECOVERYIMAGE_TARGET)$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT))$(filter true,$(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT)))
@# Components of the recovery image @# Components of the recovery image
@ -6425,8 +6439,8 @@ endif
endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET
ifdef BUILDING_SYSTEM_IMAGE ifdef BUILDING_SYSTEM_IMAGE
@# Contents of the system image @# Contents of the system image
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root-hermetic, \
$(SYSTEMIMAGE_SOURCE_DIR),$(zip_root)/SYSTEM) $(SYSTEMIMAGE_SOURCE_DIR),$(zip_root)/SYSTEM,$(FULL_SYSTEMIMAGE_DEPS))
else ifdef INSTALLED_BUILD_PROP_TARGET else ifdef INSTALLED_BUILD_PROP_TARGET
@# Copy the system build.prop even if not building a system image @# Copy the system build.prop even if not building a system image
@# because add_img_to_target_files may need it to build other partition @# because add_img_to_target_files may need it to build other partition
@ -6436,48 +6450,48 @@ else ifdef INSTALLED_BUILD_PROP_TARGET
endif endif
ifdef BUILDING_USERDATA_IMAGE ifdef BUILDING_USERDATA_IMAGE
@# Contents of the data image @# Contents of the data image
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root-hermetic, \
$(TARGET_OUT_DATA),$(zip_root)/DATA) $(TARGET_OUT_DATA),$(zip_root)/DATA,$(INSTALLED_USERDATAIMAGE_TARGET_DEPS))
endif endif
ifdef BUILDING_VENDOR_IMAGE ifdef BUILDING_VENDOR_IMAGE
@# Contents of the vendor image @# Contents of the vendor image
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root-hermetic, \
$(TARGET_OUT_VENDOR),$(zip_root)/VENDOR) $(TARGET_OUT_VENDOR),$(zip_root)/VENDOR,$(INTERNAL_VENDORIMAGE_FILES))
endif endif
ifdef BUILDING_PRODUCT_IMAGE ifdef BUILDING_PRODUCT_IMAGE
@# Contents of the product image @# Contents of the product image
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root-hermetic, \
$(TARGET_OUT_PRODUCT),$(zip_root)/PRODUCT) $(TARGET_OUT_PRODUCT),$(zip_root)/PRODUCT,$(INTERNAL_PRODUCTIMAGE_FILES))
endif endif
ifdef BUILDING_SYSTEM_EXT_IMAGE ifdef BUILDING_SYSTEM_EXT_IMAGE
@# Contents of the system_ext image @# Contents of the system_ext image
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root-hermetic, \
$(TARGET_OUT_SYSTEM_EXT),$(zip_root)/SYSTEM_EXT) $(TARGET_OUT_SYSTEM_EXT),$(zip_root)/SYSTEM_EXT,$(INTERNAL_SYSTEM_EXTIMAGE_FILES))
endif endif
ifdef BUILDING_ODM_IMAGE ifdef BUILDING_ODM_IMAGE
@# Contents of the odm image @# Contents of the odm image
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root-hermetic, \
$(TARGET_OUT_ODM),$(zip_root)/ODM) $(TARGET_OUT_ODM),$(zip_root)/ODM,$(INTERNAL_ODMIMAGE_FILES))
endif endif
ifdef BUILDING_VENDOR_DLKM_IMAGE ifdef BUILDING_VENDOR_DLKM_IMAGE
@# Contents of the vendor_dlkm image @# Contents of the vendor_dlkm image
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root-hermetic, \
$(TARGET_OUT_VENDOR_DLKM),$(zip_root)/VENDOR_DLKM) $(TARGET_OUT_VENDOR_DLKM),$(zip_root)/VENDOR_DLKM,$(INTERNAL_VENDOR_DLKMIMAGE_FILES))
endif endif
ifdef BUILDING_ODM_DLKM_IMAGE ifdef BUILDING_ODM_DLKM_IMAGE
@# Contents of the odm_dlkm image @# Contents of the odm_dlkm image
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root-hermetic, \
$(TARGET_OUT_ODM_DLKM),$(zip_root)/ODM_DLKM) $(TARGET_OUT_ODM_DLKM),$(zip_root)/ODM_DLKM,$(INTERNAL_ODM_DLKMIMAGE_FILES))
endif endif
ifdef BUILDING_SYSTEM_DLKM_IMAGE ifdef BUILDING_SYSTEM_DLKM_IMAGE
@# Contents of the system_dlkm image @# Contents of the system_dlkm image
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root-hermetic, \
$(TARGET_OUT_SYSTEM_DLKM),$(zip_root)/SYSTEM_DLKM) $(TARGET_OUT_SYSTEM_DLKM),$(zip_root)/SYSTEM_DLKM,$(INTERNAL_SYSTEM_DLKMIMAGE_FILES))
endif endif
ifdef BUILDING_SYSTEM_OTHER_IMAGE ifdef BUILDING_SYSTEM_OTHER_IMAGE
@# Contents of the system_other image @# Contents of the system_other image
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root-hermetic, \
$(TARGET_OUT_SYSTEM_OTHER),$(zip_root)/SYSTEM_OTHER) $(TARGET_OUT_SYSTEM_OTHER),$(zip_root)/SYSTEM_OTHER,$(INTERNAL_SYSTEMOTHERIMAGE_FILES))
endif endif
@# Extra contents of the OTA package @# Extra contents of the OTA package
$(hide) mkdir -p $(zip_root)/OTA $(hide) mkdir -p $(zip_root)/OTA
@ -6566,7 +6580,8 @@ endif
endif endif
ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true) ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true)
@# If breakpad symbols have been generated, add them to the zip. @# If breakpad symbols have been generated, add them to the zip.
$(hide) cp -R $(TARGET_OUT_BREAKPAD) $(zip_root)/BREAKPAD $(call package_files-copy-root, \
$(TARGET_OUT_BREAKPAD),$(zip_root)/BREAKPAD)
endif endif
ifdef BOARD_PREBUILT_VENDORIMAGE ifdef BOARD_PREBUILT_VENDORIMAGE
$(hide) mkdir -p $(zip_root)/IMAGES $(hide) mkdir -p $(zip_root)/IMAGES