* [PATCH v3 0/3] LoongArch: Adjust the 'make install' operation
@ 2025-04-24 2:40 Youling Tang
2025-04-24 2:40 ` [PATCH v3 1/3] LoongArch: Add a default install.sh Youling Tang
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Youling Tang @ 2025-04-24 2:40 UTC (permalink / raw)
To: Huacai Chen; +Cc: loongarch, linux-kernel, youling.tang
Changelog:
v3:
* Add a copy of the kernel config file.
* Some minor adjustments.
v2:
* Adjust the patch sequence.
* Adjust the title information.
* Distinguish between vmlinux.efi and vmlinux.elf in install.sh
* Correct minor mistakes.
Youling Tang (3):
LoongArch: Add a default install.sh
LoongArch: Using generic scripts/install.sh in `make install`
LoongArch: Add some annotations in archhelp
arch/loongarch/Makefile | 11 ++++---
arch/loongarch/boot/install.sh | 56 ++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+), 4 deletions(-)
create mode 100755 arch/loongarch/boot/install.sh
--
2.38.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3 1/3] LoongArch: Add a default install.sh
2025-04-24 2:40 [PATCH v3 0/3] LoongArch: Adjust the 'make install' operation Youling Tang
@ 2025-04-24 2:40 ` Youling Tang
2025-04-24 2:40 ` [PATCH v3 2/3] LoongArch: Using generic scripts/install.sh in `make install` Youling Tang
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Youling Tang @ 2025-04-24 2:40 UTC (permalink / raw)
To: Huacai Chen; +Cc: loongarch, linux-kernel, youling.tang, Youling Tang
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 is not found.
Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
---
arch/loongarch/boot/install.sh | 56 ++++++++++++++++++++++++++++++++++
1 file changed, 56 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..daac197d3315
--- /dev/null
+++ b/arch/loongarch/boot/install.sh
@@ -0,0 +1,56 @@
+#!/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
+vmlinux.elf)
+ echo "Installing uncompressed vmlinux.elf kernel"
+ base=vmlinux
+ ;;
+vmlinux.efi)
+ echo "Installing uncompressed vmlinux.efi kernel"
+ base=vmlinux
+ ;;
+vmlinuz.efi)
+ echo "Installing gzip/zstd compressed vmlinuz.efi kernel"
+ base=vmlinuz
+ ;;
+*)
+ echo "Warning: Unexpected 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
+
+# Install kernel config file
+if [ -f $4/config-$1 ]; then
+ mv $4/config-$1 $4/config-$1.old
+fi
+cp .config $4/config-$1
--
2.38.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v3 2/3] LoongArch: Using generic scripts/install.sh in `make install`
2025-04-24 2:40 [PATCH v3 0/3] LoongArch: Adjust the 'make install' operation Youling Tang
2025-04-24 2:40 ` [PATCH v3 1/3] LoongArch: Add a default install.sh Youling Tang
@ 2025-04-24 2:40 ` Youling Tang
2025-04-24 2:40 ` [PATCH v3 3/3] LoongArch: Add some annotations in archhelp Youling Tang
2025-05-17 9:31 ` [PATCH v3 0/3] LoongArch: Adjust the 'make install' operation Huacai Chen
3 siblings, 0 replies; 5+ messages in thread
From: Youling Tang @ 2025-04-24 2:40 UTC (permalink / raw)
To: Huacai Chen; +Cc: loongarch, linux-kernel, youling.tang, Youling Tang
From: Youling Tang <tangyouling@kylinos.cn>
Use the generic script/install.sh to perform the make install operation.
This will automatically generate the initrd file and modify the grub.cfg
without manual intervention (The previous kernel image, config file and
System.map will also be generated), similar to other architectures.
Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
---
arch/loongarch/Makefile | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
index 0304eabbe606..64bdb52ddf7c 100644
--- a/arch/loongarch/Makefile
+++ b/arch/loongarch/Makefile
@@ -181,9 +181,7 @@ vmlinux.elf vmlinux.efi vmlinuz.efi: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(bootvars-y) $(boot)/$@
install:
- $(Q)install -D -m 755 $(KBUILD_IMAGE) $(INSTALL_PATH)/$(image-name-y)-$(KERNELRELEASE)
- $(Q)install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE)
- $(Q)install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE)
+ $(call cmd,install)
define archhelp
echo ' install - install kernel into $(INSTALL_PATH)'
--
2.38.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v3 3/3] LoongArch: Add some annotations in archhelp
2025-04-24 2:40 [PATCH v3 0/3] LoongArch: Adjust the 'make install' operation Youling Tang
2025-04-24 2:40 ` [PATCH v3 1/3] LoongArch: Add a default install.sh Youling Tang
2025-04-24 2:40 ` [PATCH v3 2/3] LoongArch: Using generic scripts/install.sh in `make install` Youling Tang
@ 2025-04-24 2:40 ` Youling Tang
2025-05-17 9:31 ` [PATCH v3 0/3] LoongArch: Adjust the 'make install' operation Huacai Chen
3 siblings, 0 replies; 5+ messages in thread
From: Youling Tang @ 2025-04-24 2:40 UTC (permalink / raw)
To: Huacai Chen; +Cc: loongarch, linux-kernel, youling.tang, Youling Tang
From: Youling Tang <tangyouling@kylinos.cn>
- Add annotations to the kernel image.
- Modify the annotations of make insatll.
Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
---
arch/loongarch/Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
index 64bdb52ddf7c..b0703a4e02a2 100644
--- a/arch/loongarch/Makefile
+++ b/arch/loongarch/Makefile
@@ -184,6 +184,11 @@ install:
$(call cmd,install)
define archhelp
- echo ' install - install kernel into $(INSTALL_PATH)'
+ echo ' vmlinux.elf - Uncompressed ELF kernel image (arch/loongarch/boot/vmlinux.elf)'
+ echo ' vmlinux.efi - Uncompressed EFI kernel image (arch/loongarch/boot/vmlinux.efi)'
+ echo ' vmlinuz.efi - GZIP/ZSTD-compressed EFI kernel image (arch/loongarch/boot/vmlinuz.efi)'
+ echo ' Default when CONFIG_EFI_ZBOOT=y'
+ echo ' install - Install kernel using (your) ~/bin/$(INSTALLKERNEL) or'
+ echo ' (distribution) /sbin/$(INSTALLKERNEL) or install.sh to $$(INSTALL_PATH)'
echo
endef
--
2.38.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v3 0/3] LoongArch: Adjust the 'make install' operation
2025-04-24 2:40 [PATCH v3 0/3] LoongArch: Adjust the 'make install' operation Youling Tang
` (2 preceding siblings ...)
2025-04-24 2:40 ` [PATCH v3 3/3] LoongArch: Add some annotations in archhelp Youling Tang
@ 2025-05-17 9:31 ` Huacai Chen
3 siblings, 0 replies; 5+ messages in thread
From: Huacai Chen @ 2025-05-17 9:31 UTC (permalink / raw)
To: Youling Tang; +Cc: loongarch, linux-kernel
Applied, thanks.
Huacai
On Thu, Apr 24, 2025 at 10:41 AM Youling Tang <youling.tang@linux.dev> wrote:
>
> Changelog:
> v3:
> * Add a copy of the kernel config file.
> * Some minor adjustments.
>
> v2:
> * Adjust the patch sequence.
> * Adjust the title information.
> * Distinguish between vmlinux.efi and vmlinux.elf in install.sh
> * Correct minor mistakes.
>
> Youling Tang (3):
> LoongArch: Add a default install.sh
> LoongArch: Using generic scripts/install.sh in `make install`
> LoongArch: Add some annotations in archhelp
>
> arch/loongarch/Makefile | 11 ++++---
> arch/loongarch/boot/install.sh | 56 ++++++++++++++++++++++++++++++++++
> 2 files changed, 63 insertions(+), 4 deletions(-)
> create mode 100755 arch/loongarch/boot/install.sh
>
> --
> 2.38.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-05-17 9:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-24 2:40 [PATCH v3 0/3] LoongArch: Adjust the 'make install' operation Youling Tang
2025-04-24 2:40 ` [PATCH v3 1/3] LoongArch: Add a default install.sh Youling Tang
2025-04-24 2:40 ` [PATCH v3 2/3] LoongArch: Using generic scripts/install.sh in `make install` Youling Tang
2025-04-24 2:40 ` [PATCH v3 3/3] LoongArch: Add some annotations in archhelp Youling Tang
2025-05-17 9:31 ` [PATCH v3 0/3] LoongArch: Adjust the 'make install' operation Huacai Chen
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.