depmod.sh 723 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0
  3. #
  4. # A depmod wrapper
  5. if test $# -ne 1; then
  6. echo "Usage: $0 <kernelrelease>" >&2
  7. exit 1
  8. fi
  9. KERNELRELEASE=$1
  10. : ${DEPMOD:=depmod}
  11. if ! test -r "${objtree}/System.map" ; then
  12. echo "Warning: modules_install: missing 'System.map' file. Skipping depmod." >&2
  13. exit 0
  14. fi
  15. # legacy behavior: "depmod" in /sbin, no /sbin in PATH
  16. PATH="$PATH:/sbin"
  17. if [ -z $(command -v $DEPMOD) ]; then
  18. echo "Warning: 'make modules_install' requires $DEPMOD. Please install it." >&2
  19. echo "This is probably in the kmod package." >&2
  20. exit 0
  21. fi
  22. set -- -ae -F "${objtree}/System.map"
  23. if test -n "$INSTALL_MOD_PATH"; then
  24. set -- "$@" -b "$INSTALL_MOD_PATH"
  25. fi
  26. exec "$DEPMOD" "$@" "$KERNELRELEASE"