Quote pattern in 'find' command used to generate modules.load
When a kernel module archive is specified via
BOARD_*_KERNEL_MODULES_ARCHIVE an unquoted wildcard pattern in the
'find' command used to find modules to add to modules.load can result
in a build failure due to shell expansion. Fix this by quoting the
pattern so that kernel modules in $ANDROID_BUILD_TOP don't cause
unexpected build failures.
Bug: 289887845
Test: Define BOARD_VENDOR_KERNEL_MODULES_ARCHIVE for
aosp_cf_x86_64_phone, touch foo.ko &&
lunch aosp_cf_x86_64_phone-userdebug && m succeeds.
Change-Id: I8122afc6bbbb5df6e3b11922b2be38129addeda0
Signed-off-by: Rashid Zaman <rashidz@meta.com>
diff --git a/core/Makefile b/core/Makefile
index 00ab3f8..4a6c184 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -412,7 +412,7 @@
unzip -qoDD -d $$(PRIVATE_MODULE_DIR) $$(PRIVATE_MODULE_ARCHIVE); \
mkdir -p $$(PRIVATE_OUTPUT_DIR)/lib; \
cp -r $(3)/$(DEPMOD_STAGING_SUBDIR)/$(2)/lib/modules $$(PRIVATE_OUTPUT_DIR)/lib/; \
- find $$(PRIVATE_MODULE_DIR) -type f -name *.ko | xargs basename -a > $$(PRIVATE_LOAD_FILE); \
+ find $$(PRIVATE_MODULE_DIR) -type f -name '*.ko' | xargs basename -a > $$(PRIVATE_LOAD_FILE); \
)
$(if $(1),\
cp $$(PRIVATE_MODULES) $$(PRIVATE_MODULE_DIR)/; \