Bug#1060226: live-build: binary_grub_cfg cannot handle more than two kernels
Package: live-build
Version: 1:20231215
Severity: normal
Tags: patch upstream
X-Debbugs-Cc: debian@bobrosbag.nl
Dear Maintainer,
When installing more than two kernels I get an error:
basename: extra operand ‘chroot/boot/vmlinuz-6.6.7-1-liquorix-amd64’
Try 'basename --help' for more information.
This originates from scripts/build/binary_grub_cfg
I look through the code and the code seems to be written for one kernel. It
still works with two kernels (because basename accepts two parameters) but
fails when three or more kernels are present.
I attached a patch.
-- Package-specific info:
-- System Information:
Debian Release: 12.4
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'proposed-updates'), (500, 'stable'), (100, 'bookworm-fasttrack'), (100, 'bookworm-backports-staging')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.6.10-1-liquorix-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE
Locale: LANG=en_NL.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages live-build depends on:
ii cpio 2.13+dfsg-7.1
ii debootstrap 1.0.133~bpo12+1
Versions of packages live-build recommends:
ii apt-utils 2.6.1
ii bzip2 1.0.8-5+b1
ii cryptsetup 2:2.6.1-4~deb12u1
ii file 1:5.44-3
ii live-boot-doc 1:20230131
ii live-config-doc 11.0.4
ii live-manual 2:20151217.2
ii live-manual-epub [live-manual] 2:20151217.2
ii live-manual-html [live-manual] 2:20151217.2
ii live-manual-odf [live-manual] 2:20151217.2
ii live-manual-pdf [live-manual] 2:20151217.2
ii live-manual-txt [live-manual] 2:20151217.2
ii rsync 3.2.7-1
ii systemd-container 254.5-1~bpo12+3
ii wget 1.21.3-1+b2
ii xz-utils 5.4.1-0.2
Versions of packages live-build suggests:
ii e2fsprogs 1.47.0-2
ii mtd-utils 1:2.1.5-1
ii parted 3.5-3
-- no debconf information
--- binary_grub_cfg 2023-12-15 11:03:16.937803714 +0100
+++ binary_grub_cfg.new 2023-12-15 11:02:47.527301806 +0100
@@ -114,7 +114,7 @@
# Default entries
DEFAULT_FLAVOUR="$(echo ${LB_LINUX_FLAVOURS} | awk '{ print $1 }')"
-DEFAULT_KERNEL="$(basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR})"
+DEFAULT_KERNEL="$(basename $(ls chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | tail -1))"
DEFAULT_INITRD="initrd.img-$(echo ${DEFAULT_KERNEL} | sed -e 's|vmlinuz-||')"
KERNEL_LIVE="/${INITFS}/${DEFAULT_KERNEL}"
@@ -137,9 +137,9 @@
if [ "${_AMD64_686_NUMBER}" -ge 2 ] ; then
# Default entries
- AMD64_KERNEL="$(basename chroot/boot/vmlinuz-*amd64)"
+ AMD64_KERNEL="$(basename $(ls chroot/boot/vmlinuz-*amd64 | tail -1))"
AMD64_INITRD="initrd.img-$(echo ${AMD64_KERNEL} | sed -e 's|vmlinuz-||')"
- _686_KERNEL="$(basename chroot/boot/vmlinuz-*686)"
+ _686_KERNEL="$(basename $(ls chroot/boot/vmlinuz-*686 | tail -1))"
_686_INITRD="initrd.img-$(echo ${_686_KERNEL} | sed -e 's|vmlinuz-||')"
Grub_live_autodetect_menu_entry "Live system (autodetect)" \
Reply to: