]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[efi] Provide an "initrd.magic" file for use by UEFI kernels
authorMichael Brown <mcb30@ipxe.org>
Fri, 21 May 2021 13:27:27 +0000 (14:27 +0100)
committerMichael Brown <mcb30@ipxe.org>
Fri, 21 May 2021 19:18:50 +0000 (20:18 +0100)
commite5f02551735922eb235388bff08249a6f31ded3d
tree30d7136dfb8e477ce1b8ca27f2a4b5c2777d721b
parentef9953b7122937dc12762e9f5ce797ba6859a24e
[efi] Provide an "initrd.magic" file for use by UEFI kernels

Provide a file "initrd.magic" via the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
that contains the initrd file as constructed for BIOS bzImage kernels
(including injected files with CPIO headers constructed by iPXE).

This allows BIOS and UEFI kernels to obtain the exact same initramfs
image, by adding "initrd=initrd.magic" to the kernel command line.
For example:

  #!ipxe
  kernel boot/vmlinuz initrd=initrd.magic
  initrd boot/initrd.img
  initrd boot/modules/e1000.ko      /lib/modules/e1000.ko
  initrd boot/modules/af_packet.ko  /lib/modules/af_packet.ko
  boot

Do not include the "initrd.magic" file within the root directory
listing, since doing so would break software such as wimboot that
processes all files within the root directory.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/interface/efi/efi_file.c