Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/arch/loongarch/boot/install.sh
26424 views
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
# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
10
# Adapted from code in arch/i386/boot/install.sh by Russell King
11
#
12
# "make install" script for the LoongArch Linux port
13
#
14
# Arguments:
15
# $1 - kernel version
16
# $2 - kernel image file
17
# $3 - kernel map file
18
# $4 - default install path (blank if root directory)
19
20
set -e
21
22
case "${2##*/}" in
23
vmlinux.elf)
24
echo "Installing uncompressed vmlinux.elf kernel"
25
base=vmlinux
26
;;
27
vmlinux.efi)
28
echo "Installing uncompressed vmlinux.efi kernel"
29
base=vmlinux
30
;;
31
vmlinuz.efi)
32
echo "Installing gzip/zstd compressed vmlinuz.efi kernel"
33
base=vmlinuz
34
;;
35
*)
36
echo "Warning: Unexpected kernel type"
37
exit 1
38
;;
39
esac
40
41
if [ -f $4/$base-$1 ]; then
42
mv $4/$base-$1 $4/$base-$1.old
43
fi
44
cat $2 > $4/$base-$1
45
46
# Install system map file
47
if [ -f $4/System.map-$1 ]; then
48
mv $4/System.map-$1 $4/System.map-$1.old
49
fi
50
cp $3 $4/System.map-$1
51
52
# Install kernel config file
53
if [ -f $4/config-$1 ]; then
54
mv $4/config-$1 $4/config-$1.old
55
fi
56
cp .config $4/config-$1
57
58