From ffb9bd149e6192361c0d72b2b4502d996ba85b95 Mon Sep 17 00:00:00 2001 From: Vitaly Chikunov Date: Mon, 28 Oct 2024 03:56:41 +0300 Subject: [PATCH] update-kernel: Make UPDATE_KERNEL_SYS_FLAVOUR try to fake 'uname -r' This is for debugging purposes to test upgrade from 'std-def' Since I use the archive for testing on a host with a much newer kernel, it cannot find a flavor to upgrade from 6.11 if the archive only has 6.10. Signed-off-by: Vitaly Chikunov --- update-kernel | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/update-kernel b/update-kernel index 75b230d..d9948a2 100755 --- a/update-kernel +++ b/update-kernel @@ -398,6 +398,11 @@ fi # set kernel flavour. if not defined with -t option, use current if [ -n "$UPDATE_KERNEL_SYS_FLAVOUR" ]; then current_kernel_flavour=$UPDATE_KERNEL_SYS_FLAVOUR + ur=$(rpm -q --qf '%{VERSION}-%{NAME}-%{RELEASE}\n' \ + "kernel-image-$UPDATE_KERNEL_SYS_FLAVOUR" 2>/dev/null | + sort -V | tail -1 | sed 's/kernel-image-//') + [ -n "$ur" ] && uname_r=$ur + unset ur else current_kernel_flavour=$uname_r current_kernel_flavour="${current_kernel_flavour#*-}"