Some new kernel include the string starting with "Linux version" 2 times in the 
vmlinuz- image.
While the first line ends for example with "# SMP PREEMPT_DYNAMIC.*" missing 
the "1" as mentioned in this bug report the 2nd line matches the /proc/version 
string exactly.
Therefore changing the filter "head -n1" to "tail -n1" would fix it for a 
bookworm kernel.
This works with kernels for buster, bullseye and bookworm.

For kernels from other repositories for surface and proxmox another change is 
necessary to support zst compression.
But for the proxmox kernel the "tail -n1" does not solve the problem because 
the "Linux version" string in the vmlinuz- image ends with 
" ()" which is not included in /proc/version

Therefore the following patch does not solve all problems but still might help 
finding a better solution:

136c136
<               echo "UNKNOWN: filter command '$filter' missing, perhaps 
install xz-utils, lz4 or lzop?" >&2
---
>               echo "UNKNOWN: filter command '$filter' missing, perhaps 
> install xz-utils, lz4, lzop or zstd?" >&2
164a165,166
>       # zst compressed image
>       cat_vmlinux "$image" "\x28\xb5\x2f\xfd"      "zstdcat"  0
204c206
<                       on_disk_version="`get_image_linux "$on_disk" | $STRINGS 
| grep 'Linux version' | head -n1`"
---
>                       on_disk_version="`get_image_linux "$on_disk" | $STRINGS 
> | grep 'Linux version' | tail -n1`"


Successfully tested with:
linux-image-4.19.0-23-amd64
linux-image-6.0.0-0.deb11.6-amd64
linux-image-6.1.0-5-amd64
linux-image-6.1.13-surface

But does not help with:
pve-kernel-5.15.85-1-pve


regards
Markus Köberl
-- 
Markus Koeberl
Graz University of Technology
Signal Processing and Speech Communication Laboratory
E-mail: markus.koeb...@tugraz.at

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to