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

Commit c187d505 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Skip stripping 16K GKI kernel modules" into main

parents fe455d1c ad3c3052
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)