install.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/sh
  2. #
  3. # arch/sh/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. # Adapted from code in arch/i386/boot/install.sh by Russell King
  13. # Adapted from code in arch/arm/boot/install.sh by Stuart Menefy
  14. # Adapted from code in arch/sh/boot/install.sh by Takeo Takahashi
  15. #
  16. # "make install" script for sh architecture
  17. #
  18. # Arguments:
  19. # $1 - kernel version
  20. # $2 - kernel image file
  21. # $3 - kernel map file
  22. # $4 - default install path (blank if root directory)
  23. #
  24. # User may have a custom install script
  25. if [ -x /sbin/${INSTALLKERNEL} ]; then
  26. exec /sbin/${INSTALLKERNEL} "$@"
  27. fi
  28. if [ "$2" = "zImage" ]; then
  29. # Compressed install
  30. echo "Installing compressed kernel"
  31. if [ -f $4/vmlinuz-$1 ]; then
  32. mv $4/vmlinuz-$1 $4/vmlinuz.old
  33. fi
  34. if [ -f $4/System.map-$1 ]; then
  35. mv $4/System.map-$1 $4/System.old
  36. fi
  37. cat $2 > $4/vmlinuz-$1
  38. cp $3 $4/System.map-$1
  39. else
  40. # Normal install
  41. echo "Installing normal kernel"
  42. if [ -f $4/vmlinux-$1 ]; then
  43. mv $4/vmlinux-$1 $4/vmlinux.old
  44. fi
  45. if [ -f $4/System.map ]; then
  46. mv $4/System.map $4/System.old
  47. fi
  48. cat $2 > $4/vmlinux-$1
  49. cp $3 $4/System.map
  50. fi