I am working on a shell script. I have a pre-built zImage. is it possible to know the kernel version from which this zImage was created?
I have tried with the commands updated @ Getting uname information from a compressed kernel image, but both commands are failing.
$ dd if=zImage bs=1 skip=$(LC_ALL=C grep -a -b -o $'\x1f\x8b\x08\x00\x00\x00\x00\x00' zImage | \
cut -d ':' -f 1) | zcat | grep -a 'Linux version'
dd: unrecognized operand `3165585'
Try `dd --help' for more information.
gzip: stdin: unexpected end of file
$ dd if=zImage bs=1 skip=$(LC_ALL=C grep -a -b -o $'\xFD\x37\x7A\x58\x5A\x00' zImage | \
head -n 1 | cut -d ':' -f 1) | xzcat | grep -a 'Linux version'
xzcat: (stdin): File format not recognized
Can you guide me to identify the kernel version from zImage.