[pve-devel] applied: [PATCH kernel-meta] fix #2595: less false positives when filtering out meta packages

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Feb 17 07:29:06 CET 2020


This fixes selecting kernels for manual inclusion in the ESP which do
not come with a "-pve" in name.
It fixes listing, by just printing out the whole list as is. refresh
complains already if there's a kernel selected but no respective
vmlinuz got found. Additionally, we already plainly add the "manual
kernel list" in kernel_keep_versions, but filter then out any kernel
not containing a "-pve" in boot_kernel_list.

But boot_kernel_list should actually only filter out the kernel meta
packages.

So, use a inverse match and check for a /\d+\.\d+/ pattern, this
seems to work well enough.

Note that kernel_keep_versions doesn't picks up non-pve kernels
anyway, so this only really alters manual selection.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 bin/pve-efiboot-tool | 2 +-
 efiboot/functions    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/pve-efiboot-tool b/bin/pve-efiboot-tool
index 97015f3..eab01d7 100755
--- a/bin/pve-efiboot-tool
+++ b/bin/pve-efiboot-tool
@@ -256,7 +256,7 @@ list_kernels() {
 	boot_kernels="$(boot_kernel_list)"
 
 	if [ -e "$MANUAL_KERNEL_LIST" ]; then
-		manual_kernels="$(echo "$boot_kernels" | grep -Fx -f "$MANUAL_KERNEL_LIST" || true)"
+		manual_kernels="$(cat "$MANUAL_KERNEL_LIST" || true)"
 		boot_kernels="$(echo "$boot_kernels" | grep -Fxv -f "$MANUAL_KERNEL_LIST" || true)"
 	fi
 
diff --git a/efiboot/functions b/efiboot/functions
index b804fb9..72fe15d 100755
--- a/efiboot/functions
+++ b/efiboot/functions
@@ -72,7 +72,7 @@ kernel_keep_versions() {
 boot_kernel_list() {
 	list="$(kernel_keep_versions "$@")"
 
-	echo "$list" | grep -E '^[^ ]+-pve' || true
+	echo "$list" | grep -vE '^[0-9]+\.[0-9]+$' || true
 }
 
 warn() {
-- 
2.20.1




More information about the pve-devel mailing list