install.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. #
  3. # This file is subject to the terms and conditions of the GNU General Public
  4. # License. See the file "COPYING" in the main directory of this archive
  5. # for more details.
  6. #
  7. # Copyright (C) 1995 by Linus Torvalds
  8. #
  9. # Blatantly stolen from in arch/i386/boot/install.sh by Dave Hansen
  10. #
  11. # "make install" script for ppc64 architecture
  12. #
  13. # Arguments:
  14. # $1 - kernel version
  15. # $2 - kernel image file
  16. # $3 - kernel map file
  17. # $4 - default install path (blank if root directory)
  18. # $5 and more - kernel boot files; zImage*, uImage, cuImage.*, etc.
  19. #
  20. # Bail with error code if anything goes wrong
  21. set -e
  22. # User may have a custom install script
  23. if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
  24. if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
  25. # Default install
  26. # this should work for both the pSeries zImage and the iSeries vmlinux.sm
  27. image_name=`basename $2`
  28. if [ -f $4/$image_name ]; then
  29. mv $4/$image_name $4/$image_name.old
  30. fi
  31. if [ -f $4/System.map ]; then
  32. mv $4/System.map $4/System.old
  33. fi
  34. cat $2 > $4/$image_name
  35. cp $3 $4/System.map
  36. # Copy all the bootable image files
  37. path=$4
  38. shift 4
  39. while [ $# -ne 0 ]; do
  40. image_name=`basename $1`
  41. if [ -f $path/$image_name ]; then
  42. mv $path/$image_name $path/$image_name.old
  43. fi
  44. cat $1 > $path/$image_name
  45. shift
  46. done;