Yes. The full kernel version string is accessable via the setup-header
of the (b)zImage. The below entry for /etc/magic shows you how to find it:
0x202 string HdrS Linux/i386 Kernel
>0x206 short 0x0105 setupV1 zImage
>0x206 short 0x0200 setupV2
>>0x211 byte 0 zImage
>>0x211 byte 1 bzImage
>(0x20e.s+0x200) string >\0 "%6.6s"
If you have this entry in /etc/magic, 'file /vmlinuz' should display
what you need.
>
> 2. Is there a way to know what boot image was booted
> in a running system? I could just run the kernel image
> through md5sum to get an extension.
Yes:
cat /proc/cmdline
The variable BOOT_IMAGE= is set by the loader.
When using LILO it tells you the 'label', so you can scan /etc/lilo.conf
for the image that belongs to this label.
When using LOADLIN it tells you the base name of the image file.
Hans
<lermen@fgan.de>