linux: implement LoadFile2 initrd loading
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest8 patches 13 repliesIn review
- v14 patches 6 repliesSuperseded
Changes in v2 from the cover letter
- add Leif's ack to #2, #6 and #8
- add patch #1 to fix the ARM Linux image header definition
- add patches #3, #4 and #5 to unify and reuse the COFF header loading routines from Xen (and the absence of which from v1 was causing garbage to be read and interpreted as the image major version)
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | linux/arm: fix ARM Linux header layoutinclude/ | +1 | 4 replies | |
| 2/8 | loader/linux: permit NULL argument for argv[] in grub_initrd_load()grub-core/ | +1 | 0 replies | |
| 3/8 | efi: move MS-DOS stub out of generic PE header definitiongrub-core/ include/ | +4 | 3 replies | |
| 4/8 | linux/arm: unify ARM/arm64 vs Xen PE/COFF header handlinggrub-core/ grub-core/ include/ +2 more | +24 | 0 replies | |
| 5/8 | linux/arm: account for COFF headers appearing at unexpected offsetsgrub-core/ | +15 | 4 replies | |
| 6/8 | efi: add definition of LoadFile2 protocolgrub-core/ include/ | +16 | 0 replies | |
| 7/8 | efi: implement LoadFile2 initrd loading protocol for Linuxgrub-core/ | +108 | 2 replies | |
| 8/8 | linux: ignore FDT unless we need to modify itgrub-core/ grub-core/ | +16 | 0 replies |
Reviews trailers per patch
3 of 8 patches have a Reviewed-by or Acked-by.
| Patch | Leif Lindholm |
|---|---|
| 1/8 | |
| 2/8 | R-b |
| 3/8 | |
| 4/8 | |
| 5/8 | |
| 6/8 | R-b |
| 7/8 | |
| 8/8 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/8] linux: implement LoadFile2 initrd loading
This implements the LoadFile2 initrd loading protocol, which is essentially a callback face into the bootloader to load the initrd data into a caller provided buffer. This means the bootloader no longer has to contain any policy regarding where to load the initrd (which differs between architectures and kernel versions) and no longer has to manipulate arch specific data structures such as DT or struct bootparams to inform the OS where the initrd resides in memory.
Sample output from booting a recent Linux/arm64 kernel:
grub> insmod part_msdos
grub> linux (hd0,msdos1)/Image
grub> initrd (hd0,msdos1)/initrd.img
grub> boot
EFI stub: Booting Linux Kernel...
EFI stub: EFI_RNG_PROTOCOL unavailable, KASLR will be disabled EFI stub: Generating empty DTB
EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path EFI stub: Exiting boot services and installing virtual address map...
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd070]
Changes since v1:
- add Leif's ack to #2, #6 and #8
- add patch #1 to fix the ARM Linux image header definition
- add patches #3, #4 and #5 to unify and reuse the COFF header loading routines from Xen (and the absence of which from v1 was causing garbage to be read and interpreted as the image major version)
Ard Biesheuvel (8):
linux/arm: fix ARM Linux header layout
loader/linux: permit NULL argument for argv[] in grub_initrd_load()
efi: move MS-DOS stub out of generic PE header definition linux/arm: unify ARM/arm64 vs Xen PE/COFF header handling linux/arm: account for COFF headers appearing at unexpected offsets
efi: add definition of LoadFile2 protocol
efi: implement LoadFile2 initrd loading protocol for Linux
linux: ignore FDT unless we need to modify it
grub-core/commands/efi/lsefi.c | 1 + grub-core/kern/efi/efi.c | 5 +- grub-core/loader/arm64/linux.c | 158 +++++++++++++++++--- grub-core/loader/arm64/xen_boot.c | 23 +-- grub-core/loader/efi/fdt.c | 7 +- grub-core/loader/linux.c | 2 +- include/grub/arm/linux.h | 8 +- include/grub/arm64/linux.h | 4 + include/grub/efi/api.h | 15 ++ include/grub/efi/efi.h | 4 +- include/grub/efi/pe32.h | 5 +- 11 files changed, 185 insertions(+), 47 deletions(-)
Signature · 1 line
2.17.1