]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[lkrn] Add support for EFI zboot compressed kernel images
authorMichael Brown <mcb30@ipxe.org>
Tue, 20 May 2025 13:14:26 +0000 (14:14 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 20 May 2025 13:29:57 +0000 (14:29 +0100)
commite2f4dba2b734190bb69667a16844dec3473b1f4d
tree598e503a2fa2a4c9f6726dec40415abea781969b
parentecac4a34c7be8d1d81d21fa662460bf162d6a434
[lkrn] Add support for EFI zboot compressed kernel images

Current RISC-V and AArch64 kernels found in the wild tend not to be in
the documented kernel format, but are instead "EFI zboot" kernels
comprising a small EFI executable that decompresses and executes the
inner payload (which is a kernel in the expected format).

The EFI zboot header includes a recognisable magic value "zimg" along
with two fields describing the offset and length of the compressed
payload.  We can therefore treat this as an archive image format,
extracting the payload as-is and then relying on our existing ability
to execute compressed images.

This is sufficient to allow iPXE to execute the Fedora 42 RISC-V
kernel binary as currently published.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/image/lkrn.c
src/include/ipxe/lkrn.h