install.sh 1.3 KB

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