install.sh 986 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0-only
  3. #
  4. # Copyright (C) 1995 by Linus Torvalds
  5. #
  6. # Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
  7. # Common code factored out by Masahiro Yamada
  8. set -e
  9. # Make sure the files actually exist
  10. for file in "${KBUILD_IMAGE}" System.map
  11. do
  12. if [ ! -f "${file}" ]; then
  13. echo >&2
  14. echo >&2 " *** Missing file: ${file}"
  15. echo >&2 ' *** You need to run "make" before "make install".'
  16. echo >&2
  17. exit 1
  18. fi
  19. done
  20. # User/arch may have a custom install script
  21. for file in "${HOME}/bin/${INSTALLKERNEL}" \
  22. "/sbin/${INSTALLKERNEL}" \
  23. "${srctree}/arch/${SRCARCH}/install.sh" \
  24. "${srctree}/arch/${SRCARCH}/boot/install.sh"
  25. do
  26. if [ ! -x "${file}" ]; then
  27. continue
  28. fi
  29. # installkernel(8) says the parameters are like follows:
  30. #
  31. # installkernel version zImage System.map [directory]
  32. exec "${file}" "${KERNELRELEASE}" "${KBUILD_IMAGE}" System.map "${INSTALL_PATH}"
  33. done
  34. echo "No install script found" >&2
  35. exit 1