How to get kernel version from an image file
Hi,
I know that it is possible to get the kernel version from a running system using "uname" command. I have a kernel image file in linux/arch/arm/boot/uImage. Is it possible to get similar information from this image file? and how? |
I'm not sure if it will work on an ARM image, but the file command works on x86/x86_64:
Code:
$ file vmlinuz |
@macemoneta: Thank you for the response. I tried this command, but it does not work as I expected.
I tried $file uImage $uImage: u-boot/PPCBoot image What I expect is something like below: $ uname -a $ Linux 2.6.33.5-ptx-trunk #1 PREEMPT Wed Mar 16 14:40:18 CET 2011 armv5tejl GNU/Linux This info is available in the image file, but I don't know how to extract it. |
You need to update the '/etc/magic' or '/usr/share/misc/magic' (whichever exists on your system) with the displacements for the information. See man 5 magic. Once that's updated, the file command will be able to pull the information automatically.
Update: Google says you need: Code:
# u-boot/PPCBoot image file |
mkimage -l <uimage-name>
can tell u the kernel version |
If the kernel image is compressed, you might be able to de-compress it first (but, as I recall, this is not as straightforward as you might expect). Otherwise, the strings command will find any strings of human-readable text in files of any description. It should be too hard to isolate the one that you're looking for.
--- rod. |
Check crc against other kernels if worse comes to worse.
|
All times are GMT -5. The time now is 03:54 PM. |