#!/bin/sh
#
# arch/arm/boot/install.sh
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1995 by Linus Torvalds
#
# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
# Adapted from code in arch/i386/boot/install.sh by Russell King
#
# "make install" script for arm architecture
#
# Arguments:
#   $1 - kernel version
#   $2 - kernel image file
#   $3 - kernel map file
#   $4 - default install path (blank if root directory)
#

if [ "$(basename $2)" = "zImage" ]; then
# Compressed install
  echo "Installing compressed kernel"
  base=vmlinuz
else
# Normal install
  echo "Installing normal kernel"
  base=vmlinux
fi

[ -f $4/config ] && mv $4/config $4/config.old
cp .config $4/config
[ -f $4/$base ] && mv $4/$base $4/$base.old
cat $2 > $4/$base
[ -f $4/System.map ] && mv $4/System.map $4/System.old
cp $3 $4/System.map

if [ -x /sbin/loadmap ] ; then
  /sbin/loadmap
else
  sync
fi
