install.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/sh
  2. #
  3. # 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 [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi
  35. if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then exec /sbin/${CROSS_COMPILE}installkernel "$@"; fi
  36. # Default install - same as make zlilo
  37. if [ -f $4/vmlinuz ]; then
  38. mv $4/vmlinuz $4/vmlinuz.old
  39. fi
  40. if [ -f $4/System.map ]; then
  41. mv $4/System.map $4/System.old
  42. fi
  43. cat $2 > $4/vmlinuz
  44. cp $3 $4/System.map
  45. if [ -x /sbin/lilo ]; then
  46. /sbin/lilo
  47. elif [ -x /etc/lilo/install ]; then
  48. /etc/lilo/install
  49. else
  50. sync
  51. echo "Cannot find LILO."
  52. fi