33 lines
697 B
Bash
Raw Normal View History

2026-01-21 18:59:54 +08:00
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
#
2026-01-29 22:25:33 +08:00
# A depmod wrapper
2026-01-21 18:59:54 +08:00
2026-01-29 22:25:33 +08:00
if test $# -ne 1; then
echo "Usage: $0 <kernelrelease>" >&2
2026-01-21 18:59:54 +08:00
exit 1
fi
2026-01-29 22:25:33 +08:00
KERNELRELEASE=$1
: ${DEPMOD:=depmod}
if ! test -r System.map ; then
2026-01-21 18:59:54 +08:00
echo "Warning: modules_install: missing 'System.map' file. Skipping depmod." >&2
exit 0
fi
# legacy behavior: "depmod" in /sbin, no /sbin in PATH
PATH="$PATH:/sbin"
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
exit 0
fi
2026-01-29 22:25:33 +08:00
set -- -ae -F System.map
2026-01-21 18:59:54 +08:00
if test -n "$INSTALL_MOD_PATH"; then
set -- "$@" -b "$INSTALL_MOD_PATH"
fi
2026-01-29 22:25:33 +08:00
exec "$DEPMOD" "$@" "$KERNELRELEASE"