Bug#928735: u-boot-menu: Avoid hard-coding "vmlinuz"

2019-05-30 Thread Karsten Merker
On Thu, 09 May 2019, Vagrant Cascadian  wrote:

> Package: u-boot-menu
> Severity: normal
> Version: 3
> Tags: patch
> 
> Some architectures which might make use of u-boot-menu do not have
> kernel files matching "vmlinuz" (e.g. riscv64 has "vmlinux").
> 
> The attached patch uses "linux-version list --paths" to output the path
> of each versioned kernel, which outputs the matching kernel filenames.

Hello,

may I kindly ping you on this bugreport?  I'm working on d-i
support for riscv64 and would like to use the u-boot-menu package
there, but without Vagrant's patch it isn't usable on riscv64
(and on quite a number of other architectures as well, please see
below).  It would be great if you could upload a new version of
u-boot-menu with the patch applied to unstable.  If you are ok
with the patch but don't have time for preparing an upload, I
would offer doing an NMU if that would be ok for you.

An overview of vmlinuz- vs. vmlinux-using Debian architectures:

vmlinuz: alpha, amd64, arm64, armel, armhf, hppa, i386, ia64,
 s390x, sh4

vmlinux: m68k, mips{,64}{,r6}{,el}, powerpc, powerpcspe, ppc64,
 ppc64el, riscv64, sparc64

Regards,
Karsten
-- 
Ich widerspreche hiermit ausdrücklich der Nutzung sowie der
Weitergabe meiner personenbezogenen Daten für Zwecke der Werbung
sowie der Markt- oder Meinungsforschung.



Bug#928735: u-boot-menu: Avoid hard-coding "vmlinuz"

2019-05-09 Thread Vagrant Cascadian
Package: u-boot-menu
Severity: normal
Version: 3
Tags: patch

Some architectures which might make use of u-boot-menu do not have
kernel files matching "vmlinuz" (e.g. riscv64 has "vmlinux").

The attached patch uses "linux-version list --paths" to output the path
of each versioned kernel, which outputs the matching kernel filenames.

live well,
  vagrant

From f33424de3c643127d4f41284f9516ed7a54846af Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian 
Date: Thu, 9 May 2019 14:53:04 -0700
Subject: [PATCH] Use "linux-version list --paths" to avoid hard-coding
 "vmlinuz" kernels.

---
 u-boot-update | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/u-boot-update b/u-boot-update
index 9dd8b0e..bd4ccd2 100755
--- a/u-boot-update
+++ b/u-boot-update
@@ -132,7 +132,7 @@ timeout ${U_BOOT_TIMEOUT}
 "
 
 # Find linux versions
-_VERSIONS="$(linux-version list | linux-version sort --reverse)"
+_VERSIONS=$(linux-version list --paths | linux-version sort --reverse | sed -e 's,.*/boot/,,g')
 
 # Find boot directory as seen in u-boot, and path prefix while in linux
 if [ "$(stat --printf %d /)" = "$(stat --printf %d /boot)" ]
@@ -147,9 +147,11 @@ else
 fi
 
 
-for _VERSION in ${_VERSIONS}
+for _KERNEL in ${_VERSIONS}
 do
-	echo "P: Writing config for /boot/vmlinuz-${_VERSION}..."
+	# Strip kernel prefix to derive version.
+	_VERSION=${_KERNEL#*-}
+	echo "P: Writing config for ${_KERNEL}..."
 
 	_NUMBER="${_NUMBER:-0}"
 	_ENTRY="${_ENTRY:-1}"
@@ -181,7 +183,7 @@ do
 
 label l${_NUMBER}
 	menu label ${U_BOOT_MENU_LABEL} ${_VERSION}
-	linux ${_BOOT_DIRECTORY}/vmlinuz-${_VERSION}
+	linux ${_BOOT_DIRECTORY}/${_KERNEL}
 	${_INITRD}
 	${_FDT}
 	append ${U_BOOT_ROOT} ${U_BOOT_PARAMETERS}"
@@ -196,7 +198,7 @@ label l${_NUMBER}
 
 label l${_NUMBER}r
 	menu label ${U_BOOT_MENU_LABEL} ${_VERSION} (rescue target)
-	linux ${_BOOT_DIRECTORY}/vmlinuz-${_VERSION}
+	linux ${_BOOT_DIRECTORY}/${_KERNEL}
 	${_INITRD}
 	${_FDT}
 	append ${U_BOOT_ROOT} $(echo ${U_BOOT_PARAMETERS} | sed -e 's| quiet||') single
-- 
2.20.1



signature.asc
Description: PGP signature