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 <vt@altlinux.org>
This commit is contained in:
Виталий Чикунов 2024-10-28 03:56:41 +03:00
parent 825dfc1f68
commit ffb9bd149e

View File

@ -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#*-}"