Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad3c3052 authored by Kelvin Zhang's avatar Kelvin Zhang
Browse files

Skip stripping 16K GKI kernel modules

GKI kernel modules are required to be signed, but curretnly we strip all
16K kernel modules. Use SYSTEM_DLKM_MODULE_PATTERNS to determine which
modules are GKI, and skip stripping for these kernel modules.

Test: boot using 16K boot image
Bug: 303725887

Change-Id: I4cd71b39ceb75650d03744220ec4ddf4aeeda871
parent fe455d1c
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -1060,9 +1060,16 @@ TARGET_OUT_RAMDISK_16K := $(PRODUCT_OUT)/ramdisk_16k
BUILT_RAMDISK_16K_TARGET := $(PRODUCT_OUT)/ramdisk_16k.img
RAMDISK_16K_STAGING_DIR := $(call intermediates-dir-for,PACKAGING,depmod_ramdisk_16k)

ifneq ($(BOARD_SYSTEM_KERNEL_MODULES),)
SYSTEM_DLKM_MODULE_PATTERNS := $(foreach path,$(BOARD_SYSTEM_KERNEL_MODULES),%/$(notdir $(path)))

endif

# For non-GKI modules, strip them before install. As debug symbols take up
# significant space.
$(foreach \
  file,\
  $(BOARD_KERNEL_MODULES_16K),\
  $(filter-out $(SYSTEM_DLKM_MODULE_PATTERNS),$(BOARD_KERNEL_MODULES_16K)),\
  $(eval \
    $(call copy-and-strip-kernel-module,\
      $(file),\
@@ -1071,6 +1078,20 @@ $(foreach \
  ) \
)

# For GKI modules, copy as-is without stripping, because stripping would
# remove the signature of kernel modules, and GKI modules must be signed
# for kernel to load them.
$(foreach \
  file,\
  $(filter $(SYSTEM_DLKM_MODULE_PATTERNS),$(BOARD_KERNEL_MODULES_16K)),\
  $(eval \
    $(call copy-one-file,\
      $(file),\
      $(RAMDISK_16K_STAGING_DIR)/lib/modules/0.0/$(notdir $(file)) \
    ) \
  ) \
)

BOARD_VENDOR_RAMDISK_FRAGMENT.16K.PREBUILT := $(BUILT_RAMDISK_16K_TARGET)

$(BUILT_RAMDISK_16K_TARGET): $(DEPMOD) $(MKBOOTFS) $(EXTRACT_KERNEL) $(COMPRESSION_COMMAND_DEPS)