From dba635a3b7ef0f0d703b50b9d5679b9b0a8c1462 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Mon, 24 Jun 2019 10:39:54 -0700 Subject: [PATCH] Clean up the dependencies for user image creation. The dependency on MAKE_EXT4FS (mke2fs) has been covered by the rule for MKEXTUSERIMG (mkuserimg_mke2fs): https://android.googlesource.com/platform/system/extras/+/refs/heads/master/ext4_utils/Android.bp The dependency on mksquashfs and img2simg comes from mksquashfsimage.sh, which has been moved into mksquashfsimage's building rule. This CL also fixes the ordering of INTERNAL_USERIMAGES_BINARY_PATHS, which should come after adding all the binaries to INTERNAL_USERIMAGES_DEPS. Test: TreeHugger Change-Id: I8b30bf87860d9711e88eecca4b76db72f5cd8241 --- core/Makefile | 40 +++++++++++++++++++++------------------- core/config.mk | 4 ---- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/core/Makefile b/core/Makefile index 690c9c176a..7906013cca 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1310,26 +1310,25 @@ DEFAULT_TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS := ext4=max_batch_time=0,commit=1,d ifneq (true,$(TARGET_USERIMAGES_SPARSE_EXT_DISABLED)) INTERNAL_USERIMAGES_SPARSE_EXT_FLAG := -s endif - -INTERNAL_USERIMAGES_DEPS := $(SIMG2IMG) -INTERNAL_USERIMAGES_DEPS += $(MKEXTUSERIMG) $(MAKE_EXT4FS) $(E2FSCK) $(TUNE2FS) -ifeq ($(TARGET_USERIMAGES_USE_F2FS),true) -INTERNAL_USERIMAGES_DEPS += $(MKF2FSUSERIMG) $(MAKE_F2FS) -endif - -ifeq ($(BOARD_AVB_ENABLE),true) -INTERNAL_USERIMAGES_DEPS += $(AVBTOOL) -endif - ifneq (true,$(TARGET_USERIMAGES_SPARSE_SQUASHFS_DISABLED)) INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG := -s endif -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),) -INTERNAL_USERIMAGES_DEPS += $(MAKE_SQUASHFS) $(MKSQUASHFSUSERIMG) $(IMG2SIMG) + +INTERNAL_USERIMAGES_DEPS := \ + $(BLK_ALLOC_TO_BASE_FS) \ + $(E2FSCK) \ + $(MKE2FS_CONF) \ + $(MKEXTUSERIMG) \ + $(SIMG2IMG) \ + $(TUNE2FS) + +ifeq ($(TARGET_USERIMAGES_USE_F2FS),true) +INTERNAL_USERIMAGES_DEPS += $(MKF2FSUSERIMG) endif -# Get a colon-separated list of search paths. -INTERNAL_USERIMAGES_BINARY_PATHS := $(subst $(space),:,$(sort $(dir $(INTERNAL_USERIMAGES_DEPS)))) +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),) +INTERNAL_USERIMAGES_DEPS += $(MKSQUASHFSUSERIMG) +endif ifeq (true,$(PRODUCT_SUPPORTS_VERITY)) INTERNAL_USERIMAGES_DEPS += $(BUILD_VERITY_METADATA) $(BUILD_VERITY_TREE) $(APPEND2SIMG) $(VERITY_SIGNER) @@ -1338,13 +1337,16 @@ INTERNAL_USERIMAGES_DEPS += $(FEC) endif endif +ifeq ($(BOARD_AVB_ENABLE),true) +INTERNAL_USERIMAGES_DEPS += $(AVBTOOL) +endif + +# Get a colon-separated list of search paths. +INTERNAL_USERIMAGES_BINARY_PATHS := $(subst $(space),:,$(sort $(dir $(INTERNAL_USERIMAGES_DEPS)))) + SELINUX_FC := $(call intermediates-dir-for,ETC,file_contexts.bin)/file_contexts.bin INTERNAL_USERIMAGES_DEPS += $(SELINUX_FC) -INTERNAL_USERIMAGES_DEPS += $(BLK_ALLOC_TO_BASE_FS) - -INTERNAL_USERIMAGES_DEPS += $(MKE2FS_CONF) - ifeq (true,$(PRODUCT_USE_DYNAMIC_PARTITIONS)) ifeq ($(PRODUCT_SUPPORTS_VERITY),true) diff --git a/core/config.mk b/core/config.mk index 92efd34147..4ce664a590 100644 --- a/core/config.mk +++ b/core/config.mk @@ -577,16 +577,12 @@ AVBTOOL := $(BOARD_CUSTOM_AVBTOOL) endif APICHECK := $(HOST_OUT_JAVA_LIBRARIES)/metalava$(COMMON_JAVA_PACKAGE_SUFFIX) FS_GET_STATS := $(HOST_OUT_EXECUTABLES)/fs_get_stats$(HOST_EXECUTABLE_SUFFIX) -MAKE_EXT4FS := $(HOST_OUT_EXECUTABLES)/mke2fs$(HOST_EXECUTABLE_SUFFIX) MKEXTUSERIMG := $(HOST_OUT_EXECUTABLES)/mkuserimg_mke2fs MKE2FS_CONF := system/extras/ext4_utils/mke2fs.conf BLK_ALLOC_TO_BASE_FS := $(HOST_OUT_EXECUTABLES)/blk_alloc_to_base_fs$(HOST_EXECUTABLE_SUFFIX) -MAKE_SQUASHFS := $(HOST_OUT_EXECUTABLES)/mksquashfs$(HOST_EXECUTABLE_SUFFIX) MKSQUASHFSUSERIMG := $(HOST_OUT_EXECUTABLES)/mksquashfsimage.sh -MAKE_F2FS := $(HOST_OUT_EXECUTABLES)/make_f2fs$(HOST_EXECUTABLE_SUFFIX) MKF2FSUSERIMG := $(HOST_OUT_EXECUTABLES)/mkf2fsuserimg.sh SIMG2IMG := $(HOST_OUT_EXECUTABLES)/simg2img$(HOST_EXECUTABLE_SUFFIX) -IMG2SIMG := $(HOST_OUT_EXECUTABLES)/img2simg$(HOST_EXECUTABLE_SUFFIX) E2FSCK := $(HOST_OUT_EXECUTABLES)/e2fsck$(HOST_EXECUTABLE_SUFFIX) MKTARBALL := build/make/tools/mktarball.sh TUNE2FS := $(HOST_OUT_EXECUTABLES)/tune2fs$(HOST_EXECUTABLE_SUFFIX)