scripts/nsdeps is written to take care of only in-tree modules. Perhaps, this is not a bug, but just a design. At least, Documentation/core-api/symbol-namespaces.rst focuses on in-tree modules. Having said that, some people already tried nsdeps for external modules. So, it would be nice to support it.
Showing the changes to scripts (2 of 4 files). Show all
Unified · Split
| @@ -66,7 +66,7 @@ __modpost: · 65 unmodified lines | |||
| 66 | else | 66 | else |
| 67 | 67 | ||
| 68 | MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T - \ | 68 | MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T - \ |
| 69 | $(if $(KBUILD_NSDEPS),-d modules.nsdeps) | 69 | $(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS)) |
| 70 | 70 | ||
| 71 | ifeq ($(KBUILD_EXTMOD),) | 71 | ifeq ($(KBUILD_EXTMOD),) |
| 72 | MODPOST += $(wildcard vmlinux) | 72 | MODPOST += $(wildcard vmlinux) |
| @@ -21,6 +21,12 @@ if [ "$SPATCH_VERSION_NUM" -lt "$SPATCH_REQ_VERSION_NUM" ] ; then · 20 unmodified lines | |||
| 21 | exit 1 | 21 | exit 1 |
| 22 | fi | 22 | fi |
| 23 | 23 | ||
| 24 | if [ "$KBUILD_EXTMOD" ]; then | ||
| 25 | src_prefix= | ||
| 26 | else | ||
| 27 | src_prefix=$srctree/ | ||
| 28 | fi | ||
| 29 | |||
| 24 | generate_deps_for_ns() { | 30 | generate_deps_for_ns() { |
| 25 | $SPATCH --very-quiet --in-place --sp-file \ | 31 | $SPATCH --very-quiet --in-place --sp-file \ |
| 26 | $srctree/scripts/coccinelle/misc/add_namespace.cocci -D ns=$1 $2 | 32 | $srctree/scripts/coccinelle/misc/add_namespace.cocci -D ns=$1 $2 |
| @@ -32,7 +38,7 @@ generate_deps() { · 5 unmodified lines | |||
| 32 | local namespaces="$*" | 38 | local namespaces="$*" |
| 33 | local mod_source_files="`cat $mod.mod | sed -n 1p \ | 39 | local mod_source_files="`cat $mod.mod | sed -n 1p \ |
| 34 | | sed -e 's/\.o/\.c/g' \ | 40 | | sed -e 's/\.o/\.c/g' \ |
| 35 | | sed "s|[^ ]* *|${srctree}/&|g"`" | 41 | | sed "s|[^ ]* *|${src_prefix}&|g"`" |
| 36 | for ns in $namespaces; do | 42 | for ns in $namespaces; do |
| 37 | echo "Adding namespace $ns to module $mod.ko." | 43 | echo "Adding namespace $ns to module $mod.ko." |
| 38 | generate_deps_for_ns $ns "$mod_source_files" | 44 | generate_deps_for_ns $ns "$mod_source_files" |
| @@ -54,4 +60,4 @@ generate_deps() { · 15 unmodified lines | |||
| 54 | while read line | 60 | while read line |
| 55 | do | 61 | do |
| 56 | generate_deps $line | 62 | generate_deps $line |
| 57 | done < modules.nsdeps | 63 | done < $MODULES_NSDEPS |