Import prebuilt kernel modules like fips140.ko
Add support for copying prebuilt kernel modules like fips140.ko into the vendor ramdisk. These kernel modules are different in the following ways: - They do not appear in vendor_boot.modules.load provided by the kernel build system. - We want to put their names at the very beginning of the output modules.load file to ensure that they are loaded prior to all other modules. We define a new Makefile variable named BOARD_PREBUILT_VENDOR_RAMDISK_KERNEL_MODULES. For every filename on this list, we verify that the file exists in $(KERNEL_MODULE_DIR), and if it does, we include its name in the modules.load for the vendor boot ramdisk. Bug: 194712883 Change-Id: Iff8923c2492296b8eb4d24ec94bbfccc19f4e8f5
This commit is contained in:
parent
da4c293712
commit
f41ee9ffe6
1 changed files with 12 additions and 3 deletions
|
@ -352,11 +352,20 @@ KERNEL_MODULES := $(wildcard $(KERNEL_MODULE_DIR)/*.ko)
|
||||||
|
|
||||||
BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.blocklist
|
BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.blocklist
|
||||||
|
|
||||||
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_boot.modules.load))
|
# Prebuilt kernel modules that are *not* listed in vendor_boot.modules.load
|
||||||
ifndef BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD
|
BOARD_PREBUILT_VENDOR_RAMDISK_KERNEL_MODULES = fips140/fips140.ko
|
||||||
|
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_EXTRA = $(foreach k,$(BOARD_PREBUILT_VENDOR_RAMDISK_KERNEL_MODULES),$(if $(wildcard $(KERNEL_MODULE_DIR)/$(k)), $(k)))
|
||||||
|
KERNEL_MODULES += $(addprefix $(KERNEL_MODULE_DIR)/, $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_EXTRA))
|
||||||
|
|
||||||
|
# Kernel modules that are listed in vendor_boot.modules.load
|
||||||
|
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_FILE := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_boot.modules.load))
|
||||||
|
ifndef BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_FILE
|
||||||
$(error vendor_boot.modules.load not found or empty)
|
$(error vendor_boot.modules.load not found or empty)
|
||||||
endif
|
endif
|
||||||
BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(addprefix $(KERNEL_MODULE_DIR)/, $(notdir $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD)))
|
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_EXTRA)
|
||||||
|
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD += $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_FILE)
|
||||||
|
BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(addprefix $(KERNEL_MODULE_DIR)/, $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_EXTRA))
|
||||||
|
BOARD_VENDOR_RAMDISK_KERNEL_MODULES += $(addprefix $(KERNEL_MODULE_DIR)/, $(notdir $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD_FILE)))
|
||||||
|
|
||||||
BOARD_VENDOR_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.load))
|
BOARD_VENDOR_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.load))
|
||||||
ifndef BOARD_VENDOR_KERNEL_MODULES_LOAD
|
ifndef BOARD_VENDOR_KERNEL_MODULES_LOAD
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue