From abf1fb00862cec01d457972419fbff4b95cc6300 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Wed, 24 Apr 2019 16:09:07 -0500 Subject: Switch between dependencies and modules Use LOCAL_REQUIRED_MODULES for Pie and up and LOCAL_ADDITIONAL_DEPENDENCIES for Oreo and down. Change-Id: I5365e782f98f3bbf4bf246be22c8f573824b65ee --- Android.mk | 75 +++++++++++++++++++++++++++------------------ crypto/ext4crypt/Android.mk | 6 +++- crypto/scrypt/Scrypt.mk | 12 ++++++-- minui/Android.mk | 6 +++- minuitwrp/Android.mk | 6 +++- toolbox/Android.mk | 6 +++- toybox/Android.mk | 6 +++- 7 files changed, 80 insertions(+), 37 deletions(-) diff --git a/Android.mk b/Android.mk index a25224428..ba2f367da 100755 --- a/Android.mk +++ b/Android.mk @@ -190,7 +190,7 @@ LOCAL_SHARED_LIBRARIES += libselinux ifeq ($(AB_OTA_UPDATER),true) LOCAL_CFLAGS += -DAB_OTA_UPDATER=1 LOCAL_SHARED_LIBRARIES += libhardware android.hardware.boot@1.0 - LOCAL_REQUIRED_MODULES += libhardware + TWRP_REQUIRED_MODULES += libhardware endif LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin @@ -398,7 +398,7 @@ endif ifneq ($(TW_CLOCK_OFFSET),) LOCAL_CFLAGS += -DTW_CLOCK_OFFSET=$(TW_CLOCK_OFFSET) endif -LOCAL_REQUIRED_MODULES += \ +TWRP_REQUIRED_MODULES += \ dump_image \ erase_image \ flash_image \ @@ -433,72 +433,72 @@ ifneq ($(TW_USE_TOOLBOX), true) endif else ifneq ($(wildcard external/toybox/Android.mk),) - LOCAL_REQUIRED_MODULES += toybox_symlinks + TWRP_REQUIRED_MODULES += toybox_symlinks endif ifneq ($(wildcard external/zip/Android.mk),) - LOCAL_REQUIRED_MODULES += zip + TWRP_REQUIRED_MODULES += zip endif ifneq ($(wildcard external/unzip/Android.mk),) - LOCAL_REQUIRED_MODULES += unzip + TWRP_REQUIRED_MODULES += unzip endif endif ifneq ($(TW_NO_EXFAT), true) - LOCAL_REQUIRED_MODULES += mkexfatfs fsckexfat + TWRP_REQUIRED_MODULES += mkexfatfs fsckexfat ifneq ($(TW_NO_EXFAT_FUSE), true) - LOCAL_REQUIRED_MODULES += exfat-fuse + TWRP_REQUIRED_MODULES += exfat-fuse endif endif ifeq ($(BOARD_HAS_NO_REAL_SDCARD),) ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 22; echo $$?),0) - LOCAL_REQUIRED_MODULES += sgdisk + TWRP_REQUIRED_MODULES += sgdisk else - LOCAL_REQUIRED_MODULES += sgdisk_static + TWRP_REQUIRED_MODULES += sgdisk_static endif endif ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true) - LOCAL_REQUIRED_MODULES += openaes openaes_license + TWRP_REQUIRED_MODULES += openaes openaes_license endif ifeq ($(TW_INCLUDE_DUMLOCK), true) - LOCAL_REQUIRED_MODULES += \ + TWRP_REQUIRED_MODULES += \ htcdumlock htcdumlocksys flash_imagesys dump_imagesys libbmlutils.so \ libflashutils.so libmmcutils.so libmtdutils.so HTCDumlock.apk endif ifeq ($(TW_INCLUDE_FB2PNG), true) - LOCAL_REQUIRED_MODULES += fb2png + TWRP_REQUIRED_MODULES += fb2png endif ifneq ($(TW_OEM_BUILD),true) - LOCAL_REQUIRED_MODULES += orscmd + TWRP_REQUIRED_MODULES += orscmd endif ifeq ($(BOARD_USES_BML_OVER_MTD),true) - LOCAL_REQUIRED_MODULES += bml_over_mtd + TWRP_REQUIRED_MODULES += bml_over_mtd endif ifeq ($(TW_INCLUDE_INJECTTWRP), true) - LOCAL_REQUIRED_MODULES += injecttwrp + TWRP_REQUIRED_MODULES += injecttwrp endif ifneq ($(TW_EXCLUDE_DEFAULT_USB_INIT), true) - LOCAL_REQUIRED_MODULES += init.recovery.usb.rc + TWRP_REQUIRED_MODULES += init.recovery.usb.rc endif ifeq ($(TWRP_INCLUDE_LOGCAT), true) - LOCAL_REQUIRED_MODULES += logcat + TWRP_REQUIRED_MODULES += logcat ifeq ($(TARGET_USES_LOGD), true) - LOCAL_REQUIRED_MODULES += logd libsysutils libnl init.recovery.logd.rc + TWRP_REQUIRED_MODULES += logd libsysutils libnl init.recovery.logd.rc endif endif # Allow devices to specify device-specific recovery dependencies ifneq ($(TARGET_RECOVERY_DEVICE_MODULES),) - LOCAL_REQUIRED_MODULES += $(TARGET_RECOVERY_DEVICE_MODULES) + TWRP_REQUIRED_MODULES += $(TARGET_RECOVERY_DEVICE_MODULES) endif LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\" LOCAL_CFLAGS += -DTWHTCD_PATH=\"$(TWHTCD_PATH)\" ifeq ($(TW_INCLUDE_NTFS_3G),true) ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 22; echo $$?),0) - LOCAL_REQUIRED_MODULES += \ + TWRP_REQUIRED_MODULES += \ mount.ntfs \ fsck.ntfs \ mkfs.ntfs else - LOCAL_REQUIRED_MODULES += \ + TWRP_REQUIRED_MODULES += \ ntfs-3g \ ntfsfix \ mkntfs @@ -506,23 +506,29 @@ endif endif ifeq ($(TARGET_USERIMAGES_USE_F2FS), true) ifeq ($(shell test $(CM_PLATFORM_SDK_VERSION) -ge 3; echo $$?),0) - LOCAL_REQUIRED_MODULES += \ + TWRP_REQUIRED_MODULES += \ fsck.f2fs \ mkfs.f2fs endif ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) - LOCAL_REQUIRED_MODULES += sload.f2fs + TWRP_REQUIRED_MODULES += sload.f2fs endif endif -ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0) - LOCAL_REQUIRED_MODULES += file_contexts_text -else ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 25; echo $$?),0) - LOCAL_ADDITIONAL_DEPENDENCIES += file_contexts_text +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 25; echo $$?),0) + TWRP_REQUIRED_MODULES += file_contexts_text endif -ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),) -LOCAL_REQUIRED_MODULES += recovery-persist recovery-refresh +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 24; echo $$?),0) + ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),) + TWRP_REQUIRED_MODULES += recovery-persist recovery-refresh + endif +endif + +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) + LOCAL_REQUIRED_MODULES += $(TWRP_REQUIRED_MODULES) +else + LOCAL_ADDITIONAL_DEPENDENCIES += $(TWRP_REQUIRED_MODULES) endif include $(BUILD_EXECUTABLE) @@ -532,7 +538,11 @@ include $(CLEAR_VARS) LOCAL_MODULE := file_contexts_text LOCAL_MODULE_TAGS := optional -LOCAL_REQUIRED_MODULES := file_contexts.bin +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) + LOCAL_REQUIRED_MODULES := file_contexts.bin +else + LOCAL_ADDITIONAL_DEPENDENCIES := file_contexts.bin +endif LOCAL_POST_INSTALL_CMD := \ $(hide) cp -f $(PRODUCT_OUT)/obj/ETC/file_contexts.bin_intermediates/file_contexts.concat.tmp $(TARGET_RECOVERY_ROOT_OUT)/file_contexts @@ -573,6 +583,11 @@ include $(CLEAR_VARS) LOCAL_MODULE := busybox_symlinks LOCAL_MODULE_TAGS := optional LOCAL_ADDITIONAL_DEPENDENCIES := $(RECOVERY_BUSYBOX_SYMLINKS) +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) + LOCAL_REQUIRED_MODULES := $(RECOVERY_BUSYBOX_SYMLINKS) +else + LOCAL_ADDITIONAL_DEPENDENCIES := $(RECOVERY_BUSYBOX_SYMLINKS) +endif ifneq (,$(filter $(PLATFORM_SDK_VERSION),16 17 18)) ALL_DEFAULT_INSTALLED_MODULES += $(RECOVERY_BUSYBOX_SYMLINKS) endif diff --git a/crypto/ext4crypt/Android.mk b/crypto/ext4crypt/Android.mk index 8e77cdf30..0c6ef5b56 100644 --- a/crypto/ext4crypt/Android.mk +++ b/crypto/ext4crypt/Android.mk @@ -45,7 +45,11 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0) LOCAL_SHARED_LIBRARIES += libkeyutils endif endif - LOCAL_REQUIRED_MODULES := keystore_auth + ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) + LOCAL_REQUIRED_MODULES := keystore_auth + else + LOCAL_ADDITIONAL_DEPENDENCIES := keystore_auth + endif else #7.x rules LOCAL_SRC_FILES += Ext4Crypt.cpp Keymaster.cpp KeyStorage.cpp diff --git a/crypto/scrypt/Scrypt.mk b/crypto/scrypt/Scrypt.mk index baa41eca6..67e73c80f 100644 --- a/crypto/scrypt/Scrypt.mk +++ b/crypto/scrypt/Scrypt.mk @@ -27,7 +27,11 @@ LOCAL_CFLAGS += $(target_c_flags) LOCAL_C_INCLUDES += $(target_c_includes) $(commands_recovery_local_path)/crypto/scrypt/lib/util LOCAL_MODULE_TAGS := optional LOCAL_MODULE:= libscrypttwrp_static -LOCAL_ADDITIONAL_DEPENDENCIES := $(local_additional_dependencies) +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) + LOCAL_REQUIRED_MODULES := $(local_additional_dependencies) +else + LOCAL_ADDITIONAL_DEPENDENCIES := $(local_additional_dependencies) +endif include $(BUILD_STATIC_LIBRARY) ######################################## @@ -42,5 +46,9 @@ LOCAL_C_INCLUDES += $(host_c_includes) $(commands_recovery_local_path)/crypto/sc LOCAL_LDLIBS += -ldl LOCAL_MODULE_TAGS := optional LOCAL_MODULE:= libscrypttwrp_static -LOCAL_ADDITIONAL_DEPENDENCIES := $(local_additional_dependencies) +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) + LOCAL_REQUIRED_MODULES := $(local_additional_dependencies) +else + LOCAL_ADDITIONAL_DEPENDENCIES := $(local_additional_dependencies) +endif include $(BUILD_HOST_STATIC_LIBRARY) diff --git a/minui/Android.mk b/minui/Android.mk index ddec62bf9..824eec659 100644 --- a/minui/Android.mk +++ b/minui/Android.mk @@ -32,7 +32,11 @@ ifeq ($(TW_TARGET_USES_QCOM_BSP), true) LOCAL_CFLAGS += -DMSM_BSP LOCAL_SRC_FILES += graphics_overlay.cpp ifeq ($(TARGET_PREBUILT_KERNEL),) - LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr + ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) + LOCAL_REQUIRED_MODULES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr + else + LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr + endif LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include else ifeq ($(TARGET_CUSTOM_KERNEL_HEADERS),) diff --git a/minuitwrp/Android.mk b/minuitwrp/Android.mk index 3356402ba..2ca2091e1 100644 --- a/minuitwrp/Android.mk +++ b/minuitwrp/Android.mk @@ -21,7 +21,11 @@ ifeq ($(TW_TARGET_USES_QCOM_BSP), true) LOCAL_CFLAGS += -DMSM_BSP LOCAL_SRC_FILES += graphics_overlay.cpp ifeq ($(TARGET_PREBUILT_KERNEL),) - LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr + ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) + LOCAL_REQUIRED_MODULES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr + else + LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr + endif LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include else ifeq ($(TARGET_CUSTOM_KERNEL_HEADERS),) diff --git a/toolbox/Android.mk b/toolbox/Android.mk index 926743850..986b7a4ec 100644 --- a/toolbox/Android.mk +++ b/toolbox/Android.mk @@ -307,7 +307,11 @@ $(SYMLINKS): $(LOCAL_INSTALLED_MODULE) include $(CLEAR_VARS) LOCAL_MODULE := toolbox_symlinks LOCAL_MODULE_TAGS := optional -LOCAL_ADDITIONAL_DEPENDENCIES := $(SYMLINKS) +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) + LOCAL_REQUIRED_MODULES := $(SYMLINKS) +else + LOCAL_ADDITIONAL_DEPENDENCIES := $(SYMLINKS) +endif include $(BUILD_PHONY_PACKAGE) ifneq (,$(filter $(PLATFORM_SDK_VERSION),16 17 18)) diff --git a/toybox/Android.mk b/toybox/Android.mk index 5f6edec3f..0850d5845 100644 --- a/toybox/Android.mk +++ b/toybox/Android.mk @@ -585,7 +585,11 @@ $(SYMLINKS): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk include $(CLEAR_VARS) LOCAL_MODULE := toybox_symlinks LOCAL_MODULE_TAGS := optional -LOCAL_ADDITIONAL_DEPENDENCIES := $(SYMLINKS) +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) + LOCAL_REQUIRED_MODULES := $(SYMLINKS) +else + LOCAL_ADDITIONAL_DEPENDENCIES := $(SYMLINKS) +endif include $(BUILD_PHONY_PACKAGE) endif -- cgit v1.2.3