From c4624460ca54943bbccfb9946b96b1c7061c1fc1 Mon Sep 17 00:00:00 2001 From: Rashid Zaman Date: Tue, 4 Jul 2023 22:43:15 -0700 Subject: [PATCH] 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 --- core/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index 00ab3f8106..4a6c18444c 100644 --- a/core/Makefile +++ b/core/Makefile @@ -412,7 +412,7 @@ $(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep: $(1) $(6) 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)/; \