install.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. if [ -n "${INSTALL_PATH}" ] && ! [ -e "${INSTALL_PATH}" ]; then
  21. mkdir -p "${INSTALL_PATH}"
  22. fi
  23. # User/arch may have a custom install script
  24. for file in "${HOME}/bin/${INSTALLKERNEL}" \
  25. "/sbin/${INSTALLKERNEL}" \
  26. "${srctree}/arch/${SRCARCH}/install.sh" \
  27. "${srctree}/arch/${SRCARCH}/boot/install.sh"
  28. do
  29. if [ ! -x "${file}" ]; then
  30. continue
  31. fi
  32. # installkernel(8) says the parameters are like follows:
  33. #
  34. # installkernel version zImage System.map [directory]
  35. exec "${file}" "${KERNELRELEASE}" "${KBUILD_IMAGE}" System.map "${INSTALL_PATH}"
  36. done
  37. echo "No install script found" >&2
  38. exit 1