diff mbox series

[05/20] kbuild: scripts/install.sh: prepare for arch-specific bootloaders

Message ID 20210407053419.449796-6-gregkh@linuxfoundation.org (mailing list archive)
State New
Headers show
Series kbuild: unify the install.sh script usage | expand

Commit Message

Greg KH April 7, 2021, 5:34 a.m. UTC
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(-)

Comments

Kees Cook April 9, 2021, 3:08 a.m. UTC | #1
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>
diff mbox series

Patch

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