Merge tag 'mm-stable-2024-05-24-11-49' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-block.git] / scripts / depmod.sh
CommitLineData
fc4da9a3 1#!/bin/sh
b2441318 2# SPDX-License-Identifier: GPL-2.0
fc4da9a3 3#
79b96c33 4# A depmod wrapper
fc4da9a3 5
79b96c33
MY
6if test $# -ne 1; then
7 echo "Usage: $0 <kernelrelease>" >&2
fc4da9a3
MM
8 exit 1
9fi
79b96c33
MY
10
11KERNELRELEASE=$1
12
13: ${DEPMOD:=depmod}
fc4da9a3 14
934193a6 15if ! test -r System.map ; then
f0b0d88a 16 echo "Warning: modules_install: missing 'System.map' file. Skipping depmod." >&2
fc4da9a3
MM
17 exit 0
18fi
8937e897 19
cedd1862
LT
20# legacy behavior: "depmod" in /sbin, no /sbin in PATH
21PATH="$PATH:/sbin"
934193a6 22if [ -z $(command -v $DEPMOD) ]; then
914b087f 23 echo "Warning: 'make modules_install' requires $DEPMOD. Please install it." >&2
934193a6 24 echo "This is probably in the kmod package." >&2
914b087f 25 exit 0
934193a6
RD
26fi
27
fc4da9a3
MM
28set -- -ae -F System.map
29if test -n "$INSTALL_MOD_PATH"; then
30 set -- "$@" -b "$INSTALL_MOD_PATH"
31fi
4d15c9fa 32exec "$DEPMOD" "$@" "$KERNELRELEASE"