vmlinuz-get-version is broken with recent kernels, because they include two version strings, and the first one is the wrong one (empty build-version after #).
For example (on debian testing/bookworm right now):
# tail -c+18126 /boot/vmlinuz-6.1.0-1-amd64 | unxz | grep -ao 'Linux version [0123456789].*'
Linux version 6.1.0-1-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-13) 12.2.0, GNU ld (GNU Binutils for Debian) 2.39.90.20221231) # SMP PREEMPT_DYNAMIC Debian 6.1.4-1 (2023-01-07)
Linux version 6.1.0-1-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-13) 12.2.0, GNU ld (GNU Binutils for Debian) 2.39.90.20221231) #1 SMP PREEMPT_DYNAMIC Debian 6.1.4-1 (2023-01-07)
unxz: (stdin): Compressed data is corrupt
Perhaps the script could prefer the version that doesn't have a space after #; the correct entry should (imho) have a non-empty build-version.
This doesn't affect x86, as needrestart extracts the (correct) version from the (uncompressed) header in that case, and doesn't use vmlinuz-get-version.
Hi,
vmlinuz-get-version
is broken with recent kernels, because they include two version strings, and the first one is the wrong one (emptybuild-version
after#
).For example (on debian testing/bookworm right now):
Perhaps the script could prefer the version that doesn't have a space after
#
; the correct entry should (imho) have a non-emptybuild-version
.This doesn't affect x86, as needrestart extracts the (correct) version from the (uncompressed) header in that case, and doesn't use
vmlinuz-get-version
.See also: