depmod: handle the case of /sbin/depmod without /sbin in PATH

Commit 436e980e2ed5 ("kbuild: don't hardcode depmod path") stopped
hard-coding the path of depmod, but in the process caused trouble for
distributions that had that /sbin location, but didn't have it in the
PATH (generally because /sbin is limited to the super-user path).

Work around it for now by just adding /sbin to the end of PATH in the script.

Reported-and-tested-by: Sedat Dilek <>
Signed-off-by: Linus Torvalds <>
diff --git a/scripts/ b/scripts/
index e083bca..3643b4f 100755
--- a/scripts/
+++ b/scripts/
@@ -15,6 +15,8 @@
 	exit 0
+# legacy behavior: "depmod" in /sbin, no /sbin in PATH
 if [ -z $(command -v $DEPMOD) ]; then
 	echo "Warning: 'make modules_install' requires $DEPMOD. Please install it." >&2
 	echo "This is probably in the kmod package." >&2