From 69280d22e67b2fd1f0d0e08615f2bcb90032e4f9 Mon Sep 17 00:00:00 2001 From: Steve Muckle Date: Thu, 11 Jul 2019 12:23:38 -0700 Subject: [PATCH] add BOARD_VENDOR_RAMDISK_KERNEL_MODULES[_LOAD] To accommodate a future vendor ramdisk, recognize BOARD_VENDOR_RAMDISK_KERNEL_MODULES and BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD as a way to specify kernel modules to be stored on the vendor ramdisk, and the optional override list of kernel modules to be loaded by first stage init. For now this will affect the modules loaded on the generic ramdisk, but will provide a way for vendors to add support now and hopefully not have to modify it later when the vendor ramdisk is created. BOARD_RAMDISK_KERNEL_MODULES is renamed to BOARD_GENERIC_RAMDISK_KERNEL_MODULES, which is not expected to be modified by vendors. Bug: 137297791 Change-Id: I05944e004ab5235172da3a15b8d1c6f4c4c021ce --- core/Makefile | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/core/Makefile b/core/Makefile index b2da68badd..41a1d52f68 100644 --- a/core/Makefile +++ b/core/Makefile @@ -709,32 +709,40 @@ $(1)/$(DEPMOD_STAGING_SUBDIR)/$(3): $(2) (for MODULE in $$(PRIVATE_LOAD_MODULES); do basename $$$$MODULE >> $$@; done) endef +# Until support for a vendor-boot/vendor-ramdisk is added, store vendor ramdisk +# kernel modules on the generic ramdisk as a stopgap. +ifneq ($(BOARD_VENDOR_RAMDISK_KERNEL_MODULES),) + BOARD_GENERIC_RAMDISK_KERNEL_MODULES += $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES) +endif +ifneq ($(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD),) + BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD += $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD) +endif ifeq ($(BOARD_RECOVERY_KERNEL_MODULES_LOAD),) BOARD_RECOVERY_KERNEL_MODULES_LOAD := $(BOARD_RECOVERY_KERNEL_MODULES) endif -ifeq ($(BOARD_RAMDISK_KERNEL_MODULES_LOAD),) - BOARD_RAMDISK_KERNEL_MODULES_LOAD := $(BOARD_RAMDISK_KERNEL_MODULES) +ifeq ($(BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD),) + BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD := $(BOARD_GENERIC_RAMDISK_KERNEL_MODULES) endif -ifdef BOARD_RAMDISK_KERNEL_MODULES +ifdef BOARD_GENERIC_RAMDISK_KERNEL_MODULES ifeq ($(BOARD_USES_RECOVERY_AS_BOOT), true) - BOARD_RECOVERY_KERNEL_MODULES += $(BOARD_RAMDISK_KERNEL_MODULES) + BOARD_RECOVERY_KERNEL_MODULES += $(BOARD_GENERIC_RAMDISK_KERNEL_MODULES) endif endif ifdef BOARD_RECOVERY_KERNEL_MODULES ifeq ($(BOARD_USES_RECOVERY_AS_BOOT), true) - ifdef BOARD_RAMDISK_KERNEL_MODULES_LOAD - ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(call module-load-list-copy-paths,$(call intermediates-dir-for,PACKAGING,ramdisk_modules),$(BOARD_RAMDISK_KERNEL_MODULES_LOAD),modules.load,$(TARGET_RECOVERY_ROOT_OUT))) + ifdef BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD + ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(call module-load-list-copy-paths,$(call intermediates-dir-for,PACKAGING,ramdisk_modules),$(BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD),modules.load,$(TARGET_RECOVERY_ROOT_OUT))) endif endif ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(call build-image-kernel-modules,$(BOARD_RECOVERY_KERNEL_MODULES),$(TARGET_RECOVERY_ROOT_OUT),,$(call intermediates-dir-for,PACKAGING,depmod_recovery),$(BOARD_RECOVERY_KERNEL_MODULES_LOAD),modules.load.recovery)) endif ifneq ($(BOARD_USES_RECOVERY_AS_BOOT), true) - ifdef BOARD_RAMDISK_KERNEL_MODULES - ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(call build-image-kernel-modules,$(BOARD_RAMDISK_KERNEL_MODULES),$(TARGET_RAMDISK_OUT),,$(call intermediates-dir-for,PACKAGING,depmod_ramdisk),$(BOARD_RAMDISK_KERNEL_MODULES_LOAD),modules.load)) + ifdef BOARD_GENERIC_RAMDISK_KERNEL_MODULES + ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(call build-image-kernel-modules,$(BOARD_GENERIC_RAMDISK_KERNEL_MODULES),$(TARGET_RAMDISK_OUT),,$(call intermediates-dir-for,PACKAGING,depmod_ramdisk),$(BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD),modules.load)) endif endif