install.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/sh
  2. #
  3. # arch/parisc/install.sh, derived from arch/i386/boot/install.sh
  4. #
  5. # This file is subject to the terms and conditions of the GNU General Public
  6. # License. See the file "COPYING" in the main directory of this archive
  7. # for more details.
  8. #
  9. # Copyright (C) 1995 by Linus Torvalds
  10. #
  11. # Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
  12. #
  13. # "make install" script for i386 architecture
  14. #
  15. # Arguments:
  16. # $1 - kernel version
  17. # $2 - kernel image file
  18. # $3 - kernel map file
  19. # $4 - default install path (blank if root directory)
  20. #
  21. verify () {
  22. if [ ! -f "$1" ]; then
  23. echo "" 1>&2
  24. echo " *** Missing file: $1" 1>&2
  25. echo ' *** You need to run "make" before "make install".' 1>&2
  26. echo "" 1>&2
  27. exit 1
  28. fi
  29. }
  30. # Make sure the files actually exist
  31. verify "$2"
  32. verify "$3"
  33. # User may have a custom install script
  34. if [ -n "${INSTALLKERNEL}" ]; then
  35. if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
  36. if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
  37. if [ -x /usr/sbin/${INSTALLKERNEL} ]; then exec /usr/sbin/${INSTALLKERNEL} "$@"; fi
  38. fi
  39. # Default install
  40. if [ "$(basename $2)" = "vmlinuz" ]; then
  41. # Compressed install
  42. echo "Installing compressed kernel"
  43. base=vmlinuz
  44. else
  45. # Normal install
  46. echo "Installing normal kernel"
  47. base=vmlinux
  48. fi
  49. if [ -f $4/$base-$1 ]; then
  50. mv $4/$base-$1 $4/$base-$1.old
  51. fi
  52. cat $2 > $4/$base-$1
  53. # Install system map file
  54. if [ -f $4/System.map-$1 ]; then
  55. mv $4/System.map-$1 $4/System.map-$1.old
  56. fi
  57. cp $3 $4/System.map-$1