xref: /openbmc/linux/arch/riscv/boot/install.sh (revision f774f5bb)
1c0fbcd99SAnup Patel#!/bin/sh
2c0fbcd99SAnup Patel#
3c0fbcd99SAnup Patel# This file is subject to the terms and conditions of the GNU General Public
4c0fbcd99SAnup Patel# License.  See the file "COPYING" in the main directory of this archive
5c0fbcd99SAnup Patel# for more details.
6c0fbcd99SAnup Patel#
7c0fbcd99SAnup Patel# Copyright (C) 1995 by Linus Torvalds
8c0fbcd99SAnup Patel#
9c0fbcd99SAnup Patel# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
10c0fbcd99SAnup Patel# Adapted from code in arch/i386/boot/install.sh by Russell King
11c0fbcd99SAnup Patel#
12c0fbcd99SAnup Patel# "make install" script for the RISC-V Linux port
13c0fbcd99SAnup Patel#
14c0fbcd99SAnup Patel# Arguments:
15c0fbcd99SAnup Patel#   $1 - kernel version
16c0fbcd99SAnup Patel#   $2 - kernel image file
17c0fbcd99SAnup Patel#   $3 - kernel map file
18c0fbcd99SAnup Patel#   $4 - default install path (blank if root directory)
19c0fbcd99SAnup Patel
20c0fbcd99SAnup Patelif [ "$(basename $2)" = "Image.gz" ]; then
21c0fbcd99SAnup Patel# Compressed install
22c0fbcd99SAnup Patel  echo "Installing compressed kernel"
23c0fbcd99SAnup Patel  base=vmlinuz
24c0fbcd99SAnup Patelelse
25c0fbcd99SAnup Patel# Normal install
26c0fbcd99SAnup Patel  echo "Installing normal kernel"
27c0fbcd99SAnup Patel  base=vmlinux
28c0fbcd99SAnup Patelfi
29c0fbcd99SAnup Patel
30c0fbcd99SAnup Patelif [ -f $4/$base-$1 ]; then
31c0fbcd99SAnup Patel  mv $4/$base-$1 $4/$base-$1.old
32c0fbcd99SAnup Patelfi
33c0fbcd99SAnup Patelcat $2 > $4/$base-$1
34c0fbcd99SAnup Patel
35c0fbcd99SAnup Patel# Install system map file
36c0fbcd99SAnup Patelif [ -f $4/System.map-$1 ]; then
37c0fbcd99SAnup Patel  mv $4/System.map-$1 $4/System.map-$1.old
38c0fbcd99SAnup Patelfi
39c0fbcd99SAnup Patelcp $3 $4/System.map-$1
40