All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/20] kbuild: unify the install.sh script usage
@ 2021-04-07  5:33 Greg Kroah-Hartman
  2021-04-07  5:34 ` [PATCH 01/20] kbuild: move x86 install script to scripts/install.sh Greg Kroah-Hartman
                   ` (21 more replies)
  0 siblings, 22 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:33 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	David S. Miller, James E.J. Bottomley, Albert Ou,
	Borislav Petkov, Catalin Marinas, Christian Borntraeger,
	Geert Uytterhoeven, Greentime Hu, Heiko Carstens, Helge Deller,
	Ingo Molnar, Ley Foon Tan, Michael Ellerman, Nick Hu,
	Palmer Dabbelt, Paul Walmsley, Rich Felker, Russell King,
	Thomas Gleixner, Vasily Gorbik, Vincent Chen, Will Deacon,
	Yoshinori Sato, x86

Almost every architecture has copied the "install.sh" script that
originally came with i386, and modified it in very tiny ways.  This
patch series unifies all of these scripts into one single script to
allow people to understand how to correctly install a kernel, and fixes
up some issues regarding trying to install a kernel to a path with
spaces in it.

Note that not all architectures actually seem to have any type of way to
install a kernel, they must rely on external scripts or tools which
feels odd as everything should be included here in the main repository.
I'll work on trying to figure out the missing architecture issues
afterward.

Note the cc: list here is crazy, due to touching arch-specific code in a
number of different arches in the same patch series.  I've cc:ed
individual arch maintainers on this 00/20 patch, and on their individual
arch-specific patch as well, but not the whole thing.

thanks,

greg k-h

Greg Kroah-Hartman (20):
  kbuild: move x86 install script to scripts/install.sh
  kbuild: scripts/install.sh: properly quote all variables
  kbuild: scripts/install.sh: provide a "install" function
  kbuild: scripts/install.sh: call sync before calling the bootloader
    installer
  kbuild: scripts/install.sh: prepare for arch-specific bootloaders
  kbuild: scripts/install.sh: handle compressed/uncompressed kernel
    images
  kbuild: scripts/install.sh: allow for the version number
  kbuild: riscv: use common install script
  kbuild: arm64: use common install script
  kbuild: arm: use common install script
  kbuild: ia64: use common install script
  kbuild: m68k: use common install script
  kbuild: nds32: convert to use the common install scripts
  kbuild: nios2: use common install script
  kbuild: parisc: use common install script
  kbuild: powerpc: use common install script
  kbuild: s390: use common install script
  kbuild: sh: remove unused install script
  kbuild: sparc: use common install script
  kbuild: scripts/install.sh: update documentation

 arch/arm/boot/Makefile             |   6 +-
 arch/arm/boot/install.sh           |  66 --------------
 arch/arm64/boot/Makefile           |   4 +-
 arch/arm64/boot/install.sh         |  60 -------------
 arch/ia64/Makefile                 |   2 +-
 arch/ia64/install.sh               |  40 ---------
 arch/m68k/Makefile                 |   2 +-
 arch/m68k/install.sh               |  52 -----------
 arch/nds32/boot/Makefile           |   4 +-
 arch/nios2/boot/Makefile           |   2 +-
 arch/nios2/boot/install.sh         |  52 -----------
 arch/parisc/Makefile               |   4 +-
 arch/parisc/boot/Makefile          |   2 +-
 arch/parisc/boot/install.sh        |  65 --------------
 arch/parisc/install.sh             |  66 --------------
 arch/powerpc/boot/Makefile         |   4 +-
 arch/powerpc/boot/install.sh       |  55 ------------
 arch/riscv/boot/Makefile           |   4 +-
 arch/riscv/boot/install.sh         |  60 -------------
 arch/s390/boot/Makefile            |   2 +-
 arch/s390/boot/install.sh          |  30 -------
 arch/sh/boot/compressed/install.sh |  56 ------------
 arch/sparc/boot/Makefile           |   2 +-
 arch/sparc/boot/install.sh         |  50 -----------
 arch/x86/boot/Makefile             |   2 +-
 arch/x86/boot/install.sh           |  59 -------------
 scripts/install.sh                 | 136 +++++++++++++++++++++++++++++
 27 files changed, 156 insertions(+), 731 deletions(-)
 delete mode 100644 arch/arm/boot/install.sh
 delete mode 100644 arch/arm64/boot/install.sh
 delete mode 100644 arch/ia64/install.sh
 delete mode 100644 arch/m68k/install.sh
 delete mode 100644 arch/nios2/boot/install.sh
 delete mode 100644 arch/parisc/boot/install.sh
 delete mode 100644 arch/parisc/install.sh
 delete mode 100644 arch/powerpc/boot/install.sh
 delete mode 100644 arch/riscv/boot/install.sh
 delete mode 100644 arch/s390/boot/install.sh
 delete mode 100644 arch/sh/boot/compressed/install.sh
 delete mode 100644 arch/sparc/boot/install.sh
 delete mode 100644 arch/x86/boot/install.sh
 create mode 100644 scripts/install.sh


base-commit: e49d033bddf5b565044e2abe4241353959bc9120
-- 
2.31.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH 01/20] kbuild: move x86 install script to scripts/install.sh
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-09  3:08   ` Kees Cook
  2021-04-07  5:34 ` [PATCH 02/20] kbuild: scripts/install.sh: properly quote all variables Greg Kroah-Hartman
                   ` (20 subsequent siblings)
  21 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86

To unify the different architecture kernel installation scripts, start
out with the one they all were based on, the x86 script.  Move it from
arch/x86/boot/ into scripts/ so that all architectures can call it in
the future.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/x86/boot/Makefile                | 2 +-
 {arch/x86/boot => scripts}/install.sh | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename {arch/x86/boot => scripts}/install.sh (100%)

diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index fe605205b4ce..17c7718c1a4a 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -157,5 +157,5 @@ bzlilo:
 	if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
 
 install:
-	sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
+	sh $(srctree)/scripts/install.sh $(KERNELRELEASE) $(obj)/bzImage \
 		System.map "$(INSTALL_PATH)"
diff --git a/arch/x86/boot/install.sh b/scripts/install.sh
similarity index 100%
rename from arch/x86/boot/install.sh
rename to scripts/install.sh
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 02/20] kbuild: scripts/install.sh: properly quote all variables
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
  2021-04-07  5:34 ` [PATCH 01/20] kbuild: move x86 install script to scripts/install.sh Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-07 10:59   ` Masahiro Yamada
  2021-04-07  5:34 ` [PATCH 03/20] kbuild: scripts/install.sh: provide a "install" function Greg Kroah-Hartman
                   ` (19 subsequent siblings)
  21 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman

A few variables are quoted to handle spaces in directory names, but not
all of them.  Properly quote everything so that the kernel build can
handle working correctly with directory names with spaces.

This change makes the script "shellcheck" clean now.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 scripts/install.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/scripts/install.sh b/scripts/install.sh
index d13ec1c38640..c183d6ddd00c 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -33,21 +33,21 @@ verify "$3"
 
 # User may have a custom install script
 
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
+if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi
+if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
 
 # Default install - same as make zlilo
 
-if [ -f $4/vmlinuz ]; then
-	mv $4/vmlinuz $4/vmlinuz.old
+if [ -f "$4"/vmlinuz ]; then
+	mv "$4"/vmlinuz "$4"/vmlinuz.old
 fi
 
-if [ -f $4/System.map ]; then
-	mv $4/System.map $4/System.old
+if [ -f "$4"/System.map ]; then
+	mv "$4"/System.map "$4"/System.old
 fi
 
-cat $2 > $4/vmlinuz
-cp $3 $4/System.map
+cat "$2" > "$4"/vmlinuz
+cp "$3" "$4"/System.map
 
 if [ -x /sbin/lilo ]; then
        /sbin/lilo
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 03/20] kbuild: scripts/install.sh: provide a "install" function
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
  2021-04-07  5:34 ` [PATCH 01/20] kbuild: move x86 install script to scripts/install.sh Greg Kroah-Hartman
  2021-04-07  5:34 ` [PATCH 02/20] kbuild: scripts/install.sh: properly quote all variables Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-07 11:01   ` Masahiro Yamada
  2021-04-07  5:34 ` [PATCH 04/20] kbuild: scripts/install.sh: call sync before calling the bootloader installer Greg Kroah-Hartman
                   ` (18 subsequent siblings)
  21 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman

Instead of open-coding the "test for file, if present make a backup,
then copy the file to the new location" in multiple places, make a
single function, install(), to do all of this in one place.

Note, this does change the default x86 kernel map file saved name from
"System.old" to "System.map.old".  This brings it into unification with
the other architectures as to what they call their backup file for the
kernel map file.  As this is a text file, and nothing parses this from a
backup file, there should not be any operational differences.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 scripts/install.sh | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/scripts/install.sh b/scripts/install.sh
index c183d6ddd00c..af36c0a82f01 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -27,6 +27,19 @@ verify () {
  	fi
 }
 
+install () {
+	install_source=${1}
+	install_target=${2}
+
+	echo "installing '${install_source}' to '${install_target}'"
+
+	# if the target is already present, move it to a .old filename
+	if [ -f "${install_target}" ]; then
+		mv "${install_target}" "${install_target}".old
+	fi
+	cat "${install_source}" > "${install_target}"
+}
+
 # Make sure the files actually exist
 verify "$2"
 verify "$3"
@@ -37,17 +50,8 @@ if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi
 if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
 
 # Default install - same as make zlilo
-
-if [ -f "$4"/vmlinuz ]; then
-	mv "$4"/vmlinuz "$4"/vmlinuz.old
-fi
-
-if [ -f "$4"/System.map ]; then
-	mv "$4"/System.map "$4"/System.old
-fi
-
-cat "$2" > "$4"/vmlinuz
-cp "$3" "$4"/System.map
+install "$2" "$4"/vmlinuz
+install "$3" "$4"/System.map
 
 if [ -x /sbin/lilo ]; then
        /sbin/lilo
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 04/20] kbuild: scripts/install.sh: call sync before calling the bootloader installer
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2021-04-07  5:34 ` [PATCH 03/20] kbuild: scripts/install.sh: provide a "install" function Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-07 11:03   ` Masahiro Yamada
  2021-04-07  5:34 ` [PATCH 05/20] kbuild: scripts/install.sh: prepare for arch-specific bootloaders Greg Kroah-Hartman
                   ` (17 subsequent siblings)
  21 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman

It's good to ensure that the files are written out before calling the
bootloader installer, as other architectures do, so call sync after
doing the copying of the kernel and system map files.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 scripts/install.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/install.sh b/scripts/install.sh
index af36c0a82f01..92d0d2ade414 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -52,12 +52,12 @@ if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
 # Default install - same as make zlilo
 install "$2" "$4"/vmlinuz
 install "$3" "$4"/System.map
+sync
 
 if [ -x /sbin/lilo ]; then
        /sbin/lilo
 elif [ -x /etc/lilo/install ]; then
        /etc/lilo/install
 else
-       sync
        echo "Cannot find LILO."
 fi
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 05/20] kbuild: scripts/install.sh: prepare for arch-specific bootloaders
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (3 preceding siblings ...)
  2021-04-07  5:34 ` [PATCH 04/20] kbuild: scripts/install.sh: call sync before calling the bootloader installer Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-09  3:08   ` Kees Cook
  2021-04-07  5:34 ` [PATCH 06/20] kbuild: scripts/install.sh: handle compressed/uncompressed kernel images Greg Kroah-Hartman
                   ` (16 subsequent siblings)
  21 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman

Despite the last release of LILO being in 2015, it seems that it is
still the default x86 bootloader and wants to be called to "install" the
new kernel image when it has been replaced on the disk.  To allow
arch-specific programs like this to be called in future changes, move
the logic to an arch-specific test now.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 scripts/install.sh | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/scripts/install.sh b/scripts/install.sh
index 92d0d2ade414..2adcb993efa2 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -54,10 +54,15 @@ install "$2" "$4"/vmlinuz
 install "$3" "$4"/System.map
 sync
 
-if [ -x /sbin/lilo ]; then
-       /sbin/lilo
-elif [ -x /etc/lilo/install ]; then
-       /etc/lilo/install
-else
-       echo "Cannot find LILO."
-fi
+# Some architectures like to call specific bootloader "helper" programs:
+case "${ARCH}" in
+	x86)
+		if [ -x /sbin/lilo ]; then
+			/sbin/lilo
+		elif [ -x /etc/lilo/install ]; then
+			/etc/lilo/install
+		else
+			echo "Cannot find LILO."
+		fi
+		;;
+esac
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 06/20] kbuild: scripts/install.sh: handle compressed/uncompressed kernel images
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (4 preceding siblings ...)
  2021-04-07  5:34 ` [PATCH 05/20] kbuild: scripts/install.sh: prepare for arch-specific bootloaders Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-07 11:04   ` Masahiro Yamada
  2021-04-07  5:34 ` [PATCH 07/20] kbuild: scripts/install.sh: allow for the version number Greg Kroah-Hartman
                   ` (15 subsequent siblings)
  21 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman

For x86, the default kernel image is compressed, but other architectures
allowed both compressed and uncompressed kernel images to be built.  Add
a test to detect which one this is, and either name the output file
"vmlinuz" for a compressed image, or "vmlinux" for an uncompressed
image.

For x86 this change is a no-op, but other architectures depend on this.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 scripts/install.sh | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/scripts/install.sh b/scripts/install.sh
index 2adcb993efa2..72dc4c81013e 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -49,8 +49,18 @@ verify "$3"
 if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi
 if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
 
-# Default install - same as make zlilo
-install "$2" "$4"/vmlinuz
+base=$(basename "$2")
+if [ "$base" = "bzImage" ]; then
+	# Compressed install
+	echo "Installing compressed kernel"
+	base=vmlinuz
+else
+	# Normal install
+	echo "Installing normal kernel"
+	base=vmlinux
+fi
+
+install "$2" "$4"/"$base"
 install "$3" "$4"/System.map
 sync
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 07/20] kbuild: scripts/install.sh: allow for the version number
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (5 preceding siblings ...)
  2021-04-07  5:34 ` [PATCH 06/20] kbuild: scripts/install.sh: handle compressed/uncompressed kernel images Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-07 11:05   ` Masahiro Yamada
  2021-04-07  5:34   ` Greg Kroah-Hartman
                   ` (14 subsequent siblings)
  21 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman

Some architectures put the version number by default at the end of the
files that are copied, so add support for this to be set by arch type.

Odds are one day we should change this for x86, but let's not break
anyone's systems just yet.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 scripts/install.sh | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/scripts/install.sh b/scripts/install.sh
index 72dc4c81013e..934619f81119 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -60,8 +60,19 @@ else
 	base=vmlinux
 fi
 
-install "$2" "$4"/"$base"
-install "$3" "$4"/System.map
+# Some architectures name their files based on version number, and
+# others do not.  Call out the ones that do not to make it obvious.
+case "${ARCH}" in
+	x86)
+		version=""
+		;;
+	*)
+		version="-${1}"
+		;;
+esac
+
+install "$2" "$4"/"$base""$version"
+install "$3" "$4"/System.map"$version"
 sync
 
 # Some architectures like to call specific bootloader "helper" programs:
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 08/20] kbuild: riscv: use common install script
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
@ 2021-04-07  5:34   ` Greg Kroah-Hartman
  2021-04-07  5:34 ` [PATCH 02/20] kbuild: scripts/install.sh: properly quote all variables Greg Kroah-Hartman
                     ` (20 subsequent siblings)
  21 siblings, 0 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv

The common scripts/install.sh script will now work for riscv, all that
is needed is to add the compressed image type to it.  So add that file
type check and remove the riscv-only version of the file.

Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: linux-riscv@lists.infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/riscv/boot/Makefile   |  4 +--
 arch/riscv/boot/install.sh | 60 --------------------------------------
 scripts/install.sh         |  3 +-
 3 files changed, 4 insertions(+), 63 deletions(-)
 delete mode 100644 arch/riscv/boot/install.sh

diff --git a/arch/riscv/boot/Makefile b/arch/riscv/boot/Makefile
index 03404c84f971..4ba33aec4ccb 100644
--- a/arch/riscv/boot/Makefile
+++ b/arch/riscv/boot/Makefile
@@ -47,9 +47,9 @@ $(obj)/loader.bin: $(obj)/loader FORCE
 	$(call if_changed,objcopy)
 
 install:
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \
 	$(obj)/Image System.map "$(INSTALL_PATH)"
 
 zinstall:
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \
 	$(obj)/Image.gz System.map "$(INSTALL_PATH)"
diff --git a/arch/riscv/boot/install.sh b/arch/riscv/boot/install.sh
deleted file mode 100644
index 18c39159c0ff..000000000000
--- a/arch/riscv/boot/install.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-#
-# arch/riscv/boot/install.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 RISC-V Linux port
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#
-
-verify () {
-	if [ ! -f "$1" ]; then
-		echo ""                                                   1>&2
-		echo " *** Missing file: $1"                              1>&2
-		echo ' *** You need to run "make" before "make install".' 1>&2
-		echo ""                                                   1>&2
-		exit 1
-	fi
-}
-
-# Make sure the files actually exist
-verify "$2"
-verify "$3"
-
-# User may have a custom install script
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-
-if [ "$(basename $2)" = "Image.gz" ]; then
-# Compressed install
-  echo "Installing compressed kernel"
-  base=vmlinuz
-else
-# Normal install
-  echo "Installing normal kernel"
-  base=vmlinux
-fi
-
-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
diff --git a/scripts/install.sh b/scripts/install.sh
index 934619f81119..9c8a22d96255 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -50,7 +50,8 @@ if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi
 if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
 
 base=$(basename "$2")
-if [ "$base" = "bzImage" ]; then
+if [ "$base" = "bzImage" ] ||
+   [ "$base" = "Image.gz" ] ; then
 	# Compressed install
 	echo "Installing compressed kernel"
 	base=vmlinuz
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 08/20] kbuild: riscv: use common install script
@ 2021-04-07  5:34   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv

The common scripts/install.sh script will now work for riscv, all that
is needed is to add the compressed image type to it.  So add that file
type check and remove the riscv-only version of the file.

Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: linux-riscv@lists.infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/riscv/boot/Makefile   |  4 +--
 arch/riscv/boot/install.sh | 60 --------------------------------------
 scripts/install.sh         |  3 +-
 3 files changed, 4 insertions(+), 63 deletions(-)
 delete mode 100644 arch/riscv/boot/install.sh

diff --git a/arch/riscv/boot/Makefile b/arch/riscv/boot/Makefile
index 03404c84f971..4ba33aec4ccb 100644
--- a/arch/riscv/boot/Makefile
+++ b/arch/riscv/boot/Makefile
@@ -47,9 +47,9 @@ $(obj)/loader.bin: $(obj)/loader FORCE
 	$(call if_changed,objcopy)
 
 install:
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \
 	$(obj)/Image System.map "$(INSTALL_PATH)"
 
 zinstall:
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \
 	$(obj)/Image.gz System.map "$(INSTALL_PATH)"
diff --git a/arch/riscv/boot/install.sh b/arch/riscv/boot/install.sh
deleted file mode 100644
index 18c39159c0ff..000000000000
--- a/arch/riscv/boot/install.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-#
-# arch/riscv/boot/install.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 RISC-V Linux port
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#
-
-verify () {
-	if [ ! -f "$1" ]; then
-		echo ""                                                   1>&2
-		echo " *** Missing file: $1"                              1>&2
-		echo ' *** You need to run "make" before "make install".' 1>&2
-		echo ""                                                   1>&2
-		exit 1
-	fi
-}
-
-# Make sure the files actually exist
-verify "$2"
-verify "$3"
-
-# User may have a custom install script
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-
-if [ "$(basename $2)" = "Image.gz" ]; then
-# Compressed install
-  echo "Installing compressed kernel"
-  base=vmlinuz
-else
-# Normal install
-  echo "Installing normal kernel"
-  base=vmlinux
-fi
-
-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
diff --git a/scripts/install.sh b/scripts/install.sh
index 934619f81119..9c8a22d96255 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -50,7 +50,8 @@ if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi
 if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
 
 base=$(basename "$2")
-if [ "$base" = "bzImage" ]; then
+if [ "$base" = "bzImage" ] ||
+   [ "$base" = "Image.gz" ] ; then
 	# Compressed install
 	echo "Installing compressed kernel"
 	base=vmlinuz
-- 
2.31.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 09/20] kbuild: arm64: use common install script
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
@ 2021-04-07  5:34   ` Greg Kroah-Hartman
  2021-04-07  5:34 ` [PATCH 02/20] kbuild: scripts/install.sh: properly quote all variables Greg Kroah-Hartman
                     ` (20 subsequent siblings)
  21 siblings, 0 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	Catalin Marinas, Will Deacon, linux-arm-kernel

The common scripts/install.sh script will now work for arm65, no changes
needed so convert the arm64 boot Makefile to call it instead of the
arm64-only version of the file and remove the now unused file.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm64/boot/Makefile   |  4 +--
 arch/arm64/boot/install.sh | 60 --------------------------------------
 2 files changed, 2 insertions(+), 62 deletions(-)
 delete mode 100644 arch/arm64/boot/install.sh

diff --git a/arch/arm64/boot/Makefile b/arch/arm64/boot/Makefile
index cd3414898d10..08c56332dde2 100644
--- a/arch/arm64/boot/Makefile
+++ b/arch/arm64/boot/Makefile
@@ -37,9 +37,9 @@ $(obj)/Image.lzo: $(obj)/Image FORCE
 	$(call if_changed,lzo)
 
 install:
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \
 	$(obj)/Image System.map "$(INSTALL_PATH)"
 
 zinstall:
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \
 	$(obj)/Image.gz System.map "$(INSTALL_PATH)"
diff --git a/arch/arm64/boot/install.sh b/arch/arm64/boot/install.sh
deleted file mode 100644
index d91e1f022573..000000000000
--- a/arch/arm64/boot/install.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-#
-# arch/arm64/boot/install.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 AArch64 Linux port
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#
-
-verify () {
-	if [ ! -f "$1" ]; then
-		echo ""                                                   1>&2
-		echo " *** Missing file: $1"                              1>&2
-		echo ' *** You need to run "make" before "make install".' 1>&2
-		echo ""                                                   1>&2
-		exit 1
-	fi
-}
-
-# Make sure the files actually exist
-verify "$2"
-verify "$3"
-
-# User may have a custom install script
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-
-if [ "$(basename $2)" = "Image.gz" ]; then
-# Compressed install
-  echo "Installing compressed kernel"
-  base=vmlinuz
-else
-# Normal install
-  echo "Installing normal kernel"
-  base=vmlinux
-fi
-
-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.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 09/20] kbuild: arm64: use common install script
@ 2021-04-07  5:34   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	Catalin Marinas, Will Deacon, linux-arm-kernel

The common scripts/install.sh script will now work for arm65, no changes
needed so convert the arm64 boot Makefile to call it instead of the
arm64-only version of the file and remove the now unused file.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm64/boot/Makefile   |  4 +--
 arch/arm64/boot/install.sh | 60 --------------------------------------
 2 files changed, 2 insertions(+), 62 deletions(-)
 delete mode 100644 arch/arm64/boot/install.sh

diff --git a/arch/arm64/boot/Makefile b/arch/arm64/boot/Makefile
index cd3414898d10..08c56332dde2 100644
--- a/arch/arm64/boot/Makefile
+++ b/arch/arm64/boot/Makefile
@@ -37,9 +37,9 @@ $(obj)/Image.lzo: $(obj)/Image FORCE
 	$(call if_changed,lzo)
 
 install:
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \
 	$(obj)/Image System.map "$(INSTALL_PATH)"
 
 zinstall:
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \
 	$(obj)/Image.gz System.map "$(INSTALL_PATH)"
diff --git a/arch/arm64/boot/install.sh b/arch/arm64/boot/install.sh
deleted file mode 100644
index d91e1f022573..000000000000
--- a/arch/arm64/boot/install.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-#
-# arch/arm64/boot/install.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 AArch64 Linux port
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#
-
-verify () {
-	if [ ! -f "$1" ]; then
-		echo ""                                                   1>&2
-		echo " *** Missing file: $1"                              1>&2
-		echo ' *** You need to run "make" before "make install".' 1>&2
-		echo ""                                                   1>&2
-		exit 1
-	fi
-}
-
-# Make sure the files actually exist
-verify "$2"
-verify "$3"
-
-# User may have a custom install script
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-
-if [ "$(basename $2)" = "Image.gz" ]; then
-# Compressed install
-  echo "Installing compressed kernel"
-  base=vmlinuz
-else
-# Normal install
-  echo "Installing normal kernel"
-  base=vmlinux
-fi
-
-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.31.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 10/20] kbuild: arm: use common install script
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
@ 2021-04-07  5:34   ` Greg Kroah-Hartman
  2021-04-07  5:34 ` [PATCH 02/20] kbuild: scripts/install.sh: properly quote all variables Greg Kroah-Hartman
                     ` (20 subsequent siblings)
  21 siblings, 0 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	Russell King, linux-arm-kernel

The common scripts/install.sh script will now work for arm, all that
is needed is to add the compressed image type to it.  So add that file
type check and the ability to call /sbin/loadmap after copying the
kernel.  With that we can remove the arm-only version of the file.

Cc: Russell King <linux@armlinux.org.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm/boot/Makefile   |  6 ++--
 arch/arm/boot/install.sh | 66 ----------------------------------------
 scripts/install.sh       | 10 +++++-
 3 files changed, 12 insertions(+), 70 deletions(-)
 delete mode 100644 arch/arm/boot/install.sh

diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index 0b3cd7a33a26..053187f0b714 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -104,15 +104,15 @@ initrd:
 	(echo You must specify INITRD; exit -1)
 
 install:
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh "$(KERNELRELEASE)" \
 	$(obj)/Image System.map "$(INSTALL_PATH)"
 
 zinstall:
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh "$(KERNELRELEASE)" \
 	$(obj)/zImage System.map "$(INSTALL_PATH)"
 
 uinstall:
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh "$(KERNELRELEASE)" \
 	$(obj)/uImage System.map "$(INSTALL_PATH)"
 
 subdir-	    := bootp compressed dts
diff --git a/arch/arm/boot/install.sh b/arch/arm/boot/install.sh
deleted file mode 100644
index 2a45092a40e3..000000000000
--- a/arch/arm/boot/install.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-#
-# arch/arm/boot/install.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 arm architecture
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#
-
-verify () {
-	if [ ! -f "$1" ]; then
-		echo ""                                                   1>&2
-		echo " *** Missing file: $1"                              1>&2
-		echo ' *** You need to run "make" before "make install".' 1>&2
-		echo ""                                                   1>&2
-		exit 1
-	fi
-}
-
-# Make sure the files actually exist
-verify "$2"
-verify "$3"
-
-# User may have a custom install script
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-
-if [ "$(basename $2)" = "zImage" ]; then
-# Compressed install
-  echo "Installing compressed kernel"
-  base=vmlinuz
-else
-# Normal install
-  echo "Installing normal kernel"
-  base=vmlinux
-fi
-
-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
-
-if [ -x /sbin/loadmap ]; then
-  /sbin/loadmap
-else
-  echo "You have to install it yourself"
-fi
diff --git a/scripts/install.sh b/scripts/install.sh
index 9c8a22d96255..73067b535ea0 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -51,7 +51,8 @@ if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
 
 base=$(basename "$2")
 if [ "$base" = "bzImage" ] ||
-   [ "$base" = "Image.gz" ] ; then
+   [ "$base" = "Image.gz" ] ||
+   [ "$base" = "zImage" ] ; then
 	# Compressed install
 	echo "Installing compressed kernel"
 	base=vmlinuz
@@ -78,6 +79,13 @@ sync
 
 # Some architectures like to call specific bootloader "helper" programs:
 case "${ARCH}" in
+	arm)
+		if [ -x /sbin/loadmap ]; then
+			/sbin/loadmap
+		else
+			echo "You have to install it yourself"
+		fi
+		;;
 	x86)
 		if [ -x /sbin/lilo ]; then
 			/sbin/lilo
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 10/20] kbuild: arm: use common install script
@ 2021-04-07  5:34   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	Russell King, linux-arm-kernel

The common scripts/install.sh script will now work for arm, all that
is needed is to add the compressed image type to it.  So add that file
type check and the ability to call /sbin/loadmap after copying the
kernel.  With that we can remove the arm-only version of the file.

Cc: Russell King <linux@armlinux.org.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm/boot/Makefile   |  6 ++--
 arch/arm/boot/install.sh | 66 ----------------------------------------
 scripts/install.sh       | 10 +++++-
 3 files changed, 12 insertions(+), 70 deletions(-)
 delete mode 100644 arch/arm/boot/install.sh

diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index 0b3cd7a33a26..053187f0b714 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -104,15 +104,15 @@ initrd:
 	(echo You must specify INITRD; exit -1)
 
 install:
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh "$(KERNELRELEASE)" \
 	$(obj)/Image System.map "$(INSTALL_PATH)"
 
 zinstall:
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh "$(KERNELRELEASE)" \
 	$(obj)/zImage System.map "$(INSTALL_PATH)"
 
 uinstall:
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh "$(KERNELRELEASE)" \
 	$(obj)/uImage System.map "$(INSTALL_PATH)"
 
 subdir-	    := bootp compressed dts
diff --git a/arch/arm/boot/install.sh b/arch/arm/boot/install.sh
deleted file mode 100644
index 2a45092a40e3..000000000000
--- a/arch/arm/boot/install.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-#
-# arch/arm/boot/install.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 arm architecture
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#
-
-verify () {
-	if [ ! -f "$1" ]; then
-		echo ""                                                   1>&2
-		echo " *** Missing file: $1"                              1>&2
-		echo ' *** You need to run "make" before "make install".' 1>&2
-		echo ""                                                   1>&2
-		exit 1
-	fi
-}
-
-# Make sure the files actually exist
-verify "$2"
-verify "$3"
-
-# User may have a custom install script
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-
-if [ "$(basename $2)" = "zImage" ]; then
-# Compressed install
-  echo "Installing compressed kernel"
-  base=vmlinuz
-else
-# Normal install
-  echo "Installing normal kernel"
-  base=vmlinux
-fi
-
-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
-
-if [ -x /sbin/loadmap ]; then
-  /sbin/loadmap
-else
-  echo "You have to install it yourself"
-fi
diff --git a/scripts/install.sh b/scripts/install.sh
index 9c8a22d96255..73067b535ea0 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -51,7 +51,8 @@ if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
 
 base=$(basename "$2")
 if [ "$base" = "bzImage" ] ||
-   [ "$base" = "Image.gz" ] ; then
+   [ "$base" = "Image.gz" ] ||
+   [ "$base" = "zImage" ] ; then
 	# Compressed install
 	echo "Installing compressed kernel"
 	base=vmlinuz
@@ -78,6 +79,13 @@ sync
 
 # Some architectures like to call specific bootloader "helper" programs:
 case "${ARCH}" in
+	arm)
+		if [ -x /sbin/loadmap ]; then
+			/sbin/loadmap
+		else
+			echo "You have to install it yourself"
+		fi
+		;;
 	x86)
 		if [ -x /sbin/lilo ]; then
 			/sbin/lilo
-- 
2.31.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 11/20] kbuild: ia64: use common install script
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (9 preceding siblings ...)
  2021-04-07  5:34   ` Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-07 18:02   ` Sergei Trofimovich
  2021-04-09  3:10   ` Kees Cook
  2021-04-07  5:34 ` [PATCH 12/20] kbuild: m68k: " Greg Kroah-Hartman
                   ` (10 subsequent siblings)
  21 siblings, 2 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman, linux-ia64

The common scripts/install.sh script will now work for ia64, all that
is needed is to add the compressed image type to it.  So add that file
type check and the ability to call /usr/sbin/elilo after copying the
kernel.  With that we can remove the ia64-only version of the file.

Cc: linux-ia64@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/ia64/Makefile   |  2 +-
 arch/ia64/install.sh | 40 ----------------------------------------
 scripts/install.sh   |  8 +++++++-
 3 files changed, 8 insertions(+), 42 deletions(-)
 delete mode 100644 arch/ia64/install.sh

diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
index 467b7e7f967c..19e20e99f487 100644
--- a/arch/ia64/Makefile
+++ b/arch/ia64/Makefile
@@ -77,7 +77,7 @@ archheaders:
 CLEAN_FILES += vmlinux.gz
 
 install: vmlinux.gz
-	sh $(srctree)/arch/ia64/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
+	sh $(srctree)/scripts/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
 
 define archhelp
   echo '* compressed	- Build compressed kernel image'
diff --git a/arch/ia64/install.sh b/arch/ia64/install.sh
deleted file mode 100644
index 0e932f5dcd1a..000000000000
--- a/arch/ia64/install.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-#
-# arch/ia64/install.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
-#
-# "make install" script for ia64 architecture
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#
-
-# User may have a custom install script
-
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-
-# Default install - same as make zlilo
-
-if [ -f $4/vmlinuz ]; then
-	mv $4/vmlinuz $4/vmlinuz.old
-fi
-
-if [ -f $4/System.map ]; then
-	mv $4/System.map $4/System.old
-fi
-
-cat $2 > $4/vmlinuz
-cp $3 $4/System.map
-
-test -x /usr/sbin/elilo && /usr/sbin/elilo
diff --git a/scripts/install.sh b/scripts/install.sh
index 73067b535ea0..b6ca2a0f0983 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -52,6 +52,7 @@ if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
 base=$(basename "$2")
 if [ "$base" = "bzImage" ] ||
    [ "$base" = "Image.gz" ] ||
+   [ "$base" = "vmlinux.gz" ] ||
    [ "$base" = "zImage" ] ; then
 	# Compressed install
 	echo "Installing compressed kernel"
@@ -65,7 +66,7 @@ fi
 # Some architectures name their files based on version number, and
 # others do not.  Call out the ones that do not to make it obvious.
 case "${ARCH}" in
-	x86)
+	ia64 | x86)
 		version=""
 		;;
 	*)
@@ -86,6 +87,11 @@ case "${ARCH}" in
 			echo "You have to install it yourself"
 		fi
 		;;
+	ia64)
+		if [ -x /usr/sbin/elilo ]; then
+			/usr/sbin/elilo
+		fi
+		;;
 	x86)
 		if [ -x /sbin/lilo ]; then
 			/sbin/lilo
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 12/20] kbuild: m68k: use common install script
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (10 preceding siblings ...)
  2021-04-07  5:34 ` [PATCH 11/20] kbuild: ia64: " Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-07  7:19   ` Geert Uytterhoeven
  2021-04-09  3:10   ` Kees Cook
  2021-04-07  5:34 ` [PATCH 13/20] kbuild: nds32: convert to use the common install scripts Greg Kroah-Hartman
                   ` (9 subsequent siblings)
  21 siblings, 2 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	Geert Uytterhoeven, linux-m68k

The common scripts/install.sh script will now work for m68k, all that
is needed is to add it to the list of arches that do not put the version
number in the installed file name.

With that we can remove the m68k-only version of the install script.

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/m68k/Makefile   |  2 +-
 arch/m68k/install.sh | 52 --------------------------------------------
 scripts/install.sh   |  2 +-
 3 files changed, 2 insertions(+), 54 deletions(-)
 delete mode 100644 arch/m68k/install.sh

diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index ea14f2046fb4..e56abf79c313 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -143,4 +143,4 @@ archheaders:
 	$(Q)$(MAKE) $(build)=arch/m68k/kernel/syscalls all
 
 install:
-	sh $(srctree)/arch/m68k/install.sh $(KERNELRELEASE) vmlinux.gz System.map "$(INSTALL_PATH)"
+	sh $(srctree)/scripts/install.sh $(KERNELRELEASE) vmlinux.gz System.map "$(INSTALL_PATH)"
diff --git a/arch/m68k/install.sh b/arch/m68k/install.sh
deleted file mode 100644
index 57d640d4382c..000000000000
--- a/arch/m68k/install.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/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
-#
-# "make install" script for m68k architecture
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#
-
-verify () {
-	if [ ! -f "$1" ]; then
-		echo ""                                                   1>&2
-		echo " *** Missing file: $1"                              1>&2
-		echo ' *** You need to run "make" before "make install".' 1>&2
-		echo ""                                                   1>&2
-		exit 1
-	fi
-}
-
-# Make sure the files actually exist
-verify "$2"
-verify "$3"
-
-# User may have a custom install script
-
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-
-# Default install - same as make zlilo
-
-if [ -f $4/vmlinuz ]; then
-	mv $4/vmlinuz $4/vmlinuz.old
-fi
-
-if [ -f $4/System.map ]; then
-	mv $4/System.map $4/System.old
-fi
-
-cat $2 > $4/vmlinuz
-cp $3 $4/System.map
-
-sync
diff --git a/scripts/install.sh b/scripts/install.sh
index b6ca2a0f0983..a61a5ce28cad 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -66,7 +66,7 @@ fi
 # Some architectures name their files based on version number, and
 # others do not.  Call out the ones that do not to make it obvious.
 case "${ARCH}" in
-	ia64 | x86)
+	ia64 | m68k | x86)
 		version=""
 		;;
 	*)
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 13/20] kbuild: nds32: convert to use the common install scripts
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (11 preceding siblings ...)
  2021-04-07  5:34 ` [PATCH 12/20] kbuild: m68k: " Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-07 11:20   ` Masahiro Yamada
  2021-04-07  5:34 ` [PATCH 14/20] kbuild: nios2: use common install script Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  21 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	Nick Hu, Greentime Hu, Vincent Chen

It seems that no one ever checked in the nds32 install script so trying
to build a nds32 kernel would never quite work properly as 'make
install' would fail to run.

Fix that up by having nds32 call the common install.sh script.

Cc: Nick Hu <nickhu@andestech.com>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Vincent Chen <deanbo422@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/nds32/boot/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/nds32/boot/Makefile b/arch/nds32/boot/Makefile
index c4cc0c2689f7..8371e02f6091 100644
--- a/arch/nds32/boot/Makefile
+++ b/arch/nds32/boot/Makefile
@@ -8,9 +8,9 @@ $(obj)/Image.gz: $(obj)/Image FORCE
 	$(call if_changed,gzip)
 
 install: $(obj)/Image
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \
 	$(obj)/Image System.map "$(INSTALL_PATH)"
 
 zinstall: $(obj)/Image.gz
-	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \
 	$(obj)/Image.gz System.map "$(INSTALL_PATH)"
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 14/20] kbuild: nios2: use common install script
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (12 preceding siblings ...)
  2021-04-07  5:34 ` [PATCH 13/20] kbuild: nds32: convert to use the common install scripts Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-09  3:09   ` Kees Cook
  2021-04-07  5:34 ` [PATCH 15/20] kbuild: parisc: " Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  21 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman, Ley Foon Tan

The common scripts/install.sh script will now work for nios2, all that
is needed is to add it to the list of arches that do not put the version
number in the installed file name.

With that we can remove the nios2-only version of the install script.

Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/nios2/boot/Makefile   |  2 +-
 arch/nios2/boot/install.sh | 52 --------------------------------------
 scripts/install.sh         |  2 +-
 3 files changed, 2 insertions(+), 54 deletions(-)
 delete mode 100644 arch/nios2/boot/install.sh

diff --git a/arch/nios2/boot/Makefile b/arch/nios2/boot/Makefile
index 37dfc7e584bc..b8d8a3be156a 100644
--- a/arch/nios2/boot/Makefile
+++ b/arch/nios2/boot/Makefile
@@ -32,4 +32,4 @@ $(obj)/compressed/vmlinux: $(obj)/vmlinux.gz FORCE
 	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
 
 install:
-	sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
+	sh $(srctree)/scripts/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
diff --git a/arch/nios2/boot/install.sh b/arch/nios2/boot/install.sh
deleted file mode 100644
index 3cb3f468bc51..000000000000
--- a/arch/nios2/boot/install.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/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
-#
-# "make install" script for nios2 architecture
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#
-
-verify () {
-	if [ ! -f "$1" ]; then
-		echo ""                                                   1>&2
-		echo " *** Missing file: $1"                              1>&2
-		echo ' *** You need to run "make" before "make install".' 1>&2
-		echo ""                                                   1>&2
-		exit 1
-	fi
-}
-
-# Make sure the files actually exist
-verify "$2"
-verify "$3"
-
-# User may have a custom install script
-
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-
-# Default install - same as make zlilo
-
-if [ -f $4/vmlinuz ]; then
-	mv $4/vmlinuz $4/vmlinuz.old
-fi
-
-if [ -f $4/System.map ]; then
-	mv $4/System.map $4/System.old
-fi
-
-cat $2 > $4/vmlinuz
-cp $3 $4/System.map
-
-sync
diff --git a/scripts/install.sh b/scripts/install.sh
index a61a5ce28cad..407ffa65062c 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -66,7 +66,7 @@ fi
 # Some architectures name their files based on version number, and
 # others do not.  Call out the ones that do not to make it obvious.
 case "${ARCH}" in
-	ia64 | m68k | x86)
+	ia64 | m68k | nios2 | x86)
 		version=""
 		;;
 	*)
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 15/20] kbuild: parisc: use common install script
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (13 preceding siblings ...)
  2021-04-07  5:34 ` [PATCH 14/20] kbuild: nios2: use common install script Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-07 11:23   ` Masahiro Yamada
  2021-04-07  5:34   ` Greg Kroah-Hartman
                   ` (6 subsequent siblings)
  21 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	James E.J. Bottomley, Helge Deller, linux-parisc

The common scripts/install.sh script will now work for parisc, all that
is needed is to add the compressed image type to it.  So add that file
type check, and then we can remove the two different copies of the
parisc install.sh script that were only different by one line and have
the arch call the common install script.

Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-parisc@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/parisc/Makefile        |  4 +--
 arch/parisc/boot/Makefile   |  2 +-
 arch/parisc/boot/install.sh | 65 ------------------------------------
 arch/parisc/install.sh      | 66 -------------------------------------
 scripts/install.sh          |  1 +
 5 files changed, 4 insertions(+), 134 deletions(-)
 delete mode 100644 arch/parisc/boot/install.sh
 delete mode 100644 arch/parisc/install.sh

diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 7d9f71aa829a..296d8ab8e2aa 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -164,10 +164,10 @@ vmlinuz: vmlinux
 endif
 
 install:
-	$(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh \
 			$(KERNELRELEASE) vmlinux System.map "$(INSTALL_PATH)"
 zinstall:
-	$(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
+	$(CONFIG_SHELL) $(srctree)/scripts/install.sh \
 			$(KERNELRELEASE) vmlinuz System.map "$(INSTALL_PATH)"
 
 CLEAN_FILES	+= lifimage
diff --git a/arch/parisc/boot/Makefile b/arch/parisc/boot/Makefile
index 61f44142cfe1..ad2611929aee 100644
--- a/arch/parisc/boot/Makefile
+++ b/arch/parisc/boot/Makefile
@@ -17,5 +17,5 @@ $(obj)/compressed/vmlinux: FORCE
 	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
 
 install: $(CONFIGURE) $(obj)/bzImage
-	sh -x  $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
+	sh -x  $(srctree)/scripts/install.sh $(KERNELRELEASE) $(obj)/bzImage \
 	      System.map "$(INSTALL_PATH)"
diff --git a/arch/parisc/boot/install.sh b/arch/parisc/boot/install.sh
deleted file mode 100644
index 8f7c365fad83..000000000000
--- a/arch/parisc/boot/install.sh
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/sh
-#
-# arch/parisc/install.sh, derived from arch/i386/boot/install.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
-#
-# "make install" script for i386 architecture
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#
-
-verify () {
-	if [ ! -f "$1" ]; then
-		echo ""                                                   1>&2
-		echo " *** Missing file: $1"                              1>&2
-		echo ' *** You need to run "make" before "make install".' 1>&2
-		echo ""                                                   1>&2
-		exit 1
-	fi
-}
-
-# Make sure the files actually exist
-
-verify "$2"
-verify "$3"
-
-# User may have a custom install script
-
-if [ -n "${INSTALLKERNEL}" ]; then
-  if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-  if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-fi
-
-# Default install
-
-if [ "$(basename $2)" = "zImage" ]; then
-# Compressed install
-  echo "Installing compressed kernel"
-  base=vmlinuz
-else
-# Normal install
-  echo "Installing normal kernel"
-  base=vmlinux
-fi
-
-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
diff --git a/arch/parisc/install.sh b/arch/parisc/install.sh
deleted file mode 100644
index 056d588befdd..000000000000
--- a/arch/parisc/install.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-#
-# arch/parisc/install.sh, derived from arch/i386/boot/install.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
-#
-# "make install" script for i386 architecture
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#
-
-verify () {
-	if [ ! -f "$1" ]; then
-		echo ""                                                   1>&2
-		echo " *** Missing file: $1"                              1>&2
-		echo ' *** You need to run "make" before "make install".' 1>&2
-		echo ""                                                   1>&2
-		exit 1
-	fi
-}
-
-# Make sure the files actually exist
-
-verify "$2"
-verify "$3"
-
-# User may have a custom install script
-
-if [ -n "${INSTALLKERNEL}" ]; then
-  if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-  if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-fi
-
-# Default install
-
-if [ "$(basename $2)" = "vmlinuz" ]; then
-# Compressed install
-  echo "Installing compressed kernel"
-  base=vmlinuz
-else
-# Normal install
-  echo "Installing normal kernel"
-  base=vmlinux
-fi
-
-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
-
diff --git a/scripts/install.sh b/scripts/install.sh
index 407ffa65062c..e0ffb95737d4 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -53,6 +53,7 @@ base=$(basename "$2")
 if [ "$base" = "bzImage" ] ||
    [ "$base" = "Image.gz" ] ||
    [ "$base" = "vmlinux.gz" ] ||
+   [ "$base" = "vmlinuz" ] ||
    [ "$base" = "zImage" ] ; then
 	# Compressed install
 	echo "Installing compressed kernel"
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 16/20] kbuild: powerpc: use common install script
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
@ 2021-04-07  5:34   ` Greg Kroah-Hartman
  2021-04-07  5:34 ` [PATCH 02/20] kbuild: scripts/install.sh: properly quote all variables Greg Kroah-Hartman
                     ` (20 subsequent siblings)
  21 siblings, 0 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	Michael Ellerman, linuxppc-dev

The common scripts/install.sh script will now work for powerpc, all that
is needed is to add it to the list of arches that do not put the version
number in the installed file name.

After the kernel is installed, powerpc also likes to install a few
random files, so provide the ability to do that as well.

With that we can remove the powerpc-only version of the install script.

Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/powerpc/boot/Makefile   |  4 +--
 arch/powerpc/boot/install.sh | 55 ------------------------------------
 scripts/install.sh           | 14 ++++++++-
 3 files changed, 15 insertions(+), 58 deletions(-)
 delete mode 100644 arch/powerpc/boot/install.sh

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 2b8da923ceca..bbfcbd33e0b7 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -442,11 +442,11 @@ $(obj)/zImage.initrd:	$(addprefix $(obj)/, $(initrd-y))
 
 # Only install the vmlinux
 install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
-	sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)"
+	sh -x $(srctree)/scripts/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)"
 
 # Install the vmlinux and other built boot targets.
 zInstall: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
-	sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^
+	sh -x $(srctree)/scripts/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^
 
 PHONY += install zInstall
 
diff --git a/arch/powerpc/boot/install.sh b/arch/powerpc/boot/install.sh
deleted file mode 100644
index b6a256bc96ee..000000000000
--- a/arch/powerpc/boot/install.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/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
-#
-# Blatantly stolen from in arch/i386/boot/install.sh by Dave Hansen 
-#
-# "make install" script for ppc64 architecture
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#   $5 and more - kernel boot files; zImage*, uImage, cuImage.*, etc.
-#
-
-# Bail with error code if anything goes wrong
-set -e
-
-# User may have a custom install script
-
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-
-# Default install
-
-# this should work for both the pSeries zImage and the iSeries vmlinux.sm
-image_name=`basename $2`
-
-if [ -f $4/$image_name ]; then
-	mv $4/$image_name $4/$image_name.old
-fi
-
-if [ -f $4/System.map ]; then
-	mv $4/System.map $4/System.old
-fi
-
-cat $2 > $4/$image_name
-cp $3 $4/System.map
-
-# Copy all the bootable image files
-path=$4
-shift 4
-while [ $# -ne 0 ]; do
-	image_name=`basename $1`
-	if [ -f $path/$image_name ]; then
-		mv $path/$image_name $path/$image_name.old
-	fi
-	cat $1 > $path/$image_name
-	shift
-done;
diff --git a/scripts/install.sh b/scripts/install.sh
index e0ffb95737d4..67c0a5f74af2 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -67,7 +67,7 @@ fi
 # Some architectures name their files based on version number, and
 # others do not.  Call out the ones that do not to make it obvious.
 case "${ARCH}" in
-	ia64 | m68k | nios2 | x86)
+	ia64 | m68k | nios2 | powerpc | x86)
 		version=""
 		;;
 	*)
@@ -93,6 +93,18 @@ case "${ARCH}" in
 			/usr/sbin/elilo
 		fi
 		;;
+	powerpc)
+		# powerpc installation can list other boot targets after the
+		# install path that should be copied to the correct location
+		path=$4
+		shift 4
+		while [ $# -ne 0 ]; do
+			image_name=$(basename "$1")
+			install "$1" "$path"/"$image_name"
+			shift
+		done;
+		sync
+		;;
 	x86)
 		if [ -x /sbin/lilo ]; then
 			/sbin/lilo
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 16/20] kbuild: powerpc: use common install script
@ 2021-04-07  5:34   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-arch, linux-kbuild, Greg Kroah-Hartman, linux-kernel, linuxppc-dev

The common scripts/install.sh script will now work for powerpc, all that
is needed is to add it to the list of arches that do not put the version
number in the installed file name.

After the kernel is installed, powerpc also likes to install a few
random files, so provide the ability to do that as well.

With that we can remove the powerpc-only version of the install script.

Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/powerpc/boot/Makefile   |  4 +--
 arch/powerpc/boot/install.sh | 55 ------------------------------------
 scripts/install.sh           | 14 ++++++++-
 3 files changed, 15 insertions(+), 58 deletions(-)
 delete mode 100644 arch/powerpc/boot/install.sh

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 2b8da923ceca..bbfcbd33e0b7 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -442,11 +442,11 @@ $(obj)/zImage.initrd:	$(addprefix $(obj)/, $(initrd-y))
 
 # Only install the vmlinux
 install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
-	sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)"
+	sh -x $(srctree)/scripts/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)"
 
 # Install the vmlinux and other built boot targets.
 zInstall: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
-	sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^
+	sh -x $(srctree)/scripts/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^
 
 PHONY += install zInstall
 
diff --git a/arch/powerpc/boot/install.sh b/arch/powerpc/boot/install.sh
deleted file mode 100644
index b6a256bc96ee..000000000000
--- a/arch/powerpc/boot/install.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/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
-#
-# Blatantly stolen from in arch/i386/boot/install.sh by Dave Hansen 
-#
-# "make install" script for ppc64 architecture
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#   $5 and more - kernel boot files; zImage*, uImage, cuImage.*, etc.
-#
-
-# Bail with error code if anything goes wrong
-set -e
-
-# User may have a custom install script
-
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-
-# Default install
-
-# this should work for both the pSeries zImage and the iSeries vmlinux.sm
-image_name=`basename $2`
-
-if [ -f $4/$image_name ]; then
-	mv $4/$image_name $4/$image_name.old
-fi
-
-if [ -f $4/System.map ]; then
-	mv $4/System.map $4/System.old
-fi
-
-cat $2 > $4/$image_name
-cp $3 $4/System.map
-
-# Copy all the bootable image files
-path=$4
-shift 4
-while [ $# -ne 0 ]; do
-	image_name=`basename $1`
-	if [ -f $path/$image_name ]; then
-		mv $path/$image_name $path/$image_name.old
-	fi
-	cat $1 > $path/$image_name
-	shift
-done;
diff --git a/scripts/install.sh b/scripts/install.sh
index e0ffb95737d4..67c0a5f74af2 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -67,7 +67,7 @@ fi
 # Some architectures name their files based on version number, and
 # others do not.  Call out the ones that do not to make it obvious.
 case "${ARCH}" in
-	ia64 | m68k | nios2 | x86)
+	ia64 | m68k | nios2 | powerpc | x86)
 		version=""
 		;;
 	*)
@@ -93,6 +93,18 @@ case "${ARCH}" in
 			/usr/sbin/elilo
 		fi
 		;;
+	powerpc)
+		# powerpc installation can list other boot targets after the
+		# install path that should be copied to the correct location
+		path=$4
+		shift 4
+		while [ $# -ne 0 ]; do
+			image_name=$(basename "$1")
+			install "$1" "$path"/"$image_name"
+			shift
+		done;
+		sync
+		;;
 	x86)
 		if [ -x /sbin/lilo ]; then
 			/sbin/lilo
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 17/20] kbuild: s390: use common install script
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (15 preceding siblings ...)
  2021-04-07  5:34   ` Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-07 12:15   ` Heiko Carstens
  2021-04-09  3:10   ` Kees Cook
  2021-04-07  5:34 ` [PATCH 18/20] kbuild: sh: remove unused " Greg Kroah-Hartman
                   ` (4 subsequent siblings)
  21 siblings, 2 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	Heiko Carstens, Vasily Gorbik, Christian Borntraeger, linux-s390

The common scripts/install.sh script will now work for s390, no changes
needed.  So call that instead and delete the s390-only install script.

Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: linux-s390@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/s390/boot/Makefile   |  2 +-
 arch/s390/boot/install.sh | 30 ------------------------------
 2 files changed, 1 insertion(+), 31 deletions(-)
 delete mode 100644 arch/s390/boot/install.sh

diff --git a/arch/s390/boot/Makefile b/arch/s390/boot/Makefile
index 41a64b8dce25..5e3058d6e59b 100644
--- a/arch/s390/boot/Makefile
+++ b/arch/s390/boot/Makefile
@@ -71,5 +71,5 @@ $(obj)/startup.a: $(OBJECTS) FORCE
 	$(call if_changed,ar)
 
 install:
-	sh -x  $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
+	sh -x  $(srctree)/scripts/install.sh $(KERNELRELEASE) $(obj)/bzImage \
 	      System.map "$(INSTALL_PATH)"
diff --git a/arch/s390/boot/install.sh b/arch/s390/boot/install.sh
deleted file mode 100644
index 515b27a996b3..000000000000
--- a/arch/s390/boot/install.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0
-#
-# arch/s390x/boot/install.sh
-#
-# Copyright (C) 1995 by Linus Torvalds
-#
-# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
-#
-# "make install" script for s390 architecture
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#
-
-# User may have a custom install script
-
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-
-echo "Warning: '${INSTALLKERNEL}' command not available - additional " \
-     "bootloader config required" >&2
-if [ -f $4/vmlinuz-$1 ]; then mv $4/vmlinuz-$1 $4/vmlinuz-$1.old; fi
-if [ -f $4/System.map-$1 ]; then mv $4/System.map-$1 $4/System.map-$1.old; fi
-
-cat $2 > $4/vmlinuz-$1
-cp $3 $4/System.map-$1
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 18/20] kbuild: sh: remove unused install script
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (16 preceding siblings ...)
  2021-04-07  5:34 ` [PATCH 17/20] kbuild: s390: " Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-09  3:09   ` Kees Cook
  2021-08-24 15:22   ` Masahiro Yamada
  2021-04-07  5:34 ` [PATCH 19/20] kbuild: sparc: use common " Greg Kroah-Hartman
                   ` (3 subsequent siblings)
  21 siblings, 2 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	Yoshinori Sato, Rich Felker, linux-sh

The sh arch has a install.sh script, but no Makefile actually calls it.
Remove it to keep anyone from accidentally calling it in the future.

Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/sh/boot/compressed/install.sh | 56 ------------------------------
 1 file changed, 56 deletions(-)
 delete mode 100644 arch/sh/boot/compressed/install.sh

diff --git a/arch/sh/boot/compressed/install.sh b/arch/sh/boot/compressed/install.sh
deleted file mode 100644
index f9f41818b17e..000000000000
--- a/arch/sh/boot/compressed/install.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-#
-# arch/sh/boot/install.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
-# Adapted from code in arch/arm/boot/install.sh by Stuart Menefy
-#
-# "make install" script for sh architecture
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#
-
-# User may have a custom install script
-
-if [ -x /sbin/${INSTALLKERNEL} ]; then
-  exec /sbin/${INSTALLKERNEL} "$@"
-fi
-
-if [ "$2" = "zImage" ]; then
-# Compressed install
-  echo "Installing compressed kernel"
-  if [ -f $4/vmlinuz-$1 ]; then
-    mv $4/vmlinuz-$1 $4/vmlinuz.old
-  fi
-
-  if [ -f $4/System.map-$1 ]; then
-    mv $4/System.map-$1 $4/System.old
-  fi
-
-  cat $2 > $4/vmlinuz-$1
-  cp $3 $4/System.map-$1
-else
-# Normal install
-  echo "Installing normal kernel"
-  if [ -f $4/vmlinux-$1 ]; then
-    mv $4/vmlinux-$1 $4/vmlinux.old
-  fi
-
-  if [ -f $4/System.map ]; then
-    mv $4/System.map $4/System.old
-  fi
-
-  cat $2 > $4/vmlinux-$1
-  cp $3 $4/System.map
-fi
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 19/20] kbuild: sparc: use common install script
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (17 preceding siblings ...)
  2021-04-07  5:34 ` [PATCH 18/20] kbuild: sh: remove unused " Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-09  3:09   ` Kees Cook
  2021-04-07  5:34 ` [PATCH 20/20] kbuild: scripts/install.sh: update documentation Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  21 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman,
	David S. Miller, sparclinux

The common scripts/install.sh script will now work for sparc, all that
is needed is to add it to the list of arches that do not put the version
number in the installed file name.

With that we can remove the sparc-only version of the install script.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/sparc/boot/Makefile   |  2 +-
 arch/sparc/boot/install.sh | 50 --------------------------------------
 scripts/install.sh         |  2 +-
 3 files changed, 2 insertions(+), 52 deletions(-)
 delete mode 100644 arch/sparc/boot/install.sh

diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile
index 380e2b018992..952f8e7a40ec 100644
--- a/arch/sparc/boot/Makefile
+++ b/arch/sparc/boot/Makefile
@@ -72,5 +72,5 @@ $(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback System.map $(ROOT_IMG) FORCE
 	$(call if_changed,piggy)
 
 install:
-	sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(obj)/zImage \
+	sh $(srctree)/scripts/install.sh $(KERNELRELEASE) $(obj)/zImage \
 		System.map "$(INSTALL_PATH)"
diff --git a/arch/sparc/boot/install.sh b/arch/sparc/boot/install.sh
deleted file mode 100644
index b32851eae693..000000000000
--- a/arch/sparc/boot/install.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/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
-#
-# "make install" script for SPARC architecture
-#
-# Arguments:
-#   $1 - kernel version
-#   $2 - kernel image file
-#   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
-#
-
-verify () {
-	if [ ! -f "$1" ]; then
-		echo ""                                                   1>&2
-		echo " *** Missing file: $1"                              1>&2
-		echo ' *** You need to run "make" before "make install".' 1>&2
-		echo ""                                                   1>&2
-		exit 1
-	fi
-}
-
-# Make sure the files actually exist
-verify "$2"
-verify "$3"
-
-# User may have a custom install script
-
-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
-
-# Default install - same as make zlilo
-
-if [ -f $4/vmlinuz ]; then
-	mv $4/vmlinuz $4/vmlinuz.old
-fi
-
-if [ -f $4/System.map ]; then
-	mv $4/System.map $4/System.old
-fi
-
-cat $2 > $4/vmlinuz
-cp $3 $4/System.map
diff --git a/scripts/install.sh b/scripts/install.sh
index 67c0a5f74af2..225b19bbbfa6 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -67,7 +67,7 @@ fi
 # Some architectures name their files based on version number, and
 # others do not.  Call out the ones that do not to make it obvious.
 case "${ARCH}" in
-	ia64 | m68k | nios2 | powerpc | x86)
+	ia64 | m68k | nios2 | powerpc | sparc | x86)
 		version=""
 		;;
 	*)
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* [PATCH 20/20] kbuild: scripts/install.sh: update documentation
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (18 preceding siblings ...)
  2021-04-07  5:34 ` [PATCH 19/20] kbuild: sparc: use common " Greg Kroah-Hartman
@ 2021-04-07  5:34 ` Greg Kroah-Hartman
  2021-04-07 11:45   ` Masahiro Yamada
  2021-04-07  7:18 ` [PATCH 00/20] kbuild: unify the install.sh script usage Geert Uytterhoeven
  2021-04-09  3:12 ` Kees Cook
  21 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  5:34 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kbuild, linux-arch, linux-kernel, Greg Kroah-Hartman

Add a proper SPDX line and document the install.sh file a lot better,
explaining exactly what it does, and update the copyright notice and
provide a better message about the lack of LILO being present or not as
really, no one should be using that anymore...

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 scripts/install.sh | 33 ++++++++++++++++++++++++++-------
 1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/scripts/install.sh b/scripts/install.sh
index 225b19bbbfa6..dd86fb9971e9 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -1,14 +1,14 @@
 #!/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.
+# SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) 1995 by Linus Torvalds
+# Copyright (C) 2021 Greg Kroah-Hartman
 #
 # Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
+# Adapted from code in arch/i386/boot/install.sh by Russell King
+# Adapted from code in arch/arm/boot/install.sh by Stuart Menefy
 #
-# "make install" script for i386 architecture
+# "make install" script for Linux to be used by all architectures.
 #
 # Arguments:
 #   $1 - kernel version
@@ -16,6 +16,26 @@
 #   $3 - kernel map file
 #   $4 - default install path (blank if root directory)
 #
+# Installs the built kernel image and map and symbol file in the specified
+# install location.  If no install path is selected, the files will be placed
+# in the root directory.
+#
+# The name of the kernel image will be "vmlinux-VERSION" for uncompressed
+# kernels or "vmlinuz-VERSION' for compressed kernels.
+#
+# The kernel map file will be named "System.map-VERSION"
+#
+# Note, not all architectures seem to like putting the VERSION number in the
+# file name, see below in the script for a list of those that do not.  For
+# those that do not the "-VERSION" will not be present in the file name.
+#
+# If there is currently a kernel image or kernel map file present with the name
+# of the file to be copied to the location, it will be renamed to contain a
+# ".old" suffix.
+#
+# If ~/bin/${INSTALLKERNEL} or /sbin/${INSTALLKERNEL} is executable, execution
+# will be passed to that program instead of this one to allow for distro or
+# system specific installation scripts to be used.
 
 verify () {
 	if [ ! -f "$1" ]; then
@@ -45,7 +65,6 @@ verify "$2"
 verify "$3"
 
 # User may have a custom install script
-
 if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi
 if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
 
@@ -111,7 +130,7 @@ case "${ARCH}" in
 		elif [ -x /etc/lilo/install ]; then
 			/etc/lilo/install
 		else
-			echo "Cannot find LILO."
+			echo "Cannot find LILO, ensure your bootloader knows of the new kernel image."
 		fi
 		;;
 esac
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 70+ messages in thread

* Re: [PATCH 00/20] kbuild: unify the install.sh script usage
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (19 preceding siblings ...)
  2021-04-07  5:34 ` [PATCH 20/20] kbuild: scripts/install.sh: update documentation Greg Kroah-Hartman
@ 2021-04-07  7:18 ` Geert Uytterhoeven
  2021-04-07  7:46   ` Greg Kroah-Hartman
  2021-04-09  3:12 ` Kees Cook
  21 siblings, 1 reply; 70+ messages in thread
From: Geert Uytterhoeven @ 2021-04-07  7:18 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, Linux-Arch,
	Linux Kernel Mailing List, David S. Miller, James E.J. Bottomley,
	Albert Ou, Borislav Petkov, Catalin Marinas,
	Christian Borntraeger, Greentime Hu, Heiko Carstens,
	Helge Deller, Ingo Molnar, Ley Foon Tan, Michael Ellerman,
	Nick Hu, Palmer Dabbelt, Paul Walmsley, Rich Felker,
	Russell King, Thomas Gleixner, Vasily Gorbik, Vincent Chen,
	Will Deacon, Yoshinori Sato, the arch/x86 maintainers

Hi Greg,

Thanks for your series!

On Wed, Apr 7, 2021 at 7:34 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> Almost every architecture has copied the "install.sh" script that
> originally came with i386, and modified it in very tiny ways.  This
> patch series unifies all of these scripts into one single script to
> allow people to understand how to correctly install a kernel, and fixes
> up some issues regarding trying to install a kernel to a path with
> spaces in it.
>
> Note that not all architectures actually seem to have any type of way to
> install a kernel, they must rely on external scripts or tools which
> feels odd as everything should be included here in the main repository.
> I'll work on trying to figure out the missing architecture issues
> afterward.

I'll bite ;-)

Does anyone actually use these scripts (outside of x86)?
I assume the architectures that have them, only have them because they
were copied from x86 while doing the initial ports ("oh, a file I don't
have to modify at all.").
But installing the kernel can be very platform-specific.
Do you need the vmlinux, vmlinux.gz, Image, zImage, uImage, ...?
With separate or appended DTB?

Even on x86, the script will bail out with "Cannot find LILO." if you're
using Grub.

Anyway, having less of them is good.

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 12/20] kbuild: m68k: use common install script
  2021-04-07  5:34 ` [PATCH 12/20] kbuild: m68k: " Greg Kroah-Hartman
@ 2021-04-07  7:19   ` Geert Uytterhoeven
  2021-04-09  3:10   ` Kees Cook
  1 sibling, 0 replies; 70+ messages in thread
From: Geert Uytterhoeven @ 2021-04-07  7:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, Linux-Arch,
	Linux Kernel Mailing List, linux-m68k

Hi Greg,

On Wed, Apr 7, 2021 at 7:35 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> The common scripts/install.sh script will now work for m68k, all that
> is needed is to add it to the list of arches that do not put the version
> number in the installed file name.
>
> With that we can remove the m68k-only version of the install script.
>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: linux-m68k@lists.linux-m68k.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Thanks for your patch!

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

I guess it would "work" with the version number, too.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 00/20] kbuild: unify the install.sh script usage
  2021-04-07  7:18 ` [PATCH 00/20] kbuild: unify the install.sh script usage Geert Uytterhoeven
@ 2021-04-07  7:46   ` Greg Kroah-Hartman
  2021-04-07  8:02     ` Russell King - ARM Linux admin
  0 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  7:46 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, Linux-Arch,
	Linux Kernel Mailing List, David S. Miller, James E.J. Bottomley,
	Albert Ou, Borislav Petkov, Catalin Marinas,
	Christian Borntraeger, Greentime Hu, Heiko Carstens,
	Helge Deller, Ingo Molnar, Ley Foon Tan, Michael Ellerman,
	Nick Hu, Palmer Dabbelt, Paul Walmsley, Rich Felker,
	Russell King, Thomas Gleixner, Vasily Gorbik, Vincent Chen,
	Will Deacon, Yoshinori Sato, the arch/x86 maintainers

On Wed, Apr 07, 2021 at 09:18:11AM +0200, Geert Uytterhoeven wrote:
> Hi Greg,
> 
> Thanks for your series!
> 
> On Wed, Apr 7, 2021 at 7:34 AM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> > Almost every architecture has copied the "install.sh" script that
> > originally came with i386, and modified it in very tiny ways.  This
> > patch series unifies all of these scripts into one single script to
> > allow people to understand how to correctly install a kernel, and fixes
> > up some issues regarding trying to install a kernel to a path with
> > spaces in it.
> >
> > Note that not all architectures actually seem to have any type of way to
> > install a kernel, they must rely on external scripts or tools which
> > feels odd as everything should be included here in the main repository.
> > I'll work on trying to figure out the missing architecture issues
> > afterward.
> 
> I'll bite ;-)
> 
> Does anyone actually use these scripts (outside of x86)?

I think so, if not then what do they use?

Ok, I'll answer that, Before this week, I used my own script, a horrible
hack I've drug along for years:
	https://github.com/gregkh/gregkh-linux/blob/master/scripts/install

but for almost everyone else, they just use /sbin/installkernel that is
provided by their distro.  But this feels really odd given that we
should include the logic to install the kernel in the kernel source
itself, otherwise everyone has to rely on an external package that no
one knows where it is.

> I assume the architectures that have them, only have them because they
> were copied from x86 while doing the initial ports ("oh, a file I don't
> have to modify at all.").
> But installing the kernel can be very platform-specific.
> Do you need the vmlinux, vmlinux.gz, Image, zImage, uImage, ...?
> With separate or appended DTB?

That seems handled already by the arch/ARCH/boot/Makefile logic today,
so I do not think we need to change that.

> Even on x86, the script will bail out with "Cannot find LILO." if you're
> using Grub.

The last change in this series tries to "soften" that language so that
isn't really an issue anymore.

I want to turn this into something that everyone can use, so we do not
have to rely on distro-specific or other external programs, as trying to
explain how to install a kernel to someone new to kernel development is
a real pain.

> Anyway, having less of them is good.

Agreed, thanks for the review :)

greg k-h

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 00/20] kbuild: unify the install.sh script usage
  2021-04-07  7:46   ` Greg Kroah-Hartman
@ 2021-04-07  8:02     ` Russell King - ARM Linux admin
  2021-04-07  8:07       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 70+ messages in thread
From: Russell King - ARM Linux admin @ 2021-04-07  8:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Geert Uytterhoeven, Masahiro Yamada, Michal Marek, linux-kbuild,
	Linux-Arch, Linux Kernel Mailing List, David S. Miller,
	James E.J. Bottomley, Albert Ou, Borislav Petkov,
	Catalin Marinas, Christian Borntraeger, Greentime Hu,
	Heiko Carstens, Helge Deller, Ingo Molnar, Ley Foon Tan,
	Michael Ellerman, Nick Hu, Palmer Dabbelt, Paul Walmsley,
	Rich Felker, Thomas Gleixner, Vasily Gorbik, Vincent Chen,
	Will Deacon, Yoshinori Sato, the arch/x86 maintainers

On Wed, Apr 07, 2021 at 09:46:18AM +0200, Greg Kroah-Hartman wrote:
> On Wed, Apr 07, 2021 at 09:18:11AM +0200, Geert Uytterhoeven wrote:
> > Hi Greg,
> > 
> > Thanks for your series!
> > 
> > On Wed, Apr 7, 2021 at 7:34 AM Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org> wrote:
> > > Almost every architecture has copied the "install.sh" script that
> > > originally came with i386, and modified it in very tiny ways.  This
> > > patch series unifies all of these scripts into one single script to
> > > allow people to understand how to correctly install a kernel, and fixes
> > > up some issues regarding trying to install a kernel to a path with
> > > spaces in it.
> > >
> > > Note that not all architectures actually seem to have any type of way to
> > > install a kernel, they must rely on external scripts or tools which
> > > feels odd as everything should be included here in the main repository.
> > > I'll work on trying to figure out the missing architecture issues
> > > afterward.
> > 
> > I'll bite ;-)
> > 
> > Does anyone actually use these scripts (outside of x86)?

Yes, every time I build a kernel. My kernel build system involves
typing "kbuild <flags> <dirname> <machines...>" and the kernel gets
built in ../build/<dirname>. When the build completes, it gets
installed into ~/systems/<dirname>, tar'd up, and copied to the
destination machines, unpacked, installed as appropriate, and
the machine rebooted if requested.

The installation step is done via the ~/bin/installkernel script.

> > I assume the architectures that have them, only have them because they
> > were copied from x86 while doing the initial ports ("oh, a file I don't
> > have to modify at all.").
> > But installing the kernel can be very platform-specific.
> > Do you need the vmlinux, vmlinux.gz, Image, zImage, uImage, ...?
> > With separate or appended DTB?

My scripts deal with all that.

However, I haven't been able to review the changes that are being
made because I have no visibility of the common "scripts" version.
Provided it offers exactly the same functionality as the arm32
version, I'm happy. If it doesn't, it may cause a regression, and
I will be reporting that.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 00/20] kbuild: unify the install.sh script usage
  2021-04-07  8:02     ` Russell King - ARM Linux admin
@ 2021-04-07  8:07       ` Greg Kroah-Hartman
  2021-04-07  8:14         ` Russell King - ARM Linux admin
  0 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  8:07 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: Geert Uytterhoeven, Masahiro Yamada, Michal Marek, linux-kbuild,
	Linux-Arch, Linux Kernel Mailing List, David S. Miller,
	James E.J. Bottomley, Albert Ou, Borislav Petkov,
	Catalin Marinas, Christian Borntraeger, Greentime Hu,
	Heiko Carstens, Helge Deller, Ingo Molnar, Ley Foon Tan,
	Michael Ellerman, Nick Hu, Palmer Dabbelt, Paul Walmsley,
	Rich Felker, Thomas Gleixner, Vasily Gorbik, Vincent Chen,
	Will Deacon, Yoshinori Sato, the arch/x86 maintainers

On Wed, Apr 07, 2021 at 09:02:29AM +0100, Russell King - ARM Linux admin wrote:
> On Wed, Apr 07, 2021 at 09:46:18AM +0200, Greg Kroah-Hartman wrote:
> > On Wed, Apr 07, 2021 at 09:18:11AM +0200, Geert Uytterhoeven wrote:
> > > Hi Greg,
> > > 
> > > Thanks for your series!
> > > 
> > > On Wed, Apr 7, 2021 at 7:34 AM Greg Kroah-Hartman
> > > <gregkh@linuxfoundation.org> wrote:
> > > > Almost every architecture has copied the "install.sh" script that
> > > > originally came with i386, and modified it in very tiny ways.  This
> > > > patch series unifies all of these scripts into one single script to
> > > > allow people to understand how to correctly install a kernel, and fixes
> > > > up some issues regarding trying to install a kernel to a path with
> > > > spaces in it.
> > > >
> > > > Note that not all architectures actually seem to have any type of way to
> > > > install a kernel, they must rely on external scripts or tools which
> > > > feels odd as everything should be included here in the main repository.
> > > > I'll work on trying to figure out the missing architecture issues
> > > > afterward.
> > > 
> > > I'll bite ;-)
> > > 
> > > Does anyone actually use these scripts (outside of x86)?
> 
> Yes, every time I build a kernel. My kernel build system involves
> typing "kbuild <flags> <dirname> <machines...>" and the kernel gets
> built in ../build/<dirname>. When the build completes, it gets
> installed into ~/systems/<dirname>, tar'd up, and copied to the
> destination machines, unpacked, installed as appropriate, and
> the machine rebooted if requested.
> 
> The installation step is done via the ~/bin/installkernel script.

So you don't use install.sh at all except to invoke your local script.

> > > I assume the architectures that have them, only have them because they
> > > were copied from x86 while doing the initial ports ("oh, a file I don't
> > > have to modify at all.").
> > > But installing the kernel can be very platform-specific.
> > > Do you need the vmlinux, vmlinux.gz, Image, zImage, uImage, ...?
> > > With separate or appended DTB?
> 
> My scripts deal with all that.
> 
> However, I haven't been able to review the changes that are being
> made because I have no visibility of the common "scripts" version.
> Provided it offers exactly the same functionality as the arm32
> version, I'm happy. If it doesn't, it may cause a regression, and
> I will be reporting that.

It should be identical, if I got something wrong please let me know.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 00/20] kbuild: unify the install.sh script usage
  2021-04-07  8:07       ` Greg Kroah-Hartman
@ 2021-04-07  8:14         ` Russell King - ARM Linux admin
  2021-04-07  8:37           ` Greg Kroah-Hartman
  0 siblings, 1 reply; 70+ messages in thread
From: Russell King - ARM Linux admin @ 2021-04-07  8:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Geert Uytterhoeven, Masahiro Yamada, Michal Marek, linux-kbuild,
	Linux-Arch, Linux Kernel Mailing List, David S. Miller,
	James E.J. Bottomley, Albert Ou, Borislav Petkov,
	Catalin Marinas, Christian Borntraeger, Greentime Hu,
	Heiko Carstens, Helge Deller, Ingo Molnar, Ley Foon Tan,
	Michael Ellerman, Nick Hu, Palmer Dabbelt, Paul Walmsley,
	Rich Felker, Thomas Gleixner, Vasily Gorbik, Vincent Chen,
	Will Deacon, Yoshinori Sato, the arch/x86 maintainers

On Wed, Apr 07, 2021 at 10:07:29AM +0200, Greg Kroah-Hartman wrote:
> On Wed, Apr 07, 2021 at 09:02:29AM +0100, Russell King - ARM Linux admin wrote:
> > On Wed, Apr 07, 2021 at 09:46:18AM +0200, Greg Kroah-Hartman wrote:
> > > On Wed, Apr 07, 2021 at 09:18:11AM +0200, Geert Uytterhoeven wrote:
> > > > Hi Greg,
> > > > 
> > > > Thanks for your series!
> > > > 
> > > > On Wed, Apr 7, 2021 at 7:34 AM Greg Kroah-Hartman
> > > > <gregkh@linuxfoundation.org> wrote:
> > > > > Almost every architecture has copied the "install.sh" script that
> > > > > originally came with i386, and modified it in very tiny ways.  This
> > > > > patch series unifies all of these scripts into one single script to
> > > > > allow people to understand how to correctly install a kernel, and fixes
> > > > > up some issues regarding trying to install a kernel to a path with
> > > > > spaces in it.
> > > > >
> > > > > Note that not all architectures actually seem to have any type of way to
> > > > > install a kernel, they must rely on external scripts or tools which
> > > > > feels odd as everything should be included here in the main repository.
> > > > > I'll work on trying to figure out the missing architecture issues
> > > > > afterward.
> > > > 
> > > > I'll bite ;-)
> > > > 
> > > > Does anyone actually use these scripts (outside of x86)?
> > 
> > Yes, every time I build a kernel. My kernel build system involves
> > typing "kbuild <flags> <dirname> <machines...>" and the kernel gets
> > built in ../build/<dirname>. When the build completes, it gets
> > installed into ~/systems/<dirname>, tar'd up, and copied to the
> > destination machines, unpacked, installed as appropriate, and
> > the machine rebooted if requested.
> > 
> > The installation step is done via the ~/bin/installkernel script.
> 
> So you don't use install.sh at all except to invoke your local script.

It depends where the kernel is being built; it has been used in the
past (one will notice that the arm32 version is not a direct copy of
the x86 version, and never was - it was modified from day 1.) It's
placement and naming of the files in /boot is still used today, which
is slightly different from the x86 version.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 00/20] kbuild: unify the install.sh script usage
  2021-04-07  8:14         ` Russell King - ARM Linux admin
@ 2021-04-07  8:37           ` Greg Kroah-Hartman
  2021-04-07 10:53             ` Masahiro Yamada
  0 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07  8:37 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: Geert Uytterhoeven, Masahiro Yamada, Michal Marek, linux-kbuild,
	Linux-Arch, Linux Kernel Mailing List, David S. Miller,
	James E.J. Bottomley, Albert Ou, Borislav Petkov,
	Catalin Marinas, Christian Borntraeger, Greentime Hu,
	Heiko Carstens, Helge Deller, Ingo Molnar, Ley Foon Tan,
	Michael Ellerman, Nick Hu, Palmer Dabbelt, Paul Walmsley,
	Rich Felker, Thomas Gleixner, Vasily Gorbik, Vincent Chen,
	Will Deacon, Yoshinori Sato, the arch/x86 maintainers

[-- Attachment #1: Type: text/plain, Size: 2748 bytes --]

On Wed, Apr 07, 2021 at 09:14:36AM +0100, Russell King - ARM Linux admin wrote:
> On Wed, Apr 07, 2021 at 10:07:29AM +0200, Greg Kroah-Hartman wrote:
> > On Wed, Apr 07, 2021 at 09:02:29AM +0100, Russell King - ARM Linux admin wrote:
> > > On Wed, Apr 07, 2021 at 09:46:18AM +0200, Greg Kroah-Hartman wrote:
> > > > On Wed, Apr 07, 2021 at 09:18:11AM +0200, Geert Uytterhoeven wrote:
> > > > > Hi Greg,
> > > > > 
> > > > > Thanks for your series!
> > > > > 
> > > > > On Wed, Apr 7, 2021 at 7:34 AM Greg Kroah-Hartman
> > > > > <gregkh@linuxfoundation.org> wrote:
> > > > > > Almost every architecture has copied the "install.sh" script that
> > > > > > originally came with i386, and modified it in very tiny ways.  This
> > > > > > patch series unifies all of these scripts into one single script to
> > > > > > allow people to understand how to correctly install a kernel, and fixes
> > > > > > up some issues regarding trying to install a kernel to a path with
> > > > > > spaces in it.
> > > > > >
> > > > > > Note that not all architectures actually seem to have any type of way to
> > > > > > install a kernel, they must rely on external scripts or tools which
> > > > > > feels odd as everything should be included here in the main repository.
> > > > > > I'll work on trying to figure out the missing architecture issues
> > > > > > afterward.
> > > > > 
> > > > > I'll bite ;-)
> > > > > 
> > > > > Does anyone actually use these scripts (outside of x86)?
> > > 
> > > Yes, every time I build a kernel. My kernel build system involves
> > > typing "kbuild <flags> <dirname> <machines...>" and the kernel gets
> > > built in ../build/<dirname>. When the build completes, it gets
> > > installed into ~/systems/<dirname>, tar'd up, and copied to the
> > > destination machines, unpacked, installed as appropriate, and
> > > the machine rebooted if requested.
> > > 
> > > The installation step is done via the ~/bin/installkernel script.
> > 
> > So you don't use install.sh at all except to invoke your local script.
> 
> It depends where the kernel is being built; it has been used in the
> past (one will notice that the arm32 version is not a direct copy of
> the x86 version, and never was - it was modified from day 1.) It's
> placement and naming of the files in /boot is still used today, which
> is slightly different from the x86 version.

The placement depends on the caller to the script, so that's not an
issue here.  The name for the output does differ from x86, but the
"common" script handles all of that (or it should, if not I messed up.)

Attached below is the common scripts/install.sh that this patch series
produces at the end of it, if you want to check to see if I missed
anything for your arch.

thanks,

greg k-h

[-- Attachment #2: install.sh --]
[-- Type: application/x-sh, Size: 3978 bytes --]

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 00/20] kbuild: unify the install.sh script usage
  2021-04-07  8:37           ` Greg Kroah-Hartman
@ 2021-04-07 10:53             ` Masahiro Yamada
  0 siblings, 0 replies; 70+ messages in thread
From: Masahiro Yamada @ 2021-04-07 10:53 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Russell King - ARM Linux admin, Geert Uytterhoeven, Michal Marek,
	linux-kbuild, Linux-Arch, Linux Kernel Mailing List,
	David S. Miller, James E.J. Bottomley, Albert Ou,
	Borislav Petkov, Catalin Marinas, Christian Borntraeger,
	Greentime Hu, Heiko Carstens, Helge Deller, Ingo Molnar,
	Ley Foon Tan, Michael Ellerman, Nick Hu, Palmer Dabbelt,
	Paul Walmsley, Rich Felker, Thomas Gleixner, Vasily Gorbik,
	Vincent Chen, Will Deacon, Yoshinori Sato,
	the arch/x86 maintainers

On Wed, Apr 7, 2021 at 5:37 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Wed, Apr 07, 2021 at 09:14:36AM +0100, Russell King - ARM Linux admin wrote:
> > On Wed, Apr 07, 2021 at 10:07:29AM +0200, Greg Kroah-Hartman wrote:
> > > On Wed, Apr 07, 2021 at 09:02:29AM +0100, Russell King - ARM Linux admin wrote:
> > > > On Wed, Apr 07, 2021 at 09:46:18AM +0200, Greg Kroah-Hartman wrote:
> > > > > On Wed, Apr 07, 2021 at 09:18:11AM +0200, Geert Uytterhoeven wrote:
> > > > > > Hi Greg,
> > > > > >
> > > > > > Thanks for your series!
> > > > > >
> > > > > > On Wed, Apr 7, 2021 at 7:34 AM Greg Kroah-Hartman
> > > > > > <gregkh@linuxfoundation.org> wrote:
> > > > > > > Almost every architecture has copied the "install.sh" script that
> > > > > > > originally came with i386, and modified it in very tiny ways.  This
> > > > > > > patch series unifies all of these scripts into one single script to
> > > > > > > allow people to understand how to correctly install a kernel, and fixes
> > > > > > > up some issues regarding trying to install a kernel to a path with
> > > > > > > spaces in it.
> > > > > > >
> > > > > > > Note that not all architectures actually seem to have any type of way to
> > > > > > > install a kernel, they must rely on external scripts or tools which
> > > > > > > feels odd as everything should be included here in the main repository.
> > > > > > > I'll work on trying to figure out the missing architecture issues
> > > > > > > afterward.
> > > > > >
> > > > > > I'll bite ;-)
> > > > > >
> > > > > > Does anyone actually use these scripts (outside of x86)?
> > > >
> > > > Yes, every time I build a kernel. My kernel build system involves
> > > > typing "kbuild <flags> <dirname> <machines...>" and the kernel gets
> > > > built in ../build/<dirname>. When the build completes, it gets
> > > > installed into ~/systems/<dirname>, tar'd up, and copied to the
> > > > destination machines, unpacked, installed as appropriate, and
> > > > the machine rebooted if requested.
> > > >
> > > > The installation step is done via the ~/bin/installkernel script.
> > >
> > > So you don't use install.sh at all except to invoke your local script.
> >
> > It depends where the kernel is being built; it has been used in the
> > past (one will notice that the arm32 version is not a direct copy of
> > the x86 version, and never was - it was modified from day 1.) It's
> > placement and naming of the files in /boot is still used today, which
> > is slightly different from the x86 version.
>
> The placement depends on the caller to the script, so that's not an
> issue here.  The name for the output does differ from x86, but the
> "common" script handles all of that (or it should, if not I messed up.)
>
> Attached below is the common scripts/install.sh that this patch series
> produces at the end of it, if you want to check to see if I missed
> anything for your arch.
>
> thanks,
>
> greg k-h



Thanks for nice cleanups!

I will give some nit-picking comments to individual patches.
Overall, this series looks nice.


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 02/20] kbuild: scripts/install.sh: properly quote all variables
  2021-04-07  5:34 ` [PATCH 02/20] kbuild: scripts/install.sh: properly quote all variables Greg Kroah-Hartman
@ 2021-04-07 10:59   ` Masahiro Yamada
  0 siblings, 0 replies; 70+ messages in thread
From: Masahiro Yamada @ 2021-04-07 10:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Michal Marek, Linux Kbuild mailing list, linux-arch,
	Linux Kernel Mailing List

On Wed, Apr 7, 2021 at 2:34 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> A few variables are quoted to handle spaces in directory names, but not
> all of them.  Properly quote everything so that the kernel build can
> handle working correctly with directory names with spaces.
>
> This change makes the script "shellcheck" clean now.
>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  scripts/install.sh | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/scripts/install.sh b/scripts/install.sh
> index d13ec1c38640..c183d6ddd00c 100644
> --- a/scripts/install.sh
> +++ b/scripts/install.sh
> @@ -33,21 +33,21 @@ verify "$3"
>
>  # User may have a custom install script
>
> -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
> -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
> +if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi
> +if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
>
>  # Default install - same as make zlilo
>
> -if [ -f $4/vmlinuz ]; then
> -       mv $4/vmlinuz $4/vmlinuz.old
> +if [ -f "$4"/vmlinuz ]; then
> +       mv "$4"/vmlinuz "$4"/vmlinuz.old
>  fi


Another way of quoting is doing like this:

  if [ -f "$4/vmlinuz" ]; then
       mv "$4/vmlinuz" "$4/vmlinuz.old"
  fi


shellcheck is still satisfied.





Because you will add more quotes,
quoting the whole of each parameter might be cleaner.

See my comment in 07/20.








> -if [ -f $4/System.map ]; then
> -       mv $4/System.map $4/System.old
> +if [ -f "$4"/System.map ]; then
> +       mv "$4"/System.map "$4"/System.old
>  fi
>
> -cat $2 > $4/vmlinuz
> -cp $3 $4/System.map
> +cat "$2" > "$4"/vmlinuz
> +cp "$3" "$4"/System.map
>
>  if [ -x /sbin/lilo ]; then
>         /sbin/lilo
> --
> 2.31.1
>


--
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 03/20] kbuild: scripts/install.sh: provide a "install" function
  2021-04-07  5:34 ` [PATCH 03/20] kbuild: scripts/install.sh: provide a "install" function Greg Kroah-Hartman
@ 2021-04-07 11:01   ` Masahiro Yamada
  0 siblings, 0 replies; 70+ messages in thread
From: Masahiro Yamada @ 2021-04-07 11:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Michal Marek, Linux Kbuild mailing list, linux-arch,
	Linux Kernel Mailing List

On Wed, Apr 7, 2021 at 2:34 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> Instead of open-coding the "test for file, if present make a backup,
> then copy the file to the new location" in multiple places, make a
> single function, install(), to do all of this in one place.
>
> Note, this does change the default x86 kernel map file saved name from
> "System.old" to "System.map.old".  This brings it into unification with
> the other architectures as to what they call their backup file for the
> kernel map file.  As this is a text file, and nothing parses this from a
> backup file, there should not be any operational differences.
>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  scripts/install.sh | 26 +++++++++++++++-----------
>  1 file changed, 15 insertions(+), 11 deletions(-)
>
> diff --git a/scripts/install.sh b/scripts/install.sh
> index c183d6ddd00c..af36c0a82f01 100644
> --- a/scripts/install.sh
> +++ b/scripts/install.sh
> @@ -27,6 +27,19 @@ verify () {
>         fi
>  }
>
> +install () {
> +       install_source=${1}
> +       install_target=${2}



You double-quoted all variables in 02/20.

For consistency and safety here,

           install_source="${1}"

or

           install_source="$1"


so that it will work even if $1 contains spaces.





> +
> +       echo "installing '${install_source}' to '${install_target}'"
> +
> +       # if the target is already present, move it to a .old filename
> +       if [ -f "${install_target}" ]; then
> +               mv "${install_target}" "${install_target}".old
> +       fi
> +       cat "${install_source}" > "${install_target}"
> +}
> +
>  # Make sure the files actually exist
>  verify "$2"
>  verify "$3"
> @@ -37,17 +50,8 @@ if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi
>  if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
>
>  # Default install - same as make zlilo
> -
> -if [ -f "$4"/vmlinuz ]; then
> -       mv "$4"/vmlinuz "$4"/vmlinuz.old
> -fi
> -
> -if [ -f "$4"/System.map ]; then
> -       mv "$4"/System.map "$4"/System.old
> -fi
> -
> -cat "$2" > "$4"/vmlinuz
> -cp "$3" "$4"/System.map
> +install "$2" "$4"/vmlinuz
> +install "$3" "$4"/System.map
>
>  if [ -x /sbin/lilo ]; then
>         /sbin/lilo
> --
> 2.31.1
>


--
Best Regards

Masahiro Yamada

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 04/20] kbuild: scripts/install.sh: call sync before calling the bootloader installer
  2021-04-07  5:34 ` [PATCH 04/20] kbuild: scripts/install.sh: call sync before calling the bootloader installer Greg Kroah-Hartman
@ 2021-04-07 11:03   ` Masahiro Yamada
  0 siblings, 0 replies; 70+ messages in thread
From: Masahiro Yamada @ 2021-04-07 11:03 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Michal Marek, Linux Kbuild mailing list, linux-arch,
	Linux Kernel Mailing List

On Wed, Apr 7, 2021 at 2:34 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> It's good to ensure that the files are written out before calling the
> bootloader installer, as other architectures do, so call sync after
> doing the copying of the kernel and system map files.


I see 3 architectures that call 'sync' from install.sh

masahiro@grover:~/ref/linux$ find . -name install.sh  | xargs grep sync
./arch/nios2/boot/install.sh:sync
./arch/x86/boot/install.sh:       sync
./arch/m68k/install.sh:sync


As for nios2 and m68k, they do not call
any bootloader-specific setups.



> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  scripts/install.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/install.sh b/scripts/install.sh
> index af36c0a82f01..92d0d2ade414 100644
> --- a/scripts/install.sh
> +++ b/scripts/install.sh
> @@ -52,12 +52,12 @@ if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
>  # Default install - same as make zlilo
>  install "$2" "$4"/vmlinuz
>  install "$3" "$4"/System.map
> +sync
>
>  if [ -x /sbin/lilo ]; then
>         /sbin/lilo
>  elif [ -x /etc/lilo/install ]; then
>         /etc/lilo/install
>  else
> -       sync
>         echo "Cannot find LILO."
>  fi
> --
> 2.31.1
>

Why do we need 'sync' before lilo invocation?



If you want to ensure everything is flushed
to a disk before this scripts exits,
adding 'sync' at the end of the script
makes more sense, in my opinion.



   if [ -x /sbin/lilo ]; then
          /sbin/lilo
   elif [ -x /etc/lilo/install ]; then
          /etc/lilo/install
   else
         echo "Cannot find LILO."
   fi

   sync




This goes aligned with nios2 and m68k.



--
Best Regards

Masahiro Yamada

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 06/20] kbuild: scripts/install.sh: handle compressed/uncompressed kernel images
  2021-04-07  5:34 ` [PATCH 06/20] kbuild: scripts/install.sh: handle compressed/uncompressed kernel images Greg Kroah-Hartman
@ 2021-04-07 11:04   ` Masahiro Yamada
  0 siblings, 0 replies; 70+ messages in thread
From: Masahiro Yamada @ 2021-04-07 11:04 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Michal Marek, Linux Kbuild mailing list, linux-arch,
	Linux Kernel Mailing List

On Wed, Apr 7, 2021 at 2:34 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> For x86, the default kernel image is compressed, but other architectures
> allowed both compressed and uncompressed kernel images to be built.  Add
> a test to detect which one this is, and either name the output file
> "vmlinuz" for a compressed image, or "vmlinux" for an uncompressed
> image.
>
> For x86 this change is a no-op, but other architectures depend on this.
>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  scripts/install.sh | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/install.sh b/scripts/install.sh
> index 2adcb993efa2..72dc4c81013e 100644
> --- a/scripts/install.sh
> +++ b/scripts/install.sh
> @@ -49,8 +49,18 @@ verify "$3"
>  if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi
>  if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
>
> -# Default install - same as make zlilo
> -install "$2" "$4"/vmlinuz
> +base=$(basename "$2")
> +if [ "$base" = "bzImage" ]; then
> +       # Compressed install
> +       echo "Installing compressed kernel"



After applying this series, I think the excessive
"Installing ..." messages are a bit annoying.


masahiro@grover:~/workspace/linux-kbuild$ make INSTALL_PATH=~/foo install
sh ./scripts/install.sh 5.12.0-rc3+ arch/x86/boot/bzImage \
System.map "/home/masahiro/foo"
Installing compressed kernel
installing 'arch/x86/boot/bzImage' to '/home/masahiro/foo/vmlinuz'
installing 'System.map' to '/home/masahiro/foo/System.map'
Cannot find LILO, ensure your bootloader knows of the new kernel image.



Since 03/20 added a new log in the 'install' function,
can we drop this "Installing compressed kernel" message?




> +       base=vmlinuz
> +else
> +       # Normal install
> +       echo "Installing normal kernel"


Same here.

This message tends to be wrong.
For example, arch/arm/boot/uImage is gzip-compressed,
but it says "Installing normal kernel".







> +       base=vmlinux
> +fi
> +
> +install "$2" "$4"/"$base"
>  install "$3" "$4"/System.map
>  sync
>
> --
> 2.31.1
>


--
Best Regards

Masahiro Yamada

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 07/20] kbuild: scripts/install.sh: allow for the version number
  2021-04-07  5:34 ` [PATCH 07/20] kbuild: scripts/install.sh: allow for the version number Greg Kroah-Hartman
@ 2021-04-07 11:05   ` Masahiro Yamada
  2021-04-07 13:03     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 70+ messages in thread
From: Masahiro Yamada @ 2021-04-07 11:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Michal Marek, Linux Kbuild mailing list, linux-arch,
	Linux Kernel Mailing List

On Wed, Apr 7, 2021 at 2:35 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> Some architectures put the version number by default at the end of the
> files that are copied, so add support for this to be set by arch type.
>
> Odds are one day we should change this for x86, but let's not break
> anyone's systems just yet.
>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  scripts/install.sh | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/install.sh b/scripts/install.sh
> index 72dc4c81013e..934619f81119 100644
> --- a/scripts/install.sh
> +++ b/scripts/install.sh
> @@ -60,8 +60,19 @@ else
>         base=vmlinux
>  fi
>
> -install "$2" "$4"/"$base"
> -install "$3" "$4"/System.map
> +# Some architectures name their files based on version number, and
> +# others do not.  Call out the ones that do not to make it obvious.
> +case "${ARCH}" in
> +       x86)
> +               version=""
> +               ;;
> +       *)
> +               version="-${1}"
> +               ;;
> +esac
> +
> +install "$2" "$4"/"$base""$version"


Too many quotes are eye sore.


    install "$2" "$4/$base$version"

looks cleaner in my opinion.

Shell correctly understands the end of each
variable because a slash or a dollar
cannot be a part of a variable name.







> +install "$3" "$4"/System.map"$version"
>  sync
>
>  # Some architectures like to call specific bootloader "helper" programs:
> --
> 2.31.1
>


--
Best Regards

Masahiro Yamada

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 13/20] kbuild: nds32: convert to use the common install scripts
  2021-04-07  5:34 ` [PATCH 13/20] kbuild: nds32: convert to use the common install scripts Greg Kroah-Hartman
@ 2021-04-07 11:20   ` Masahiro Yamada
  0 siblings, 0 replies; 70+ messages in thread
From: Masahiro Yamada @ 2021-04-07 11:20 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Michal Marek, Linux Kbuild mailing list, linux-arch,
	Linux Kernel Mailing List, Nick Hu, Greentime Hu, Vincent Chen

On Wed, Apr 7, 2021 at 2:35 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> It seems that no one ever checked in the nds32 install script so trying
> to build a nds32 kernel would never quite work properly as 'make
> install' would fail to run.
>
> Fix that up by having nds32 call the common install.sh script.
>
> Cc: Nick Hu <nickhu@andestech.com>
> Cc: Greentime Hu <green.hu@gmail.com>
> Cc: Vincent Chen <deanbo422@gmail.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  arch/nds32/boot/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/nds32/boot/Makefile b/arch/nds32/boot/Makefile
> index c4cc0c2689f7..8371e02f6091 100644
> --- a/arch/nds32/boot/Makefile
> +++ b/arch/nds32/boot/Makefile
> @@ -8,9 +8,9 @@ $(obj)/Image.gz: $(obj)/Image FORCE
>         $(call if_changed,gzip)
>
>  install: $(obj)/Image
> -       $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
> +       $(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \
>         $(obj)/Image System.map "$(INSTALL_PATH)"
>
>  zinstall: $(obj)/Image.gz
> -       $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
> +       $(CONFIG_SHELL) $(srctree)/scripts/install.sh $(KERNELRELEASE) \
>         $(obj)/Image.gz System.map "$(INSTALL_PATH)"
> --
> 2.31.1
>


Even with this patch, the 'install' target does not work.

$ make ARCH=nds32 install
make: *** No rule to make target 'install'.  Stop.




If you really want to fix it, you need
to add something like follows:





diff --git a/arch/nds32/Makefile b/arch/nds32/Makefile
index ccdca7142020..3486b78da9ca 100644
--- a/arch/nds32/Makefile
+++ b/arch/nds32/Makefile
@@ -53,6 +53,9 @@ core-y += $(boot)/dts/
 Image: vmlinux
        $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

+PHONY += install zinstall
+install zinstall:
+       $(Q)$(MAKE) $(build)=$(boot) $@

 PHONY += vdso_install
 vdso_install:





Anyway, I agree that nds32 installation targets are
terribly broken.


--
Best Regards
Masahiro Yamada

^ permalink raw reply related	[flat|nested] 70+ messages in thread

* Re: [PATCH 15/20] kbuild: parisc: use common install script
  2021-04-07  5:34 ` [PATCH 15/20] kbuild: parisc: " Greg Kroah-Hartman
@ 2021-04-07 11:23   ` Masahiro Yamada
  2021-04-14 16:30     ` Helge Deller
  0 siblings, 1 reply; 70+ messages in thread
From: Masahiro Yamada @ 2021-04-07 11:23 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Michal Marek, Linux Kbuild mailing list, linux-arch,
	Linux Kernel Mailing List, James E.J. Bottomley, Helge Deller,
	linux-parisc

On Wed, Apr 7, 2021 at 2:34 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> The common scripts/install.sh script will now work for parisc, all that
> is needed is to add the compressed image type to it.  So add that file
> type check, and then we can remove the two different copies of the
> parisc install.sh script that were only different by one line and have
> the arch call the common install script.
>
> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
> Cc: Helge Deller <deller@gmx.de>
> Cc: linux-parisc@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  arch/parisc/Makefile        |  4 +--
>  arch/parisc/boot/Makefile   |  2 +-
>  arch/parisc/boot/install.sh | 65 ------------------------------------
>  arch/parisc/install.sh      | 66 -------------------------------------
>  scripts/install.sh          |  1 +
>  5 files changed, 4 insertions(+), 134 deletions(-)
>  delete mode 100644 arch/parisc/boot/install.sh
>  delete mode 100644 arch/parisc/install.sh
>
> diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
> index 7d9f71aa829a..296d8ab8e2aa 100644
> --- a/arch/parisc/Makefile
> +++ b/arch/parisc/Makefile
> @@ -164,10 +164,10 @@ vmlinuz: vmlinux
>  endif
>
>  install:
> -       $(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
> +       $(CONFIG_SHELL) $(srctree)/scripts/install.sh \
>                         $(KERNELRELEASE) vmlinux System.map "$(INSTALL_PATH)"
>  zinstall:
> -       $(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
> +       $(CONFIG_SHELL) $(srctree)/scripts/install.sh \
>                         $(KERNELRELEASE) vmlinuz System.map "$(INSTALL_PATH)"
>
>  CLEAN_FILES    += lifimage
> diff --git a/arch/parisc/boot/Makefile b/arch/parisc/boot/Makefile
> index 61f44142cfe1..ad2611929aee 100644
> --- a/arch/parisc/boot/Makefile
> +++ b/arch/parisc/boot/Makefile
> @@ -17,5 +17,5 @@ $(obj)/compressed/vmlinux: FORCE
>         $(Q)$(MAKE) $(build)=$(obj)/compressed $@
>
>  install: $(CONFIGURE) $(obj)/bzImage
> -       sh -x  $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
> +       sh -x  $(srctree)/scripts/install.sh $(KERNELRELEASE) $(obj)/bzImage \
>               System.map "$(INSTALL_PATH)"



As far as I understood, there is no way to invoke this 'install' target
in arch/parisc/boot/Makefile since everything is done
by arch/parisc/Makefile.



Can we remove this 'install' rule entirely?










> diff --git a/arch/parisc/boot/install.sh b/arch/parisc/boot/install.sh
> deleted file mode 100644
> index 8f7c365fad83..000000000000
> --- a/arch/parisc/boot/install.sh
> +++ /dev/null
> @@ -1,65 +0,0 @@
> -#!/bin/sh
> -#
> -# arch/parisc/install.sh, derived from arch/i386/boot/install.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
> -#
> -# "make install" script for i386 architecture
> -#
> -# Arguments:
> -#   $1 - kernel version
> -#   $2 - kernel image file
> -#   $3 - kernel map file
> -#   $4 - default install path (blank if root directory)
> -#
> -
> -verify () {
> -       if [ ! -f "$1" ]; then
> -               echo ""                                                   1>&2
> -               echo " *** Missing file: $1"                              1>&2
> -               echo ' *** You need to run "make" before "make install".' 1>&2
> -               echo ""                                                   1>&2
> -               exit 1
> -       fi
> -}
> -
> -# Make sure the files actually exist
> -
> -verify "$2"
> -verify "$3"
> -
> -# User may have a custom install script
> -
> -if [ -n "${INSTALLKERNEL}" ]; then
> -  if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
> -  if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
> -fi
> -
> -# Default install
> -
> -if [ "$(basename $2)" = "zImage" ]; then
> -# Compressed install
> -  echo "Installing compressed kernel"
> -  base=vmlinuz
> -else
> -# Normal install
> -  echo "Installing normal kernel"
> -  base=vmlinux
> -fi
> -
> -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
> diff --git a/arch/parisc/install.sh b/arch/parisc/install.sh
> deleted file mode 100644
> index 056d588befdd..000000000000
> --- a/arch/parisc/install.sh
> +++ /dev/null
> @@ -1,66 +0,0 @@
> -#!/bin/sh
> -#
> -# arch/parisc/install.sh, derived from arch/i386/boot/install.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
> -#
> -# "make install" script for i386 architecture
> -#
> -# Arguments:
> -#   $1 - kernel version
> -#   $2 - kernel image file
> -#   $3 - kernel map file
> -#   $4 - default install path (blank if root directory)
> -#
> -
> -verify () {
> -       if [ ! -f "$1" ]; then
> -               echo ""                                                   1>&2
> -               echo " *** Missing file: $1"                              1>&2
> -               echo ' *** You need to run "make" before "make install".' 1>&2
> -               echo ""                                                   1>&2
> -               exit 1
> -       fi
> -}
> -
> -# Make sure the files actually exist
> -
> -verify "$2"
> -verify "$3"
> -
> -# User may have a custom install script
> -
> -if [ -n "${INSTALLKERNEL}" ]; then
> -  if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
> -  if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
> -fi
> -
> -# Default install
> -
> -if [ "$(basename $2)" = "vmlinuz" ]; then
> -# Compressed install
> -  echo "Installing compressed kernel"
> -  base=vmlinuz
> -else
> -# Normal install
> -  echo "Installing normal kernel"
> -  base=vmlinux
> -fi
> -
> -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
> -
> diff --git a/scripts/install.sh b/scripts/install.sh
> index 407ffa65062c..e0ffb95737d4 100644
> --- a/scripts/install.sh
> +++ b/scripts/install.sh
> @@ -53,6 +53,7 @@ base=$(basename "$2")
>  if [ "$base" = "bzImage" ] ||
>     [ "$base" = "Image.gz" ] ||
>     [ "$base" = "vmlinux.gz" ] ||
> +   [ "$base" = "vmlinuz" ] ||
>     [ "$base" = "zImage" ] ; then
>         # Compressed install
>         echo "Installing compressed kernel"
> --
> 2.31.1
>


--
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 16/20] kbuild: powerpc: use common install script
  2021-04-07  5:34   ` Greg Kroah-Hartman
@ 2021-04-07 11:32     ` Masahiro Yamada
  -1 siblings, 0 replies; 70+ messages in thread
From: Masahiro Yamada @ 2021-04-07 11:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Michael Ellerman
  Cc: Michal Marek, Linux Kbuild mailing list, linux-arch,
	Linux Kernel Mailing List, linuxppc-dev

On Wed, Apr 7, 2021 at 2:34 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> The common scripts/install.sh script will now work for powerpc, all that
> is needed is to add it to the list of arches that do not put the version
> number in the installed file name.
>
> After the kernel is installed, powerpc also likes to install a few
> random files, so provide the ability to do that as well.
>
> With that we can remove the powerpc-only version of the install script.
>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  arch/powerpc/boot/Makefile   |  4 +--
>  arch/powerpc/boot/install.sh | 55 ------------------------------------
>  scripts/install.sh           | 14 ++++++++-
>  3 files changed, 15 insertions(+), 58 deletions(-)
>  delete mode 100644 arch/powerpc/boot/install.sh
>
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index 2b8da923ceca..bbfcbd33e0b7 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -442,11 +442,11 @@ $(obj)/zImage.initrd:     $(addprefix $(obj)/, $(initrd-y))
>
>  # Only install the vmlinux
>  install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
> -       sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)"
> +       sh -x $(srctree)/scripts/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)"
>
>  # Install the vmlinux and other built boot targets.
>  zInstall: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
> -       sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^
> +       sh -x $(srctree)/scripts/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^


I want comments from the ppc maintainers
because this code is already broken.


This 'zInstall' target is unreachable.

See commit c913e5f95e546d8d3a9f99ba9908f7e095cbc1fb

It added the new target 'zInstall', but it is not hooked anywhere.
It is completely useless for 6 years, and nobody has pointed it out.
So, I think nobody is caring about this broken code.

One more thing, Kbuild does not recognize it as an installation target
because the 'I' in 'zInstall' is a capital letter.

The name of the installation target must be '*install',
all letters in lower cases.






>  PHONY += install zInstall
>
> diff --git a/arch/powerpc/boot/install.sh b/arch/powerpc/boot/install.sh
> deleted file mode 100644
> index b6a256bc96ee..000000000000
> --- a/arch/powerpc/boot/install.sh
> +++ /dev/null
> @@ -1,55 +0,0 @@
> -#!/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
> -#
> -# Blatantly stolen from in arch/i386/boot/install.sh by Dave Hansen
> -#
> -# "make install" script for ppc64 architecture
> -#
> -# Arguments:
> -#   $1 - kernel version
> -#   $2 - kernel image file
> -#   $3 - kernel map file
> -#   $4 - default install path (blank if root directory)
> -#   $5 and more - kernel boot files; zImage*, uImage, cuImage.*, etc.
> -#
> -
> -# Bail with error code if anything goes wrong
> -set -e
> -
> -# User may have a custom install script
> -
> -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
> -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
> -
> -# Default install
> -
> -# this should work for both the pSeries zImage and the iSeries vmlinux.sm
> -image_name=`basename $2`
> -
> -if [ -f $4/$image_name ]; then
> -       mv $4/$image_name $4/$image_name.old
> -fi
> -
> -if [ -f $4/System.map ]; then
> -       mv $4/System.map $4/System.old
> -fi
> -
> -cat $2 > $4/$image_name
> -cp $3 $4/System.map
> -
> -# Copy all the bootable image files
> -path=$4
> -shift 4
> -while [ $# -ne 0 ]; do
> -       image_name=`basename $1`
> -       if [ -f $path/$image_name ]; then
> -               mv $path/$image_name $path/$image_name.old
> -       fi
> -       cat $1 > $path/$image_name
> -       shift
> -done;
> diff --git a/scripts/install.sh b/scripts/install.sh
> index e0ffb95737d4..67c0a5f74af2 100644
> --- a/scripts/install.sh
> +++ b/scripts/install.sh
> @@ -67,7 +67,7 @@ fi
>  # Some architectures name their files based on version number, and
>  # others do not.  Call out the ones that do not to make it obvious.
>  case "${ARCH}" in
> -       ia64 | m68k | nios2 | x86)
> +       ia64 | m68k | nios2 | powerpc | x86)
>                 version=""
>                 ;;
>         *)
> @@ -93,6 +93,18 @@ case "${ARCH}" in
>                         /usr/sbin/elilo
>                 fi
>                 ;;
> +       powerpc)
> +               # powerpc installation can list other boot targets after the
> +               # install path that should be copied to the correct location


Perhaps, we can remove this if the ppc maintainers approve it ?




> +               path=$4
> +               shift 4
> +               while [ $# -ne 0 ]; do
> +                       image_name=$(basename "$1")
> +                       install "$1" "$path"/"$image_name"
> +                       shift
> +               done;
> +               sync
> +               ;;
>         x86)
>                 if [ -x /sbin/lilo ]; then
>                         /sbin/lilo
> --
> 2.31.1
>


--
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 16/20] kbuild: powerpc: use common install script
@ 2021-04-07 11:32     ` Masahiro Yamada
  0 siblings, 0 replies; 70+ messages in thread
From: Masahiro Yamada @ 2021-04-07 11:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Michael Ellerman
  Cc: linux-arch, Michal Marek, linuxppc-dev,
	Linux Kernel Mailing List, Linux Kbuild mailing list

On Wed, Apr 7, 2021 at 2:34 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> The common scripts/install.sh script will now work for powerpc, all that
> is needed is to add it to the list of arches that do not put the version
> number in the installed file name.
>
> After the kernel is installed, powerpc also likes to install a few
> random files, so provide the ability to do that as well.
>
> With that we can remove the powerpc-only version of the install script.
>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  arch/powerpc/boot/Makefile   |  4 +--
>  arch/powerpc/boot/install.sh | 55 ------------------------------------
>  scripts/install.sh           | 14 ++++++++-
>  3 files changed, 15 insertions(+), 58 deletions(-)
>  delete mode 100644 arch/powerpc/boot/install.sh
>
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index 2b8da923ceca..bbfcbd33e0b7 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -442,11 +442,11 @@ $(obj)/zImage.initrd:     $(addprefix $(obj)/, $(initrd-y))
>
>  # Only install the vmlinux
>  install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
> -       sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)"
> +       sh -x $(srctree)/scripts/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)"
>
>  # Install the vmlinux and other built boot targets.
>  zInstall: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
> -       sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^
> +       sh -x $(srctree)/scripts/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^


I want comments from the ppc maintainers
because this code is already broken.


This 'zInstall' target is unreachable.

See commit c913e5f95e546d8d3a9f99ba9908f7e095cbc1fb

It added the new target 'zInstall', but it is not hooked anywhere.
It is completely useless for 6 years, and nobody has pointed it out.
So, I think nobody is caring about this broken code.

One more thing, Kbuild does not recognize it as an installation target
because the 'I' in 'zInstall' is a capital letter.

The name of the installation target must be '*install',
all letters in lower cases.






>  PHONY += install zInstall
>
> diff --git a/arch/powerpc/boot/install.sh b/arch/powerpc/boot/install.sh
> deleted file mode 100644
> index b6a256bc96ee..000000000000
> --- a/arch/powerpc/boot/install.sh
> +++ /dev/null
> @@ -1,55 +0,0 @@
> -#!/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
> -#
> -# Blatantly stolen from in arch/i386/boot/install.sh by Dave Hansen
> -#
> -# "make install" script for ppc64 architecture
> -#
> -# Arguments:
> -#   $1 - kernel version
> -#   $2 - kernel image file
> -#   $3 - kernel map file
> -#   $4 - default install path (blank if root directory)
> -#   $5 and more - kernel boot files; zImage*, uImage, cuImage.*, etc.
> -#
> -
> -# Bail with error code if anything goes wrong
> -set -e
> -
> -# User may have a custom install script
> -
> -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
> -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
> -
> -# Default install
> -
> -# this should work for both the pSeries zImage and the iSeries vmlinux.sm
> -image_name=`basename $2`
> -
> -if [ -f $4/$image_name ]; then
> -       mv $4/$image_name $4/$image_name.old
> -fi
> -
> -if [ -f $4/System.map ]; then
> -       mv $4/System.map $4/System.old
> -fi
> -
> -cat $2 > $4/$image_name
> -cp $3 $4/System.map
> -
> -# Copy all the bootable image files
> -path=$4
> -shift 4
> -while [ $# -ne 0 ]; do
> -       image_name=`basename $1`
> -       if [ -f $path/$image_name ]; then
> -               mv $path/$image_name $path/$image_name.old
> -       fi
> -       cat $1 > $path/$image_name
> -       shift
> -done;
> diff --git a/scripts/install.sh b/scripts/install.sh
> index e0ffb95737d4..67c0a5f74af2 100644
> --- a/scripts/install.sh
> +++ b/scripts/install.sh
> @@ -67,7 +67,7 @@ fi
>  # Some architectures name their files based on version number, and
>  # others do not.  Call out the ones that do not to make it obvious.
>  case "${ARCH}" in
> -       ia64 | m68k | nios2 | x86)
> +       ia64 | m68k | nios2 | powerpc | x86)
>                 version=""
>                 ;;
>         *)
> @@ -93,6 +93,18 @@ case "${ARCH}" in
>                         /usr/sbin/elilo
>                 fi
>                 ;;
> +       powerpc)
> +               # powerpc installation can list other boot targets after the
> +               # install path that should be copied to the correct location


Perhaps, we can remove this if the ppc maintainers approve it ?




> +               path=$4
> +               shift 4
> +               while [ $# -ne 0 ]; do
> +                       image_name=$(basename "$1")
> +                       install "$1" "$path"/"$image_name"
> +                       shift
> +               done;
> +               sync
> +               ;;
>         x86)
>                 if [ -x /sbin/lilo ]; then
>                         /sbin/lilo
> --
> 2.31.1
>


--
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 20/20] kbuild: scripts/install.sh: update documentation
  2021-04-07  5:34 ` [PATCH 20/20] kbuild: scripts/install.sh: update documentation Greg Kroah-Hartman
@ 2021-04-07 11:45   ` Masahiro Yamada
  0 siblings, 0 replies; 70+ messages in thread
From: Masahiro Yamada @ 2021-04-07 11:45 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Michal Marek, Linux Kbuild mailing list, linux-arch,
	Linux Kernel Mailing List

On Wed, Apr 7, 2021 at 2:35 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> Add a proper SPDX line and document the install.sh file a lot better,
> explaining exactly what it does, and update the copyright notice and
> provide a better message about the lack of LILO being present or not as
> really, no one should be using that anymore...
>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  scripts/install.sh | 33 ++++++++++++++++++++++++++-------
>  1 file changed, 26 insertions(+), 7 deletions(-)
>
> diff --git a/scripts/install.sh b/scripts/install.sh
> index 225b19bbbfa6..dd86fb9971e9 100644
> --- a/scripts/install.sh
> +++ b/scripts/install.sh
> @@ -1,14 +1,14 @@
>  #!/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.
> +# SPDX-License-Identifier: GPL-2.0
>  #
>  # Copyright (C) 1995 by Linus Torvalds
> +# Copyright (C) 2021 Greg Kroah-Hartman
>  #
>  # Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
> +# Adapted from code in arch/i386/boot/install.sh by Russell King

Perhaps, this line can go to
"10/20 kbuild: arm: use common install script"  ?




> +# Adapted from code in arch/arm/boot/install.sh by Stuart Menefy

I think this line came from 18/20,
but do we need to keep it?

You removed arch/sh/boot/compressed/install.sh entirely.



>  #
> -# "make install" script for i386 architecture
> +# "make install" script for Linux to be used by all architectures.
>  #
>  # Arguments:
>  #   $1 - kernel version
> @@ -16,6 +16,26 @@
>  #   $3 - kernel map file
>  #   $4 - default install path (blank if root directory)
>  #
> +# Installs the built kernel image and map and symbol file in the specified
> +# install location.  If no install path is selected, the files will be placed
> +# in the root directory.
> +#
> +# The name of the kernel image will be "vmlinux-VERSION" for uncompressed
> +# kernels or "vmlinuz-VERSION' for compressed kernels.
> +#
> +# The kernel map file will be named "System.map-VERSION"
> +#
> +# Note, not all architectures seem to like putting the VERSION number in the
> +# file name, see below in the script for a list of those that do not.  For
> +# those that do not the "-VERSION" will not be present in the file name.
> +#
> +# If there is currently a kernel image or kernel map file present with the name
> +# of the file to be copied to the location, it will be renamed to contain a
> +# ".old" suffix.
> +#
> +# If ~/bin/${INSTALLKERNEL} or /sbin/${INSTALLKERNEL} is executable, execution
> +# will be passed to that program instead of this one to allow for distro or
> +# system specific installation scripts to be used.
>
>  verify () {
>         if [ ! -f "$1" ]; then
> @@ -45,7 +65,6 @@ verify "$2"
>  verify "$3"
>
>  # User may have a custom install script
> -
>  if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi
>  if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
>
> @@ -111,7 +130,7 @@ case "${ARCH}" in
>                 elif [ -x /etc/lilo/install ]; then
>                         /etc/lilo/install
>                 else
> -                       echo "Cannot find LILO."
> +                       echo "Cannot find LILO, ensure your bootloader knows of the new kernel image."


Since you soften the message, I guess this is not a warning message.
I assume it is intentional to put it in stdout instead of stderr.


>                 fi
>                 ;;
>  esac
> --
> 2.31.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 17/20] kbuild: s390: use common install script
  2021-04-07  5:34 ` [PATCH 17/20] kbuild: s390: " Greg Kroah-Hartman
@ 2021-04-07 12:15   ` Heiko Carstens
  2021-04-09  3:10   ` Kees Cook
  1 sibling, 0 replies; 70+ messages in thread
From: Heiko Carstens @ 2021-04-07 12:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Vasily Gorbik, Christian Borntraeger, linux-s390

On Wed, Apr 07, 2021 at 07:34:16AM +0200, Greg Kroah-Hartman wrote:
> The common scripts/install.sh script will now work for s390, no changes
> needed.  So call that instead and delete the s390-only install script.
> 
> Cc: Heiko Carstens <hca@linux.ibm.com>
> Cc: Vasily Gorbik <gor@linux.ibm.com>
> Cc: Christian Borntraeger <borntraeger@de.ibm.com>
> Cc: linux-s390@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  arch/s390/boot/Makefile   |  2 +-
>  arch/s390/boot/install.sh | 30 ------------------------------
>  2 files changed, 1 insertion(+), 31 deletions(-)
>  delete mode 100644 arch/s390/boot/install.sh

Acked-by: Heiko Carstens <hca@linux.ibm.com>

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 07/20] kbuild: scripts/install.sh: allow for the version number
  2021-04-07 11:05   ` Masahiro Yamada
@ 2021-04-07 13:03     ` Greg Kroah-Hartman
  2021-04-07 13:21       ` Masahiro Yamada
  0 siblings, 1 reply; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-07 13:03 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Michal Marek, Linux Kbuild mailing list, linux-arch,
	Linux Kernel Mailing List

On Wed, Apr 07, 2021 at 08:05:23PM +0900, Masahiro Yamada wrote:
> On Wed, Apr 7, 2021 at 2:35 PM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > Some architectures put the version number by default at the end of the
> > files that are copied, so add support for this to be set by arch type.
> >
> > Odds are one day we should change this for x86, but let's not break
> > anyone's systems just yet.
> >
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> >  scripts/install.sh | 15 +++++++++++++--
> >  1 file changed, 13 insertions(+), 2 deletions(-)
> >
> > diff --git a/scripts/install.sh b/scripts/install.sh
> > index 72dc4c81013e..934619f81119 100644
> > --- a/scripts/install.sh
> > +++ b/scripts/install.sh
> > @@ -60,8 +60,19 @@ else
> >         base=vmlinux
> >  fi
> >
> > -install "$2" "$4"/"$base"
> > -install "$3" "$4"/System.map
> > +# Some architectures name their files based on version number, and
> > +# others do not.  Call out the ones that do not to make it obvious.
> > +case "${ARCH}" in
> > +       x86)
> > +               version=""
> > +               ;;
> > +       *)
> > +               version="-${1}"
> > +               ;;
> > +esac
> > +
> > +install "$2" "$4"/"$base""$version"
> 
> 
> Too many quotes are eye sore.
> 
> 
>     install "$2" "$4/$base$version"
> 
> looks cleaner in my opinion.
> 
> Shell correctly understands the end of each
> variable because a slash or a dollar
> cannot be a part of a variable name.

Good idea, I usually just default to "quote everything!" when dealing
with bash variables.  I'll fix this up.

Oh, any preference for "$2" vs. "${2}"?  I don't care either way but I
couldn't tell what is the normal kernel style these days.

thanks for all of the review, much appreciated!

greg k-h

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 07/20] kbuild: scripts/install.sh: allow for the version number
  2021-04-07 13:03     ` Greg Kroah-Hartman
@ 2021-04-07 13:21       ` Masahiro Yamada
  0 siblings, 0 replies; 70+ messages in thread
From: Masahiro Yamada @ 2021-04-07 13:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Michal Marek, Linux Kbuild mailing list, linux-arch,
	Linux Kernel Mailing List

On Wed, Apr 7, 2021 at 10:04 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Wed, Apr 07, 2021 at 08:05:23PM +0900, Masahiro Yamada wrote:
> > On Wed, Apr 7, 2021 at 2:35 PM Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org> wrote:
> > >
> > > Some architectures put the version number by default at the end of the
> > > files that are copied, so add support for this to be set by arch type.
> > >
> > > Odds are one day we should change this for x86, but let's not break
> > > anyone's systems just yet.
> > >
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > ---
> > >  scripts/install.sh | 15 +++++++++++++--
> > >  1 file changed, 13 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/scripts/install.sh b/scripts/install.sh
> > > index 72dc4c81013e..934619f81119 100644
> > > --- a/scripts/install.sh
> > > +++ b/scripts/install.sh
> > > @@ -60,8 +60,19 @@ else
> > >         base=vmlinux
> > >  fi
> > >
> > > -install "$2" "$4"/"$base"
> > > -install "$3" "$4"/System.map
> > > +# Some architectures name their files based on version number, and
> > > +# others do not.  Call out the ones that do not to make it obvious.
> > > +case "${ARCH}" in
> > > +       x86)
> > > +               version=""
> > > +               ;;
> > > +       *)
> > > +               version="-${1}"
> > > +               ;;
> > > +esac
> > > +
> > > +install "$2" "$4"/"$base""$version"
> >
> >
> > Too many quotes are eye sore.
> >
> >
> >     install "$2" "$4/$base$version"
> >
> > looks cleaner in my opinion.
> >
> > Shell correctly understands the end of each
> > variable because a slash or a dollar
> > cannot be a part of a variable name.
>
> Good idea, I usually just default to "quote everything!" when dealing
> with bash variables.  I'll fix this up.
>
> Oh, any preference for "$2" vs. "${2}"?  I don't care either way but I
> couldn't tell what is the normal kernel style these days.


I do not see a well-defined coding style guideline
for shell scripts.

If you want to know my personal preference,
I use "$2" without braces.


Thanks.


>
> thanks for all of the review, much appreciated!

My pleasure.

>
> greg k-h



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 09/20] kbuild: arm64: use common install script
  2021-04-07  5:34   ` Greg Kroah-Hartman
@ 2021-04-07 14:30     ` Catalin Marinas
  -1 siblings, 0 replies; 70+ messages in thread
From: Catalin Marinas @ 2021-04-07 14:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Will Deacon, linux-arm-kernel

On Wed, Apr 07, 2021 at 07:34:08AM +0200, Greg Kroah-Hartman wrote:
> The common scripts/install.sh script will now work for arm65, no changes
> needed so convert the arm64 boot Makefile to call it instead of the
> arm64-only version of the file and remove the now unused file.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Assuming that it does the same thing (it seems to from a quick look):

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 09/20] kbuild: arm64: use common install script
@ 2021-04-07 14:30     ` Catalin Marinas
  0 siblings, 0 replies; 70+ messages in thread
From: Catalin Marinas @ 2021-04-07 14:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Will Deacon, linux-arm-kernel

On Wed, Apr 07, 2021 at 07:34:08AM +0200, Greg Kroah-Hartman wrote:
> The common scripts/install.sh script will now work for arm65, no changes
> needed so convert the arm64 boot Makefile to call it instead of the
> arm64-only version of the file and remove the now unused file.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Assuming that it does the same thing (it seems to from a quick look):

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 11/20] kbuild: ia64: use common install script
  2021-04-07  5:34 ` [PATCH 11/20] kbuild: ia64: " Greg Kroah-Hartman
@ 2021-04-07 18:02   ` Sergei Trofimovich
  2021-04-09  3:10   ` Kees Cook
  1 sibling, 0 replies; 70+ messages in thread
From: Sergei Trofimovich @ 2021-04-07 18:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, linux-ia64

On Wed,  7 Apr 2021 07:34:10 +0200
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> The common scripts/install.sh script will now work for ia64, all that
> is needed is to add the compressed image type to it.  So add that file
> type check and the ability to call /usr/sbin/elilo after copying the
> kernel.  With that we can remove the ia64-only version of the file.
> 
> Cc: linux-ia64@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Sergei Trofimovich <slyfox@gentoo.org>

> ---
>  arch/ia64/Makefile   |  2 +-
>  arch/ia64/install.sh | 40 ----------------------------------------
>  scripts/install.sh   |  8 +++++++-
>  3 files changed, 8 insertions(+), 42 deletions(-)
>  delete mode 100644 arch/ia64/install.sh
> 
> diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
> index 467b7e7f967c..19e20e99f487 100644
> --- a/arch/ia64/Makefile
> +++ b/arch/ia64/Makefile
> @@ -77,7 +77,7 @@ archheaders:
>  CLEAN_FILES += vmlinux.gz
>  
>  install: vmlinux.gz
> -	sh $(srctree)/arch/ia64/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
> +	sh $(srctree)/scripts/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
>  
>  define archhelp
>    echo '* compressed	- Build compressed kernel image'
> diff --git a/arch/ia64/install.sh b/arch/ia64/install.sh
> deleted file mode 100644
> index 0e932f5dcd1a..000000000000
> --- a/arch/ia64/install.sh
> +++ /dev/null
> @@ -1,40 +0,0 @@
> -#!/bin/sh
> -#
> -# arch/ia64/install.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
> -#
> -# "make install" script for ia64 architecture
> -#
> -# Arguments:
> -#   $1 - kernel version
> -#   $2 - kernel image file
> -#   $3 - kernel map file
> -#   $4 - default install path (blank if root directory)
> -#
> -
> -# User may have a custom install script
> -
> -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
> -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
> -
> -# Default install - same as make zlilo
> -
> -if [ -f $4/vmlinuz ]; then
> -	mv $4/vmlinuz $4/vmlinuz.old
> -fi
> -
> -if [ -f $4/System.map ]; then
> -	mv $4/System.map $4/System.old
> -fi
> -
> -cat $2 > $4/vmlinuz
> -cp $3 $4/System.map
> -
> -test -x /usr/sbin/elilo && /usr/sbin/elilo
> diff --git a/scripts/install.sh b/scripts/install.sh
> index 73067b535ea0..b6ca2a0f0983 100644
> --- a/scripts/install.sh
> +++ b/scripts/install.sh
> @@ -52,6 +52,7 @@ if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
>  base=$(basename "$2")
>  if [ "$base" = "bzImage" ] ||
>     [ "$base" = "Image.gz" ] ||
> +   [ "$base" = "vmlinux.gz" ] ||
>     [ "$base" = "zImage" ] ; then
>  	# Compressed install
>  	echo "Installing compressed kernel"
> @@ -65,7 +66,7 @@ fi
>  # Some architectures name their files based on version number, and
>  # others do not.  Call out the ones that do not to make it obvious.
>  case "${ARCH}" in
> -	x86)
> +	ia64 | x86)
>  		version=""
>  		;;
>  	*)
> @@ -86,6 +87,11 @@ case "${ARCH}" in
>  			echo "You have to install it yourself"
>  		fi
>  		;;
> +	ia64)
> +		if [ -x /usr/sbin/elilo ]; then
> +			/usr/sbin/elilo
> +		fi
> +		;;
>  	x86)
>  		if [ -x /sbin/lilo ]; then
>  			/sbin/lilo
> -- 
> 2.31.1
> 


-- 

  Sergei

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 09/20] kbuild: arm64: use common install script
  2021-04-07  5:34   ` Greg Kroah-Hartman
@ 2021-04-09  3:08     ` Kees Cook
  -1 siblings, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Catalin Marinas, Will Deacon, linux-arm-kernel

On Wed, Apr 07, 2021 at 07:34:08AM +0200, Greg Kroah-Hartman wrote:
> The common scripts/install.sh script will now work for arm65, no changes

nit: arm64

> needed so convert the arm64 boot Makefile to call it instead of the
> arm64-only version of the file and remove the now unused file.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

With that fixed:

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 09/20] kbuild: arm64: use common install script
@ 2021-04-09  3:08     ` Kees Cook
  0 siblings, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Catalin Marinas, Will Deacon, linux-arm-kernel

On Wed, Apr 07, 2021 at 07:34:08AM +0200, Greg Kroah-Hartman wrote:
> The common scripts/install.sh script will now work for arm65, no changes

nit: arm64

> needed so convert the arm64 boot Makefile to call it instead of the
> arm64-only version of the file and remove the now unused file.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

With that fixed:

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 01/20] kbuild: move x86 install script to scripts/install.sh
  2021-04-07  5:34 ` [PATCH 01/20] kbuild: move x86 install script to scripts/install.sh Greg Kroah-Hartman
@ 2021-04-09  3:08   ` Kees Cook
  0 siblings, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86

On Wed, Apr 07, 2021 at 07:34:00AM +0200, Greg Kroah-Hartman wrote:
> To unify the different architecture kernel installation scripts, start
> out with the one they all were based on, the x86 script.  Move it from
> arch/x86/boot/ into scripts/ so that all architectures can call it in
> the future.
> 
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: x86@kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 05/20] kbuild: scripts/install.sh: prepare for arch-specific bootloaders
  2021-04-07  5:34 ` [PATCH 05/20] kbuild: scripts/install.sh: prepare for arch-specific bootloaders Greg Kroah-Hartman
@ 2021-04-09  3:08   ` Kees Cook
  0 siblings, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch, linux-kernel

On Wed, Apr 07, 2021 at 07:34:04AM +0200, Greg Kroah-Hartman wrote:
> Despite the last release of LILO being in 2015, it seems that it is
> still the default x86 bootloader and wants to be called to "install" the
> new kernel image when it has been replaced on the disk.  To allow
> arch-specific programs like this to be called in future changes, move
> the logic to an arch-specific test now.
> 
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 18/20] kbuild: sh: remove unused install script
  2021-04-07  5:34 ` [PATCH 18/20] kbuild: sh: remove unused " Greg Kroah-Hartman
@ 2021-04-09  3:09   ` Kees Cook
  2021-08-24 15:22   ` Masahiro Yamada
  1 sibling, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Yoshinori Sato, Rich Felker, linux-sh

On Wed, Apr 07, 2021 at 07:34:17AM +0200, Greg Kroah-Hartman wrote:
> The sh arch has a install.sh script, but no Makefile actually calls it.
> Remove it to keep anyone from accidentally calling it in the future.
> 
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Cc: linux-sh@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 19/20] kbuild: sparc: use common install script
  2021-04-07  5:34 ` [PATCH 19/20] kbuild: sparc: use common " Greg Kroah-Hartman
@ 2021-04-09  3:09   ` Kees Cook
  0 siblings, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, David S. Miller, sparclinux

On Wed, Apr 07, 2021 at 07:34:18AM +0200, Greg Kroah-Hartman wrote:
> The common scripts/install.sh script will now work for sparc, all that
> is needed is to add it to the list of arches that do not put the version
> number in the installed file name.
> 
> With that we can remove the sparc-only version of the install script.
> 
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: sparclinux@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 08/20] kbuild: riscv: use common install script
  2021-04-07  5:34   ` Greg Kroah-Hartman
@ 2021-04-09  3:09     ` Kees Cook
  -1 siblings, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	linux-riscv

On Wed, Apr 07, 2021 at 07:34:07AM +0200, Greg Kroah-Hartman wrote:
> The common scripts/install.sh script will now work for riscv, all that
> is needed is to add the compressed image type to it.  So add that file
> type check and remove the riscv-only version of the file.
> 
> Cc: Paul Walmsley <paul.walmsley@sifive.com>
> Cc: Palmer Dabbelt <palmer@dabbelt.com>
> Cc: Albert Ou <aou@eecs.berkeley.edu>
> Cc: linux-riscv@lists.infradead.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 08/20] kbuild: riscv: use common install script
@ 2021-04-09  3:09     ` Kees Cook
  0 siblings, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	linux-riscv

On Wed, Apr 07, 2021 at 07:34:07AM +0200, Greg Kroah-Hartman wrote:
> The common scripts/install.sh script will now work for riscv, all that
> is needed is to add the compressed image type to it.  So add that file
> type check and remove the riscv-only version of the file.
> 
> Cc: Paul Walmsley <paul.walmsley@sifive.com>
> Cc: Palmer Dabbelt <palmer@dabbelt.com>
> Cc: Albert Ou <aou@eecs.berkeley.edu>
> Cc: linux-riscv@lists.infradead.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 10/20] kbuild: arm: use common install script
  2021-04-07  5:34   ` Greg Kroah-Hartman
@ 2021-04-09  3:09     ` Kees Cook
  -1 siblings, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Russell King, linux-arm-kernel

On Wed, Apr 07, 2021 at 07:34:09AM +0200, Greg Kroah-Hartman wrote:
> The common scripts/install.sh script will now work for arm, all that
> is needed is to add the compressed image type to it.  So add that file
> type check and the ability to call /sbin/loadmap after copying the
> kernel.  With that we can remove the arm-only version of the file.
> 
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 10/20] kbuild: arm: use common install script
@ 2021-04-09  3:09     ` Kees Cook
  0 siblings, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Russell King, linux-arm-kernel

On Wed, Apr 07, 2021 at 07:34:09AM +0200, Greg Kroah-Hartman wrote:
> The common scripts/install.sh script will now work for arm, all that
> is needed is to add the compressed image type to it.  So add that file
> type check and the ability to call /sbin/loadmap after copying the
> kernel.  With that we can remove the arm-only version of the file.
> 
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 14/20] kbuild: nios2: use common install script
  2021-04-07  5:34 ` [PATCH 14/20] kbuild: nios2: use common install script Greg Kroah-Hartman
@ 2021-04-09  3:09   ` Kees Cook
  0 siblings, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Ley Foon Tan

On Wed, Apr 07, 2021 at 07:34:13AM +0200, Greg Kroah-Hartman wrote:
> The common scripts/install.sh script will now work for nios2, all that
> is needed is to add it to the list of arches that do not put the version
> number in the installed file name.
> 
> With that we can remove the nios2-only version of the install script.
> 
> Cc: Ley Foon Tan <ley.foon.tan@intel.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 12/20] kbuild: m68k: use common install script
  2021-04-07  5:34 ` [PATCH 12/20] kbuild: m68k: " Greg Kroah-Hartman
  2021-04-07  7:19   ` Geert Uytterhoeven
@ 2021-04-09  3:10   ` Kees Cook
  1 sibling, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Geert Uytterhoeven, linux-m68k

On Wed, Apr 07, 2021 at 07:34:11AM +0200, Greg Kroah-Hartman wrote:
> The common scripts/install.sh script will now work for m68k, all that
> is needed is to add it to the list of arches that do not put the version
> number in the installed file name.
> 
> With that we can remove the m68k-only version of the install script.
> 
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: linux-m68k@lists.linux-m68k.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 11/20] kbuild: ia64: use common install script
  2021-04-07  5:34 ` [PATCH 11/20] kbuild: ia64: " Greg Kroah-Hartman
  2021-04-07 18:02   ` Sergei Trofimovich
@ 2021-04-09  3:10   ` Kees Cook
  1 sibling, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, linux-ia64

On Wed, Apr 07, 2021 at 07:34:10AM +0200, Greg Kroah-Hartman wrote:
> The common scripts/install.sh script will now work for ia64, all that
> is needed is to add the compressed image type to it.  So add that file
> type check and the ability to call /usr/sbin/elilo after copying the
> kernel.  With that we can remove the ia64-only version of the file.
> 
> Cc: linux-ia64@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 17/20] kbuild: s390: use common install script
  2021-04-07  5:34 ` [PATCH 17/20] kbuild: s390: " Greg Kroah-Hartman
  2021-04-07 12:15   ` Heiko Carstens
@ 2021-04-09  3:10   ` Kees Cook
  1 sibling, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Heiko Carstens, Vasily Gorbik,
	Christian Borntraeger, linux-s390

On Wed, Apr 07, 2021 at 07:34:16AM +0200, Greg Kroah-Hartman wrote:
> The common scripts/install.sh script will now work for s390, no changes
> needed.  So call that instead and delete the s390-only install script.
> 
> Cc: Heiko Carstens <hca@linux.ibm.com>
> Cc: Vasily Gorbik <gor@linux.ibm.com>
> Cc: Christian Borntraeger <borntraeger@de.ibm.com>
> Cc: linux-s390@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 00/20] kbuild: unify the install.sh script usage
  2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
                   ` (20 preceding siblings ...)
  2021-04-07  7:18 ` [PATCH 00/20] kbuild: unify the install.sh script usage Geert Uytterhoeven
@ 2021-04-09  3:12 ` Kees Cook
  21 siblings, 0 replies; 70+ messages in thread
From: Kees Cook @ 2021-04-09  3:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, David S. Miller, James E.J. Bottomley, Albert Ou,
	Borislav Petkov, Catalin Marinas, Christian Borntraeger,
	Geert Uytterhoeven, Greentime Hu, Heiko Carstens, Helge Deller,
	Ingo Molnar, Ley Foon Tan, Michael Ellerman, Nick Hu,
	Palmer Dabbelt, Paul Walmsley, Rich Felker, Russell King,
	Thomas Gleixner, Vasily Gorbik, Vincent Chen, Will Deacon,
	Yoshinori Sato, x86

On Wed, Apr 07, 2021 at 07:33:59AM +0200, Greg Kroah-Hartman wrote:
> Almost every architecture has copied the "install.sh" script that
> originally came with i386, and modified it in very tiny ways.  This
> patch series unifies all of these scripts into one single script to
> allow people to understand how to correctly install a kernel, and fixes
> up some issues regarding trying to install a kernel to a path with
> spaces in it.

Yay consolidation! Thanks for digging into this.

I sent Reviewed-by:s for a bunch of these, and agree with the things
Masahiro has suggested with regard to quoting, etc. I look forward to
v2.

-Kees

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 09/20] kbuild: arm64: use common install script
  2021-04-09  3:08     ` Kees Cook
@ 2021-04-09  6:37       ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-09  6:37 UTC (permalink / raw)
  To: Kees Cook
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Catalin Marinas, Will Deacon, linux-arm-kernel

On Thu, Apr 08, 2021 at 08:08:18PM -0700, Kees Cook wrote:
> On Wed, Apr 07, 2021 at 07:34:08AM +0200, Greg Kroah-Hartman wrote:
> > The common scripts/install.sh script will now work for arm65, no changes
> 
> nit: arm64

Hah!

Thanks for the reviews, I'll be doing a new series soon based on
Masahiro's reviews.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 09/20] kbuild: arm64: use common install script
@ 2021-04-09  6:37       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-09  6:37 UTC (permalink / raw)
  To: Kees Cook
  Cc: Masahiro Yamada, Michal Marek, linux-kbuild, linux-arch,
	linux-kernel, Catalin Marinas, Will Deacon, linux-arm-kernel

On Thu, Apr 08, 2021 at 08:08:18PM -0700, Kees Cook wrote:
> On Wed, Apr 07, 2021 at 07:34:08AM +0200, Greg Kroah-Hartman wrote:
> > The common scripts/install.sh script will now work for arm65, no changes
> 
> nit: arm64

Hah!

Thanks for the reviews, I'll be doing a new series soon based on
Masahiro's reviews.

thanks,

greg k-h

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 15/20] kbuild: parisc: use common install script
  2021-04-07 11:23   ` Masahiro Yamada
@ 2021-04-14 16:30     ` Helge Deller
  2021-04-14 17:51       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 70+ messages in thread
From: Helge Deller @ 2021-04-14 16:30 UTC (permalink / raw)
  To: Masahiro Yamada, Greg Kroah-Hartman
  Cc: Michal Marek, Linux Kbuild mailing list, linux-arch,
	Linux Kernel Mailing List, James E.J. Bottomley, linux-parisc

On 4/7/21 1:23 PM, Masahiro Yamada wrote:
> On Wed, Apr 7, 2021 at 2:34 PM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
>>
>> The common scripts/install.sh script will now work for parisc, all that
>> is needed is to add the compressed image type to it.  So add that file
>> type check, and then we can remove the two different copies of the
>> parisc install.sh script that were only different by one line and have
>> the arch call the common install script.
>>
>> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
>> Cc: Helge Deller <deller@gmx.de>
>> Cc: linux-parisc@vger.kernel.org
>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> ---
>>   arch/parisc/Makefile        |  4 +--
>>   arch/parisc/boot/Makefile   |  2 +-
>>   arch/parisc/boot/install.sh | 65 ------------------------------------
>>   arch/parisc/install.sh      | 66 -------------------------------------
>>   scripts/install.sh          |  1 +
>>   5 files changed, 4 insertions(+), 134 deletions(-)
>>   delete mode 100644 arch/parisc/boot/install.sh
>>   delete mode 100644 arch/parisc/install.sh
>>
>> diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
>> index 7d9f71aa829a..296d8ab8e2aa 100644
>> --- a/arch/parisc/Makefile
>> +++ b/arch/parisc/Makefile
>> @@ -164,10 +164,10 @@ vmlinuz: vmlinux
>>   endif
>>
>>   install:
>> -       $(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
>> +       $(CONFIG_SHELL) $(srctree)/scripts/install.sh \
>>                          $(KERNELRELEASE) vmlinux System.map "$(INSTALL_PATH)"
>>   zinstall:
>> -       $(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
>> +       $(CONFIG_SHELL) $(srctree)/scripts/install.sh \
>>                          $(KERNELRELEASE) vmlinuz System.map "$(INSTALL_PATH)"
>>
>>   CLEAN_FILES    += lifimage
>> diff --git a/arch/parisc/boot/Makefile b/arch/parisc/boot/Makefile
>> index 61f44142cfe1..ad2611929aee 100644
>> --- a/arch/parisc/boot/Makefile
>> +++ b/arch/parisc/boot/Makefile
>> @@ -17,5 +17,5 @@ $(obj)/compressed/vmlinux: FORCE
>>          $(Q)$(MAKE) $(build)=$(obj)/compressed $@
>>
>>   install: $(CONFIGURE) $(obj)/bzImage
>> -       sh -x  $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
>> +       sh -x  $(srctree)/scripts/install.sh $(KERNELRELEASE) $(obj)/bzImage \
>>                System.map "$(INSTALL_PATH)"
>
>
>
> As far as I understood, there is no way to invoke this 'install' target
> in arch/parisc/boot/Makefile since everything is done
> by arch/parisc/Makefile.
>
> Can we remove this 'install' rule entirely?

Yes, I think it can go in arch/parisc/boot/Makefile.

Helge

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 15/20] kbuild: parisc: use common install script
  2021-04-14 16:30     ` Helge Deller
@ 2021-04-14 17:51       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-14 17:51 UTC (permalink / raw)
  To: Helge Deller
  Cc: Masahiro Yamada, Michal Marek, Linux Kbuild mailing list,
	linux-arch, Linux Kernel Mailing List, James E.J. Bottomley,
	linux-parisc

On Wed, Apr 14, 2021 at 06:30:59PM +0200, Helge Deller wrote:
> On 4/7/21 1:23 PM, Masahiro Yamada wrote:
> > On Wed, Apr 7, 2021 at 2:34 PM Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org> wrote:
> > > 
> > > The common scripts/install.sh script will now work for parisc, all that
> > > is needed is to add the compressed image type to it.  So add that file
> > > type check, and then we can remove the two different copies of the
> > > parisc install.sh script that were only different by one line and have
> > > the arch call the common install script.
> > > 
> > > Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
> > > Cc: Helge Deller <deller@gmx.de>
> > > Cc: linux-parisc@vger.kernel.org
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > ---
> > >   arch/parisc/Makefile        |  4 +--
> > >   arch/parisc/boot/Makefile   |  2 +-
> > >   arch/parisc/boot/install.sh | 65 ------------------------------------
> > >   arch/parisc/install.sh      | 66 -------------------------------------
> > >   scripts/install.sh          |  1 +
> > >   5 files changed, 4 insertions(+), 134 deletions(-)
> > >   delete mode 100644 arch/parisc/boot/install.sh
> > >   delete mode 100644 arch/parisc/install.sh
> > > 
> > > diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
> > > index 7d9f71aa829a..296d8ab8e2aa 100644
> > > --- a/arch/parisc/Makefile
> > > +++ b/arch/parisc/Makefile
> > > @@ -164,10 +164,10 @@ vmlinuz: vmlinux
> > >   endif
> > > 
> > >   install:
> > > -       $(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
> > > +       $(CONFIG_SHELL) $(srctree)/scripts/install.sh \
> > >                          $(KERNELRELEASE) vmlinux System.map "$(INSTALL_PATH)"
> > >   zinstall:
> > > -       $(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
> > > +       $(CONFIG_SHELL) $(srctree)/scripts/install.sh \
> > >                          $(KERNELRELEASE) vmlinuz System.map "$(INSTALL_PATH)"
> > > 
> > >   CLEAN_FILES    += lifimage
> > > diff --git a/arch/parisc/boot/Makefile b/arch/parisc/boot/Makefile
> > > index 61f44142cfe1..ad2611929aee 100644
> > > --- a/arch/parisc/boot/Makefile
> > > +++ b/arch/parisc/boot/Makefile
> > > @@ -17,5 +17,5 @@ $(obj)/compressed/vmlinux: FORCE
> > >          $(Q)$(MAKE) $(build)=$(obj)/compressed $@
> > > 
> > >   install: $(CONFIGURE) $(obj)/bzImage
> > > -       sh -x  $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
> > > +       sh -x  $(srctree)/scripts/install.sh $(KERNELRELEASE) $(obj)/bzImage \
> > >                System.map "$(INSTALL_PATH)"
> > 
> > 
> > 
> > As far as I understood, there is no way to invoke this 'install' target
> > in arch/parisc/boot/Makefile since everything is done
> > by arch/parisc/Makefile.
> > 
> > Can we remove this 'install' rule entirely?
> 
> Yes, I think it can go in arch/parisc/boot/Makefile.

It's already there today, so I'll delete the rule from
arch/parisc/Makefile in my next round.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 18/20] kbuild: sh: remove unused install script
  2021-04-07  5:34 ` [PATCH 18/20] kbuild: sh: remove unused " Greg Kroah-Hartman
  2021-04-09  3:09   ` Kees Cook
@ 2021-08-24 15:22   ` Masahiro Yamada
  2021-08-27 14:02     ` Greg Kroah-Hartman
  1 sibling, 1 reply; 70+ messages in thread
From: Masahiro Yamada @ 2021-08-24 15:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Michal Marek, Linux Kbuild mailing list, linux-arch,
	Linux Kernel Mailing List, Yoshinori Sato, Rich Felker,
	Linux-sh list

On Wed, Apr 7, 2021 at 2:35 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> The sh arch has a install.sh script, but no Makefile actually calls it.
> Remove it to keep anyone from accidentally calling it in the future.
>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Cc: linux-sh@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  arch/sh/boot/compressed/install.sh | 56 ------------------------------
>  1 file changed, 56 deletions(-)
>  delete mode 100644 arch/sh/boot/compressed/install.sh
>
> diff --git a/arch/sh/boot/compressed/install.sh b/arch/sh/boot/compressed/install.sh
> deleted file mode 100644
> index f9f41818b17e..000000000000
> --- a/arch/sh/boot/compressed/install.sh
> +++ /dev/null
> @@ -1,56 +0,0 @@
> -#!/bin/sh
> -#
> -# arch/sh/boot/install.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
> -# Adapted from code in arch/arm/boot/install.sh by Stuart Menefy
> -#
> -# "make install" script for sh architecture
> -#
> -# Arguments:
> -#   $1 - kernel version
> -#   $2 - kernel image file
> -#   $3 - kernel map file
> -#   $4 - default install path (blank if root directory)
> -#
> -
> -# User may have a custom install script
> -
> -if [ -x /sbin/${INSTALLKERNEL} ]; then
> -  exec /sbin/${INSTALLKERNEL} "$@"
> -fi
> -
> -if [ "$2" = "zImage" ]; then
> -# Compressed install
> -  echo "Installing compressed kernel"
> -  if [ -f $4/vmlinuz-$1 ]; then
> -    mv $4/vmlinuz-$1 $4/vmlinuz.old
> -  fi
> -
> -  if [ -f $4/System.map-$1 ]; then
> -    mv $4/System.map-$1 $4/System.old
> -  fi
> -
> -  cat $2 > $4/vmlinuz-$1
> -  cp $3 $4/System.map-$1
> -else
> -# Normal install
> -  echo "Installing normal kernel"
> -  if [ -f $4/vmlinux-$1 ]; then
> -    mv $4/vmlinux-$1 $4/vmlinux.old
> -  fi
> -
> -  if [ -f $4/System.map ]; then
> -    mv $4/System.map $4/System.old
> -  fi
> -
> -  cat $2 > $4/vmlinux-$1
> -  cp $3 $4/System.map
> -fi
> --
> 2.31.1
>


This one is applicable independently.

Applied to linux-kbuild. Thanks.



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 18/20] kbuild: sh: remove unused install script
  2021-08-24 15:22   ` Masahiro Yamada
@ 2021-08-27 14:02     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 70+ messages in thread
From: Greg Kroah-Hartman @ 2021-08-27 14:02 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Michal Marek, Linux Kbuild mailing list, linux-arch,
	Linux Kernel Mailing List, Yoshinori Sato, Rich Felker,
	Linux-sh list

On Wed, Aug 25, 2021 at 12:22:03AM +0900, Masahiro Yamada wrote:
> On Wed, Apr 7, 2021 at 2:35 PM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > The sh arch has a install.sh script, but no Makefile actually calls it.
> > Remove it to keep anyone from accidentally calling it in the future.
> >
> > Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> > Cc: Rich Felker <dalias@libc.org>
> > Cc: linux-sh@vger.kernel.org
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> >  arch/sh/boot/compressed/install.sh | 56 ------------------------------
> >  1 file changed, 56 deletions(-)
> >  delete mode 100644 arch/sh/boot/compressed/install.sh
> >
> > diff --git a/arch/sh/boot/compressed/install.sh b/arch/sh/boot/compressed/install.sh
> > deleted file mode 100644
> > index f9f41818b17e..000000000000
> > --- a/arch/sh/boot/compressed/install.sh
> > +++ /dev/null
> > @@ -1,56 +0,0 @@
> > -#!/bin/sh
> > -#
> > -# arch/sh/boot/install.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
> > -# Adapted from code in arch/arm/boot/install.sh by Stuart Menefy
> > -#
> > -# "make install" script for sh architecture
> > -#
> > -# Arguments:
> > -#   $1 - kernel version
> > -#   $2 - kernel image file
> > -#   $3 - kernel map file
> > -#   $4 - default install path (blank if root directory)
> > -#
> > -
> > -# User may have a custom install script
> > -
> > -if [ -x /sbin/${INSTALLKERNEL} ]; then
> > -  exec /sbin/${INSTALLKERNEL} "$@"
> > -fi
> > -
> > -if [ "$2" = "zImage" ]; then
> > -# Compressed install
> > -  echo "Installing compressed kernel"
> > -  if [ -f $4/vmlinuz-$1 ]; then
> > -    mv $4/vmlinuz-$1 $4/vmlinuz.old
> > -  fi
> > -
> > -  if [ -f $4/System.map-$1 ]; then
> > -    mv $4/System.map-$1 $4/System.old
> > -  fi
> > -
> > -  cat $2 > $4/vmlinuz-$1
> > -  cp $3 $4/System.map-$1
> > -else
> > -# Normal install
> > -  echo "Installing normal kernel"
> > -  if [ -f $4/vmlinux-$1 ]; then
> > -    mv $4/vmlinux-$1 $4/vmlinux.old
> > -  fi
> > -
> > -  if [ -f $4/System.map ]; then
> > -    mv $4/System.map $4/System.old
> > -  fi
> > -
> > -  cat $2 > $4/vmlinux-$1
> > -  cp $3 $4/System.map
> > -fi
> > --
> > 2.31.1
> >
> 
> 
> This one is applicable independently.
> 
> Applied to linux-kbuild. Thanks.

Hey, nice, thanks!

I'll work on the rest of the patches in this series after the next merge
window is over...

greg k-h

^ permalink raw reply	[flat|nested] 70+ messages in thread

end of thread, other threads:[~2021-08-27 14:03 UTC | newest]

Thread overview: 70+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07  5:33 [PATCH 00/20] kbuild: unify the install.sh script usage Greg Kroah-Hartman
2021-04-07  5:34 ` [PATCH 01/20] kbuild: move x86 install script to scripts/install.sh Greg Kroah-Hartman
2021-04-09  3:08   ` Kees Cook
2021-04-07  5:34 ` [PATCH 02/20] kbuild: scripts/install.sh: properly quote all variables Greg Kroah-Hartman
2021-04-07 10:59   ` Masahiro Yamada
2021-04-07  5:34 ` [PATCH 03/20] kbuild: scripts/install.sh: provide a "install" function Greg Kroah-Hartman
2021-04-07 11:01   ` Masahiro Yamada
2021-04-07  5:34 ` [PATCH 04/20] kbuild: scripts/install.sh: call sync before calling the bootloader installer Greg Kroah-Hartman
2021-04-07 11:03   ` Masahiro Yamada
2021-04-07  5:34 ` [PATCH 05/20] kbuild: scripts/install.sh: prepare for arch-specific bootloaders Greg Kroah-Hartman
2021-04-09  3:08   ` Kees Cook
2021-04-07  5:34 ` [PATCH 06/20] kbuild: scripts/install.sh: handle compressed/uncompressed kernel images Greg Kroah-Hartman
2021-04-07 11:04   ` Masahiro Yamada
2021-04-07  5:34 ` [PATCH 07/20] kbuild: scripts/install.sh: allow for the version number Greg Kroah-Hartman
2021-04-07 11:05   ` Masahiro Yamada
2021-04-07 13:03     ` Greg Kroah-Hartman
2021-04-07 13:21       ` Masahiro Yamada
2021-04-07  5:34 ` [PATCH 08/20] kbuild: riscv: use common install script Greg Kroah-Hartman
2021-04-07  5:34   ` Greg Kroah-Hartman
2021-04-09  3:09   ` Kees Cook
2021-04-09  3:09     ` Kees Cook
2021-04-07  5:34 ` [PATCH 09/20] kbuild: arm64: " Greg Kroah-Hartman
2021-04-07  5:34   ` Greg Kroah-Hartman
2021-04-07 14:30   ` Catalin Marinas
2021-04-07 14:30     ` Catalin Marinas
2021-04-09  3:08   ` Kees Cook
2021-04-09  3:08     ` Kees Cook
2021-04-09  6:37     ` Greg Kroah-Hartman
2021-04-09  6:37       ` Greg Kroah-Hartman
2021-04-07  5:34 ` [PATCH 10/20] kbuild: arm: " Greg Kroah-Hartman
2021-04-07  5:34   ` Greg Kroah-Hartman
2021-04-09  3:09   ` Kees Cook
2021-04-09  3:09     ` Kees Cook
2021-04-07  5:34 ` [PATCH 11/20] kbuild: ia64: " Greg Kroah-Hartman
2021-04-07 18:02   ` Sergei Trofimovich
2021-04-09  3:10   ` Kees Cook
2021-04-07  5:34 ` [PATCH 12/20] kbuild: m68k: " Greg Kroah-Hartman
2021-04-07  7:19   ` Geert Uytterhoeven
2021-04-09  3:10   ` Kees Cook
2021-04-07  5:34 ` [PATCH 13/20] kbuild: nds32: convert to use the common install scripts Greg Kroah-Hartman
2021-04-07 11:20   ` Masahiro Yamada
2021-04-07  5:34 ` [PATCH 14/20] kbuild: nios2: use common install script Greg Kroah-Hartman
2021-04-09  3:09   ` Kees Cook
2021-04-07  5:34 ` [PATCH 15/20] kbuild: parisc: " Greg Kroah-Hartman
2021-04-07 11:23   ` Masahiro Yamada
2021-04-14 16:30     ` Helge Deller
2021-04-14 17:51       ` Greg Kroah-Hartman
2021-04-07  5:34 ` [PATCH 16/20] kbuild: powerpc: " Greg Kroah-Hartman
2021-04-07  5:34   ` Greg Kroah-Hartman
2021-04-07 11:32   ` Masahiro Yamada
2021-04-07 11:32     ` Masahiro Yamada
2021-04-07  5:34 ` [PATCH 17/20] kbuild: s390: " Greg Kroah-Hartman
2021-04-07 12:15   ` Heiko Carstens
2021-04-09  3:10   ` Kees Cook
2021-04-07  5:34 ` [PATCH 18/20] kbuild: sh: remove unused " Greg Kroah-Hartman
2021-04-09  3:09   ` Kees Cook
2021-08-24 15:22   ` Masahiro Yamada
2021-08-27 14:02     ` Greg Kroah-Hartman
2021-04-07  5:34 ` [PATCH 19/20] kbuild: sparc: use common " Greg Kroah-Hartman
2021-04-09  3:09   ` Kees Cook
2021-04-07  5:34 ` [PATCH 20/20] kbuild: scripts/install.sh: update documentation Greg Kroah-Hartman
2021-04-07 11:45   ` Masahiro Yamada
2021-04-07  7:18 ` [PATCH 00/20] kbuild: unify the install.sh script usage Geert Uytterhoeven
2021-04-07  7:46   ` Greg Kroah-Hartman
2021-04-07  8:02     ` Russell King - ARM Linux admin
2021-04-07  8:07       ` Greg Kroah-Hartman
2021-04-07  8:14         ` Russell King - ARM Linux admin
2021-04-07  8:37           ` Greg Kroah-Hartman
2021-04-07 10:53             ` Masahiro Yamada
2021-04-09  3:12 ` Kees Cook

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.