1fc4da9a3SMichal Marek#!/bin/sh 2b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 3fc4da9a3SMichal Marek# 4*79b96c33SMasahiro Yamada# A depmod wrapper 5fc4da9a3SMichal Marek 6*79b96c33SMasahiro Yamadaif test $# -ne 1; then 7*79b96c33SMasahiro Yamada echo "Usage: $0 <kernelrelease>" >&2 8fc4da9a3SMichal Marek exit 1 9fc4da9a3SMichal Marekfi 10*79b96c33SMasahiro Yamada 11*79b96c33SMasahiro YamadaKERNELRELEASE=$1 12*79b96c33SMasahiro Yamada 13*79b96c33SMasahiro Yamada: ${DEPMOD:=depmod} 14fc4da9a3SMichal Marek 15934193a6SRandy Dunlapif ! test -r System.map ; then 16f0b0d88aSRandy Dunlap echo "Warning: modules_install: missing 'System.map' file. Skipping depmod." >&2 17fc4da9a3SMichal Marek exit 0 18fc4da9a3SMichal Marekfi 198937e897SJames Hogan 20cedd1862SLinus Torvalds# legacy behavior: "depmod" in /sbin, no /sbin in PATH 21cedd1862SLinus TorvaldsPATH="$PATH:/sbin" 22934193a6SRandy Dunlapif [ -z $(command -v $DEPMOD) ]; then 23914b087fSRandy Dunlap echo "Warning: 'make modules_install' requires $DEPMOD. Please install it." >&2 24934193a6SRandy Dunlap echo "This is probably in the kmod package." >&2 25914b087fSRandy Dunlap exit 0 26934193a6SRandy Dunlapfi 27934193a6SRandy Dunlap 28fc4da9a3SMichal Marekset -- -ae -F System.map 29fc4da9a3SMichal Marekif test -n "$INSTALL_MOD_PATH"; then 30fc4da9a3SMichal Marek set -- "$@" -b "$INSTALL_MOD_PATH" 31fc4da9a3SMichal Marekfi 324d15c9faSMichal Suchanekexec "$DEPMOD" "$@" "$KERNELRELEASE" 33