2011-06-09 15:35:22 +02:00
|
|
|
#!/bin/sh
|
2017-11-01 15:07:57 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2011-06-09 15:35:22 +02:00
|
|
|
#
|
2023-08-23 20:50:43 +09:00
|
|
|
# A depmod wrapper
|
2011-06-09 15:35:22 +02:00
|
|
|
|
2023-08-23 20:50:43 +09:00
|
|
|
if test $# -ne 1; then
|
|
|
|
|
echo "Usage: $0 <kernelrelease>" >&2
|
2011-06-09 15:35:22 +02:00
|
|
|
exit 1
|
|
|
|
|
fi
|
2023-08-23 20:50:43 +09:00
|
|
|
|
|
|
|
|
KERNELRELEASE=$1
|
|
|
|
|
|
|
|
|
|
: ${DEPMOD:=depmod}
|
2011-06-09 15:35:22 +02:00
|
|
|
|
2024-11-10 10:34:30 +09:00
|
|
|
if ! test -r "${objtree}/System.map" ; then
|
2018-09-06 16:37:24 -07:00
|
|
|
echo "Warning: modules_install: missing 'System.map' file. Skipping depmod." >&2
|
2011-06-09 15:35:22 +02:00
|
|
|
exit 0
|
|
|
|
|
fi
|
2013-02-06 12:56:59 +00:00
|
|
|
|
2020-12-28 11:40:22 -08:00
|
|
|
# legacy behavior: "depmod" in /sbin, no /sbin in PATH
|
|
|
|
|
PATH="$PATH:/sbin"
|
2018-07-01 19:46:06 -07:00
|
|
|
if [ -z $(command -v $DEPMOD) ]; then
|
2018-08-28 12:59:10 -07:00
|
|
|
echo "Warning: 'make modules_install' requires $DEPMOD. Please install it." >&2
|
2018-07-01 19:46:06 -07:00
|
|
|
echo "This is probably in the kmod package." >&2
|
2018-08-28 12:59:10 -07:00
|
|
|
exit 0
|
2018-07-01 19:46:06 -07:00
|
|
|
fi
|
|
|
|
|
|
2024-11-10 10:34:30 +09:00
|
|
|
set -- -ae -F "${objtree}/System.map"
|
2011-06-09 15:35:22 +02:00
|
|
|
if test -n "$INSTALL_MOD_PATH"; then
|
|
|
|
|
set -- "$@" -b "$INSTALL_MOD_PATH"
|
|
|
|
|
fi
|
2023-07-18 18:58:43 +02:00
|
|
|
exec "$DEPMOD" "$@" "$KERNELRELEASE"
|