Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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) |
Grant Likely | 29f1aff | 2008-12-19 14:57:20 +0000 | [diff] [blame] | 18 | # $5 and more - kernel boot files; zImage*, uImage, cuImage.*, etc. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | # |
| 20 | |
Grant Likely | 529273c | 2009-06-06 06:39:46 +0000 | [diff] [blame] | 21 | # Bail with error code if anything goes wrong |
| 22 | set -e |
| 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | # User may have a custom install script |
| 25 | |
Ian Campbell | 0f8e2d6 | 2005-06-23 00:08:10 -0700 | [diff] [blame] | 26 | if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi |
| 27 | if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then exec /sbin/${CROSS_COMPILE}installkernel "$@"; fi |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | |
| 29 | # Default install |
| 30 | |
| 31 | # this should work for both the pSeries zImage and the iSeries vmlinux.sm |
Olaf Hering | 18c5332 | 2005-10-28 17:46:56 -0700 | [diff] [blame] | 32 | image_name=`basename $2` |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | |
| 34 | if [ -f $4/$image_name ]; then |
| 35 | mv $4/$image_name $4/$image_name.old |
| 36 | fi |
| 37 | |
| 38 | if [ -f $4/System.map ]; then |
| 39 | mv $4/System.map $4/System.old |
| 40 | fi |
| 41 | |
| 42 | cat $2 > $4/$image_name |
| 43 | cp $3 $4/System.map |
Grant Likely | 29f1aff | 2008-12-19 14:57:20 +0000 | [diff] [blame] | 44 | |
| 45 | # Copy all the bootable image files |
| 46 | path=$4 |
| 47 | shift 4 |
| 48 | while [ $# -ne 0 ]; do |
| 49 | image_name=`basename $1` |
| 50 | if [ -f $path/$image_name ]; then |
| 51 | mv $path/$image_name $path/$image_name.old |
| 52 | fi |
| 53 | cat $1 > $path/$image_name |
| 54 | shift |
| 55 | done; |