xref: /openbmc/linux/arch/powerpc/boot/install.sh (revision 349f631d)
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#
19
20# Bail with error code if anything goes wrong
21set -e
22
23verify () {
24	if [ ! -f "$1" ]; then
25		echo ""                                                   1>&2
26		echo " *** Missing file: $1"                              1>&2
27		echo ' *** You need to run "make" before "make install".' 1>&2
28		echo ""                                                   1>&2
29		exit 1
30	fi
31}
32
33# Make sure the files actually exist
34verify "$2"
35verify "$3"
36
37# User may have a custom install script
38
39if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
40if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
41
42# Default install
43
44# this should work for both the pSeries zImage and the iSeries vmlinux.sm
45image_name=`basename $2`
46
47if [ -f $4/$image_name ]; then
48	mv $4/$image_name $4/$image_name.old
49fi
50
51if [ -f $4/System.map ]; then
52	mv $4/System.map $4/System.old
53fi
54
55cat $2 > $4/$image_name
56cp $3 $4/System.map
57