From 3ec61b473023e86a0f0ddbf461f01c891009dd8f Mon Sep 17 00:00:00 2001 From: Mark-PK Tsai Date: Thu, 26 Aug 2021 15:37:33 +0800 Subject: [PATCH] Add missing custom kernel module targets Custom kernel module targets are not in the build dependency rule which cause the copy command of $(my_copy_pairs) fail. Add it back to $(my_image_copy_files) and remove the prefixed $(my_staging_dir) from dest of kernel module copy pair. Then the makefile can handle it well. Bug: 195888474 Change-Id: Id8cb4c4991905e8bc53ddb5e60e87a36fe43e803 Signed-off-by: Mark-PK Tsai --- core/tasks/tools/build_custom_image.mk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/tasks/tools/build_custom_image.mk b/core/tasks/tools/build_custom_image.mk index 8b766aefd8..f9ae2c1a20 100644 --- a/core/tasks/tools/build_custom_image.mk +++ b/core/tasks/tools/build_custom_image.mk @@ -57,13 +57,15 @@ $(foreach m,$(CUSTOM_IMAGE_MODULES),\ my_kernel_module_copy_files := my_custom_image_modules_var := BOARD_$(strip $(call to-upper,$(my_custom_image_name)))_KERNEL_MODULES ifdef $(my_custom_image_modules_var) - my_kernel_module_copy_files += $(call build-image-kernel-modules,$($(my_custom_image_modules_var)),$(my_staging_dir),$(CUSTOM_IMAGE_MOUNT_POINT),$(call intermediates-dir-for,PACKAGING,depmod_$(my_custom_image_name)),$($(my_custom_image_modules_var)),modules.load,,$(call intermediates-dir-for,PACKAGING,depmod_$(my_custom_image_name)_stripped)) - my_copy_pairs += $(my_kernel_module_copy_files) +$(foreach kmod,\ + $(call build-image-kernel-modules,$($(my_custom_image_modules_var)),$(my_staging_dir),$(CUSTOM_IMAGE_MOUNT_POINT),$(call intermediates-dir-for,PACKAGING,depmod_$(my_custom_image_name)),$($(my_custom_image_modules_var)),modules.load,,$(call intermediates-dir-for,PACKAGING,depmod_$(my_custom_image_name)_stripped)),\ + $(eval pair := $(subst :,$(space),$(kmod)))\ + $(eval my_kernel_module_copy_files += $(word 1,$(pair)):$(subst $(my_staging_dir)/,,$(word 2,$(pair))))) endif # Collect CUSTOM_IMAGE_COPY_FILES. my_image_copy_files := -$(foreach f,$(CUSTOM_IMAGE_COPY_FILES),\ +$(foreach f,$(CUSTOM_IMAGE_COPY_FILES) $(my_kernel_module_copy_files),\ $(eval pair := $(subst :,$(space),$(f)))\ $(eval src := $(word 1,$(pair)))\ $(eval my_image_copy_files += $(src))\