Depend on PRODUCT_COPY_FILES that are not in images

If0e4b958b3dfaa02771a5da70f970379635f904e made `droidcore` stop
depending on `files` so that installed files from unbuilt images
would not be built.  That also disabled the dependency on installed
files that were not in any image, but the vendor notice file had
overly broad dependencies that caused them to still be built.
Icdb11d3c72b180cd02231e8dc98ae500d6566a98 made the vendor notice
file dependencies less broad, exposing the missing `droidcore`
dependencies.

Track the list of installed device files that are not included in any
image, built or unbuilt, and add them as a dependency for `droidcore`.

Bug: 225187583
Test: m checkbuild
Test: check dependency path to encryptionkey.img
Change-Id: I084158ffb52b353e9a3eca9ad06a68c80d3bd371
This commit is contained in:
Colin Cross 2022-03-21 15:06:11 -07:00
parent c6d6306771
commit 79a76ec581
2 changed files with 26 additions and 0 deletions

View file

@ -746,6 +746,12 @@ event-log-tags: $(event_log_tags_file)
ALL_DEFAULT_INSTALLED_MODULES += $(event_log_tags_file) ALL_DEFAULT_INSTALLED_MODULES += $(event_log_tags_file)
# Initialize INSTALLED_FILES_OUTSIDE_IMAGES with the list of all device files,
# files installed in images will be filtered out later.
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out \
$(PRODUCT_OUT)/apex/% \
$(PRODUCT_OUT)/testcases/%, \
$(filter $(PRODUCT_OUT)/%,$(ALL_DEFAULT_INSTALLED_MODULES)))
# ################################################################# # #################################################################
# Targets for boot/OS images # Targets for boot/OS images
@ -778,9 +784,11 @@ endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# the root dir # the root dir
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_ROOT_OUT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
INTERNAL_ROOT_FILES := $(filter $(TARGET_ROOT_OUT)/%, \ INTERNAL_ROOT_FILES := $(filter $(TARGET_ROOT_OUT)/%, \
$(ALL_DEFAULT_INSTALLED_MODULES)) $(ALL_DEFAULT_INSTALLED_MODULES))
INSTALLED_FILES_FILE_ROOT := $(PRODUCT_OUT)/installed-files-root.txt INSTALLED_FILES_FILE_ROOT := $(PRODUCT_OUT)/installed-files-root.txt
INSTALLED_FILES_JSON_ROOT := $(INSTALLED_FILES_FILE_ROOT:.txt=.json) INSTALLED_FILES_JSON_ROOT := $(INSTALLED_FILES_FILE_ROOT:.txt=.json)
$(INSTALLED_FILES_FILE_ROOT): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_ROOT) $(INSTALLED_FILES_FILE_ROOT): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_ROOT)
@ -810,6 +818,7 @@ endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# the ramdisk # the ramdisk
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_RAMDISK_OUT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
ifdef BUILDING_RAMDISK_IMAGE ifdef BUILDING_RAMDISK_IMAGE
INTERNAL_RAMDISK_FILES := $(filter $(TARGET_RAMDISK_OUT)/%, \ INTERNAL_RAMDISK_FILES := $(filter $(TARGET_RAMDISK_OUT)/%, \
$(ALL_DEFAULT_INSTALLED_MODULES)) $(ALL_DEFAULT_INSTALLED_MODULES))
@ -1238,6 +1247,7 @@ endif # BUILDING_INIT_BOOT_IMAGE is not true
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# vendor boot image # vendor boot image
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_VENDOR_RAMDISK_OUT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
ifeq ($(BUILDING_VENDOR_BOOT_IMAGE),true) ifeq ($(BUILDING_VENDOR_BOOT_IMAGE),true)
ifeq ($(PRODUCT_SUPPORTS_VERITY),true) ifeq ($(PRODUCT_SUPPORTS_VERITY),true)
@ -1974,6 +1984,7 @@ endef
# Recovery image # Recovery image
# Recovery image exists if we are building recovery, or building recovery as boot. # Recovery image exists if we are building recovery, or building recovery as boot.
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_RECOVERY_OUT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
ifdef BUILDING_RECOVERY_IMAGE ifdef BUILDING_RECOVERY_IMAGE
INTERNAL_RECOVERYIMAGE_FILES := $(filter $(TARGET_RECOVERY_OUT)/%, \ INTERNAL_RECOVERYIMAGE_FILES := $(filter $(TARGET_RECOVERY_OUT)/%, \
@ -2445,6 +2456,7 @@ endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# Build debug ramdisk and debug boot image. # Build debug ramdisk and debug boot image.
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_DEBUG_RAMDISK_OUT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
ifneq ($(BUILDING_DEBUG_BOOT_IMAGE)$(BUILDING_DEBUG_VENDOR_BOOT_IMAGE),) ifneq ($(BUILDING_DEBUG_BOOT_IMAGE)$(BUILDING_DEBUG_VENDOR_BOOT_IMAGE),)
INTERNAL_DEBUG_RAMDISK_FILES := $(filter $(TARGET_DEBUG_RAMDISK_OUT)/%, \ INTERNAL_DEBUG_RAMDISK_FILES := $(filter $(TARGET_DEBUG_RAMDISK_OUT)/%, \
@ -2582,6 +2594,7 @@ endif # BUILDING_DEBUG_BOOT_IMAGE
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# vendor debug ramdisk # vendor debug ramdisk
# Combines vendor ramdisk files and debug ramdisk files to build the vendor debug ramdisk. # Combines vendor ramdisk files and debug ramdisk files to build the vendor debug ramdisk.
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_VENDOR_DEBUG_RAMDISK_OUT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
ifdef BUILDING_DEBUG_VENDOR_BOOT_IMAGE ifdef BUILDING_DEBUG_VENDOR_BOOT_IMAGE
INTERNAL_VENDOR_DEBUG_RAMDISK_FILES := $(filter $(TARGET_VENDOR_DEBUG_RAMDISK_OUT)/%, \ INTERNAL_VENDOR_DEBUG_RAMDISK_FILES := $(filter $(TARGET_VENDOR_DEBUG_RAMDISK_OUT)/%, \
@ -2693,6 +2706,7 @@ endif
$(call declare-1p-target,$(INTERNAL_TEST_HARNESS_RAMDISK_ADB_DEBUG_PROP_TARGET)) $(call declare-1p-target,$(INTERNAL_TEST_HARNESS_RAMDISK_ADB_DEBUG_PROP_TARGET))
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_TEST_HARNESS_RAMDISK_OUT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
INTERNAL_TEST_HARNESS_RAMDISK_FILES := $(filter $(TARGET_TEST_HARNESS_RAMDISK_OUT)/%, \ INTERNAL_TEST_HARNESS_RAMDISK_FILES := $(filter $(TARGET_TEST_HARNESS_RAMDISK_OUT)/%, \
$(INTERNAL_TEST_HARNESS_RAMDISK_ADB_DEBUG_PROP_TARGET) \ $(INTERNAL_TEST_HARNESS_RAMDISK_ADB_DEBUG_PROP_TARGET) \
$(ALL_DEFAULT_INSTALLED_MODULES)) $(ALL_DEFAULT_INSTALLED_MODULES))
@ -2915,6 +2929,7 @@ ALL_DEFAULT_INSTALLED_MODULES += $(FSVERITY_APK_OUT)
endif # PRODUCT_SYSTEM_FSVERITY_GENERATE_METADATA endif # PRODUCT_SYSTEM_FSVERITY_GENERATE_METADATA
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_OUT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
INTERNAL_SYSTEMIMAGE_FILES := $(sort $(filter $(TARGET_OUT)/%, \ INTERNAL_SYSTEMIMAGE_FILES := $(sort $(filter $(TARGET_OUT)/%, \
$(ALL_DEFAULT_INSTALLED_MODULES))) $(ALL_DEFAULT_INSTALLED_MODULES)))
@ -3101,6 +3116,7 @@ platform-java:
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# data partition image # data partition image
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_OUT_DATA)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
INTERNAL_USERDATAIMAGE_FILES := \ INTERNAL_USERDATAIMAGE_FILES := \
$(filter $(TARGET_OUT_DATA)/%,$(ALL_DEFAULT_INSTALLED_MODULES)) $(filter $(TARGET_OUT_DATA)/%,$(ALL_DEFAULT_INSTALLED_MODULES))
@ -3194,6 +3210,7 @@ endif # BOARD_BPT_INPUT_FILES
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# cache partition image # cache partition image
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_OUT_CACHE)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
ifdef BUILDING_CACHE_IMAGE ifdef BUILDING_CACHE_IMAGE
INTERNAL_CACHEIMAGE_FILES := \ INTERNAL_CACHEIMAGE_FILES := \
$(filter $(TARGET_OUT_CACHE)/%,$(ALL_DEFAULT_INSTALLED_MODULES)) $(filter $(TARGET_OUT_CACHE)/%,$(ALL_DEFAULT_INSTALLED_MODULES))
@ -3235,6 +3252,7 @@ endif # BUILDING_CACHE_IMAGE
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# system_other partition image # system_other partition image
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_OUT_SYSTEM_OTHER)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
ifdef BUILDING_SYSTEM_OTHER_IMAGE ifdef BUILDING_SYSTEM_OTHER_IMAGE
ifeq ($(BOARD_USES_SYSTEM_OTHER_ODEX),true) ifeq ($(BOARD_USES_SYSTEM_OTHER_ODEX),true)
# Marker file to identify that odex files are installed # Marker file to identify that odex files are installed
@ -3315,6 +3333,7 @@ endif # BUILDING_SYSTEM_OTHER_IMAGE
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# vendor partition image # vendor partition image
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_OUT_VENDOR)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
ifdef BUILDING_VENDOR_IMAGE ifdef BUILDING_VENDOR_IMAGE
INTERNAL_VENDORIMAGE_FILES := \ INTERNAL_VENDORIMAGE_FILES := \
$(filter $(TARGET_OUT_VENDOR)/%,\ $(filter $(TARGET_OUT_VENDOR)/%,\
@ -3398,6 +3417,7 @@ endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# product partition image # product partition image
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_OUT_PRODUCT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
ifdef BUILDING_PRODUCT_IMAGE ifdef BUILDING_PRODUCT_IMAGE
INTERNAL_PRODUCTIMAGE_FILES := \ INTERNAL_PRODUCTIMAGE_FILES := \
$(filter $(TARGET_OUT_PRODUCT)/%,\ $(filter $(TARGET_OUT_PRODUCT)/%,\
@ -3456,6 +3476,7 @@ endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# system_ext partition image # system_ext partition image
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_OUT_SYSTEM_EXT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
ifdef BUILDING_SYSTEM_EXT_IMAGE ifdef BUILDING_SYSTEM_EXT_IMAGE
INTERNAL_SYSTEM_EXTIMAGE_FILES := \ INTERNAL_SYSTEM_EXTIMAGE_FILES := \
$(filter $(TARGET_OUT_SYSTEM_EXT)/%,\ $(filter $(TARGET_OUT_SYSTEM_EXT)/%,\
@ -3516,6 +3537,7 @@ endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# odm partition image # odm partition image
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_OUT_ODM)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
ifdef BUILDING_ODM_IMAGE ifdef BUILDING_ODM_IMAGE
INTERNAL_ODMIMAGE_FILES := \ INTERNAL_ODMIMAGE_FILES := \
$(filter $(TARGET_OUT_ODM)/%,\ $(filter $(TARGET_OUT_ODM)/%,\
@ -3593,6 +3615,7 @@ endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# vendor_dlkm partition image # vendor_dlkm partition image
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_OUT_VENDOR_DLKM)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
ifdef BUILDING_VENDOR_DLKM_IMAGE ifdef BUILDING_VENDOR_DLKM_IMAGE
INTERNAL_VENDOR_DLKMIMAGE_FILES := \ INTERNAL_VENDOR_DLKMIMAGE_FILES := \
$(filter $(TARGET_OUT_VENDOR_DLKM)/%,\ $(filter $(TARGET_OUT_VENDOR_DLKM)/%,\
@ -3652,6 +3675,7 @@ endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# odm_dlkm partition image # odm_dlkm partition image
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_OUT_ODM_DLKM)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
ifdef BUILDING_ODM_DLKM_IMAGE ifdef BUILDING_ODM_DLKM_IMAGE
INTERNAL_ODM_DLKMIMAGE_FILES := \ INTERNAL_ODM_DLKMIMAGE_FILES := \
$(filter $(TARGET_OUT_ODM_DLKM)/%,\ $(filter $(TARGET_OUT_ODM_DLKM)/%,\
@ -3712,6 +3736,7 @@ endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# system_dlkm partition image # system_dlkm partition image
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_OUT_SYSTEM_DLKM)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
ifdef BUILDING_SYSTEM_DLKM_IMAGE ifdef BUILDING_SYSTEM_DLKM_IMAGE
INTERNAL_SYSTEM_DLKMIMAGE_FILES := \ INTERNAL_SYSTEM_DLKMIMAGE_FILES := \

View file

@ -1628,6 +1628,7 @@ vbmetavendorimage: $(INSTALLED_VBMETA_VENDORIMAGE_TARGET)
# perform a full system build (either unbundled or not). # perform a full system build (either unbundled or not).
.PHONY: droidcore-unbundled .PHONY: droidcore-unbundled
droidcore-unbundled: $(filter $(HOST_OUT_ROOT)/%,$(modules_to_install)) \ droidcore-unbundled: $(filter $(HOST_OUT_ROOT)/%,$(modules_to_install)) \
$(INSTALLED_FILES_OUTSIDE_IMAGES) \
$(INSTALLED_SYSTEMIMAGE_TARGET) \ $(INSTALLED_SYSTEMIMAGE_TARGET) \
$(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_RAMDISK_TARGET) \
$(INSTALLED_BOOTIMAGE_TARGET) \ $(INSTALLED_BOOTIMAGE_TARGET) \