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. fi
  38. # Default install
  39. if [ "$(basename $2)" = "zImage" ]; then
  40. # Compressed install
  41. echo "Installing compressed kernel"
  42. base=vmlinuz
  43. else
  44. # Normal install
  45. echo "Installing normal kernel"
  46. base=vmlinux
  47. fi
  48. if [ -f $4/$base-$1 ]; then
  49. mv $4/$base-$1 $4/$base-$1.old
  50. fi
  51. cat $2 > $4/$base-$1
  52. # Install system map file
  53. if [ -f $4/System.map-$1 ]; then
  54. mv $4/System.map-$1 $4/System.map-$1.old
  55. fi
  56. cp $3 $4/System.map-$1