summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2025-05-23 17:14:45 +0200
committerMichael Brown2025-05-23 17:14:45 +0200
commitcd38ed4fab012981b656ffed64a03bf90fe9739f (patch)
treef8030bced353d1c5367efd0abbea846d9901f0f1 /src/include
parent[initrd] Squash and shuffle only initrds within the external heap (diff)
downloadipxe-cd38ed4fab012981b656ffed64a03bf90fe9739f.tar.gz
ipxe-cd38ed4fab012981b656ffed64a03bf90fe9739f.tar.xz
ipxe-cd38ed4fab012981b656ffed64a03bf90fe9739f.zip
[lkrn] Support initrd construction for RISC-V bare-metal kernels
Use the shared initrd reshuffling and CPIO header construction code for RISC-V bare-metal kernels. This allows for files to be injected into the constructed ("magic") initrd image in exactly the same way as is done for bzImage and UEFI kernels. We append a dummy image encompassing the FDT to the end of the reshuffle list, so that it ends up directly following the constructed initrd in memory (but excluded from the initrd length, which was recorded before constructing the FDT). We also temporarily prepend the kernel binary itself to the reshuffle list. This is guaranteed to be safe (since reshuffling is designed to be unable to fail), and avoids the requirement for the kernel segment to be available before reshuffling. This is useful since current RISC-V bare-metal kernels tend to be distributed as EFI zboot images, which require large temporary allocations from the external heap for the intermediate images created during archive extraction. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ipxe/lkrn.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/include/ipxe/lkrn.h b/src/include/ipxe/lkrn.h
index 43daa8006..88b4d0485 100644
--- a/src/include/ipxe/lkrn.h
+++ b/src/include/ipxe/lkrn.h
@@ -52,12 +52,10 @@ struct lkrn_context {
physaddr_t ram;
/** Entry point */
physaddr_t entry;
- /** Device tree */
- physaddr_t fdt;
/** Initial ramdisk (if any) */
physaddr_t initrd;
- /** Length of initial ramdisk (if any) */
- size_t initrd_len;
+ /** Device tree */
+ physaddr_t fdt;
};
/** Compressed kernel image header */