#!/bin/sh1#2# This file is subject to the terms and conditions of the GNU General Public3# License. See the file "COPYING" in the main directory of this archive4# for more details.5#6# Copyright (C) 1995 by Linus Torvalds7#8# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin9# Adapted from code in arch/i386/boot/install.sh by Russell King10#11# "make install" script for the LoongArch Linux port12#13# Arguments:14# $1 - kernel version15# $2 - kernel image file16# $3 - kernel map file17# $4 - default install path (blank if root directory)1819set -e2021case "${2##*/}" in22vmlinux.elf)23echo "Installing uncompressed vmlinux.elf kernel"24base=vmlinux25;;26vmlinux.efi)27echo "Installing uncompressed vmlinux.efi kernel"28base=vmlinux29;;30vmlinuz.efi)31echo "Installing gzip/zstd compressed vmlinuz.efi kernel"32base=vmlinuz33;;34*)35echo "Warning: Unexpected kernel type"36exit 137;;38esac3940if [ -f $4/$base-$1 ]; then41mv $4/$base-$1 $4/$base-$1.old42fi43cat $2 > $4/$base-$14445# Install system map file46if [ -f $4/System.map-$1 ]; then47mv $4/System.map-$1 $4/System.map-$1.old48fi49cp $3 $4/System.map-$15051# Install kernel config file52if [ -f $4/config-$1 ]; then53mv $4/config-$1 $4/config-$1.old54fi55cp .config $4/config-$1565758