summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2022-07-14 08:02:43 +0300
committerMasahiro Yamada <masahiroy@kernel.org>2022-07-27 15:18:00 +0300
commit84850dbbbe60a75b27eb0f272fdbc28cfaae689b (patch)
treee510f94e8363abe380b0b23889211b83fd15ed41
parent9a68fd7fd8b05050b27ae67a829a2035b2b7a993 (diff)
downloadlinux-84850dbbbe60a75b27eb0f272fdbc28cfaae689b.tar.xz
kbuild: error out if $(INSTALL_MOD_PATH) contains % or :
If the directory path given to INSTALL_MOD_PATH contains % or :, the module_install fails. % is used in pattern rules, and : as the separator of dependencies. Bail out with a clearer error message. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <n.schier@avm.de>
-rw-r--r--scripts/Makefile.modinst3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index 16a02e9237d3..a4c987c23750 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -18,6 +18,9 @@ INSTALL_MOD_DIR ?= extra
dst := $(MODLIB)/$(INSTALL_MOD_DIR)
endif
+$(foreach x, % :, $(if $(findstring $x, $(dst)), \
+ $(error module installation path cannot contain '$x')))
+
suffix-y :=
suffix-$(CONFIG_MODULE_COMPRESS_GZIP) := .gz
suffix-$(CONFIG_MODULE_COMPRESS_XZ) := .xz