Should qemu -kernel option be able to gunzip kernel? (aarch64)
On Fedora/aarch64, the kernel in /boot is a gzip-compressed file:
$ file /boot/vmlinuz-* /boot/vmlinuz-0-rescue-520be7dc677d4fab99d3d3ce91f90c84: gzip compressed data, max compression, from Unix /boot/vmlinuz-3.16.0-0.rc6.git3.1.rwmj2.fc22.aarch64: gzip compressed data, max compression, from Unix /boot/vmlinuz-3.16.0-0.rc6.git3.1.rwmj3.fc22.aarch64: gzip compressed data, max compression, from Unix /boot/vmlinuz-3.16.0-0.rc6.git3.1.rwmj4.fc22.aarch64: gzip compressed data, max compression, from Unix
[not just for the custom kernels I've been building ...]
Apparently UEFI and u-boot can just handle this by uncompressing the kernel on the fly.
However qemu-system-aarch64 -kernel option definitely can*not*, with the result that if you do the "obvious":
qemu-system-aarch64 -kernel /boot/vmlinuz-xxx
it just hangs immediately, because it's trying to execute gzip data.
I don't know the rights and wrongs of this. Maybe Fedora is wrong for having a gzip-compressed kernel. But should the -kernel option be able to detect if the file is gzip encoded and uncompress it on the fly? (If so I'll post a patch for this unless someone else jumps in).
Mainly I'm asking because I've no idea what is the right thing to do here. There could be another obvious fix.
Rich.
Signature · 5 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Quoted 12 lines · Richard W.M. Jones
On Fedora/aarch64, the kernel in /boot is a gzip-compressed file
Apparently UEFI and u-boot can just handle this by uncompressing the kernel on the fly.
However qemu-system-aarch64 -kernel option definitely can*not*, with the result that if you do the "obvious":
qemu-system-aarch64 -kernel
/boot/vmlinuz-xxxit just hangs immediately, because it's trying to execute gzip data.
Quoted 7 lines
I don't know the rights and wrongs of this. Maybe Fedora is wrong for having a gzip-compressed kernel. But should the -kernel option be able to detect if the file is gzip encoded and uncompress it on the fly? (If so I'll post a patch for this unless someone else jumps in).
Mainly I'm asking because I've no idea what is the right thing to do here. There could be another obvious fix.
Yeah, the AArch64 approach to compressed kernels is "the bootloader should do it" (unlike the 32 bit ARM approach where the kernel has a decompressor tacked on the front of it). So I agree that we should be a good bootloader and do the decompression, assuming it's not a total pain to do so only for AArch64 kernels.
thanks
-- PMM