From: Youling Tang <youling.tang@linux.dev>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: loongarch@lists.linux.dev, youling.tang@linux.dev,
Youling Tang <tangyouling@kylinos.cn>
Subject: [PATCH v2 1/3] LoongArch: Add fallback install.sh
Date: Mon, 21 Apr 2025 13:47:42 +0800 [thread overview]
Message-ID: <20250421054744.46791-2-youling.tang@linux.dev> (raw)
In-Reply-To: <20250421054744.46791-1-youling.tang@linux.dev>
From: Youling Tang <tangyouling@kylinos.cn>
As specified in scripts/install.sh, the priority order is
as follows (from highest to lowest):
~/bin/installkernel
/sbin/installkernel
arch/loongarch/boot/install.sh
Fallback to default install.sh if installkernel not found.
Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
---
arch/loongarch/boot/install.sh | 53 ++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100755 arch/loongarch/boot/install.sh
diff --git a/arch/loongarch/boot/install.sh b/arch/loongarch/boot/install.sh
new file mode 100755
index 000000000000..7ce76810b8b7
--- /dev/null
+++ b/arch/loongarch/boot/install.sh
@@ -0,0 +1,53 @@
+#!/bin/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 the LoongArch Linux port
+#
+# Arguments:
+# $1 - kernel version
+# $2 - kernel image file
+# $3 - kernel map file
+# $4 - default install path (blank if root directory)
+
+set -e
+
+case "${2##*/}" in
+# Compressed install
+vmlinuz.efi)
+ echo "Installing compressed vmlinuz.efi kernel"
+ base=vmlinuz
+ ;;
+# Uncompressed install
+vmlinux.efi)
+ echo "Installing uncompressed vmlinux.efi kernel"
+ base=vmlinux
+ ;;
+vmlinux.elf)
+ echo "Installing uncompressed vmlinux.elf kernel"
+ base=vmlinux
+ ;;
+# Unexpected type
+*)
+ echo "Warning: Not expected kernel type"
+ exit 1
+ ;;
+esac
+
+if [ -f $4/$base-$1 ]; then
+ mv $4/$base-$1 $4/$base-$1.old
+fi
+cat $2 > $4/$base-$1
+
+# Install system map file
+if [ -f $4/System.map-$1 ]; then
+ mv $4/System.map-$1 $4/System.map-$1.old
+fi
+cp $3 $4/System.map-$1
--
2.38.1
next prev parent reply other threads:[~2025-04-21 5:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-21 5:47 [PATCH v2 0/3] LoongArch: Adjust the 'make install' operation Youling Tang
2025-04-21 5:47 ` Youling Tang [this message]
2025-04-21 5:47 ` [PATCH v2 2/3] LoongArch: Using a generic scripts/install.sh in `make install` Youling Tang
2025-04-21 5:47 ` [PATCH v2 3/3] LoongArch: Add some annotations in archhelp Youling Tang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250421054744.46791-2-youling.tang@linux.dev \
--to=youling.tang@linux.dev \
--cc=chenhuacai@kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=tangyouling@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.