diff options
-rw-r--r-- | Makefile | 1 | ||||
-rwxr-xr-x | scripts/modules-check.sh | 16 |
2 files changed, 17 insertions, 0 deletions
@@ -1288,6 +1288,7 @@ modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin | |||
1288 | $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order | 1288 | $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order |
1289 | @$(kecho) ' Building modules, stage 2.'; | 1289 | @$(kecho) ' Building modules, stage 2.'; |
1290 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost | 1290 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |
1291 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh | ||
1291 | 1292 | ||
1292 | modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) | 1293 | modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) |
1293 | $(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin | 1294 | $(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin |
diff --git a/scripts/modules-check.sh b/scripts/modules-check.sh new file mode 100755 index 000000000000..2f659530e1ec --- /dev/null +++ b/scripts/modules-check.sh | |||
@@ -0,0 +1,16 @@ | |||
1 | #!/bin/sh | ||
2 | # SPDX-License-Identifier: GPL-2.0 | ||
3 | |||
4 | set -e | ||
5 | |||
6 | # Check uniqueness of module names | ||
7 | check_same_name_modules() | ||
8 | { | ||
9 | for m in $(sed 's:.*/::' modules.order modules.builtin | sort | uniq -d) | ||
10 | do | ||
11 | echo "warning: same basename if the following are built as modules:" >&2 | ||
12 | sed "/\/$m/!d;s:^kernel/: :" modules.order modules.builtin >&2 | ||
13 | done | ||
14 | } | ||
15 | |||
16 | check_same_name_modules | ||