mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-14 15:29:25 +00:00
Add raw-efi test + documentation
Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>
This commit is contained in:
committed by
Avi Deitcher
parent
804d52374e
commit
56e37a842e
32
test/cases/010_platforms/000_qemu/060_run_raw_efi/test.sh
Normal file
32
test/cases/010_platforms/000_qemu/060_run_raw_efi/test.sh
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# SUMMARY: Check that EFI BIOS ISO boots in qemu
|
||||||
|
# LABELS:
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Source libraries. Uncomment if needed/defined
|
||||||
|
#. "${RT_LIB}"
|
||||||
|
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
|
||||||
|
|
||||||
|
NAME=qemu-raw-efi
|
||||||
|
|
||||||
|
clean_up() {
|
||||||
|
rm -rf ${NAME}-*
|
||||||
|
}
|
||||||
|
trap clean_up EXIT
|
||||||
|
|
||||||
|
# see https://github.com/linuxkit/linuxkit/issues/1872 this is very flaky in qemu
|
||||||
|
# disabling for now until we fix a config that works
|
||||||
|
exit $RT_CANCEL
|
||||||
|
|
||||||
|
if command -v qemu-system-x86_64; then
|
||||||
|
if [ ! -f /usr/share/ovmf/bios.bin ]; then
|
||||||
|
exit $RT_CANCEL
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
linuxkit build --format raw-efi --name "${NAME}" test.yml
|
||||||
|
[ -f "${NAME}-efi.img" ] || exit 1
|
||||||
|
linuxkit run qemu --uefi "${NAME}-efi.img" | grep -q "Welcome to LinuxKit"
|
||||||
|
|
||||||
|
exit 0
|
||||||
10
test/cases/010_platforms/000_qemu/060_run_raw_efi/test.yml
Normal file
10
test/cases/010_platforms/000_qemu/060_run_raw_efi/test.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
kernel:
|
||||||
|
image: linuxkit/kernel:6.12.52
|
||||||
|
cmdline: "console=ttyS0"
|
||||||
|
init:
|
||||||
|
- linuxkit/init:26e546e4ef2669bd44d8c46e3164eb5ba7ae1a5c
|
||||||
|
- linuxkit/runc:98ddef9b5b87cb44783566ed2a86cea95439a631
|
||||||
|
onboot:
|
||||||
|
- name: poweroff
|
||||||
|
image: linuxkit/poweroff:4059858a555bed90c2280fa9b060b7a8f8de6d45
|
||||||
|
command: ["/bin/sh", "/poweroff.sh", "10"]
|
||||||
20
tools/mkimage-raw-efi/README.md
Normal file
20
tools/mkimage-raw-efi/README.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# ESP Structure Overview
|
||||||
|
|
||||||
|
The script initializes an EFI System Partition using `mkfs.vfat` and populates it with directories and files for **systemd-boot** and a Linux Unified Kernel Image (UKI).
|
||||||
|
|
||||||
|
## Partition Layout
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ESP
|
||||||
|
├── EFI
|
||||||
|
│ ├── BOOT # contains exactly one of the bootloader binaries below for the respective architecture
|
||||||
|
│ │ ├── BOOTX64.EFI # amd64
|
||||||
|
│ │ ├── BOOTAA64.EFI # arm64
|
||||||
|
│ │ └── BOOTRISCV64.EFI # riscv64
|
||||||
|
│ └── Linux
|
||||||
|
│ └── linuxkit.efi # LinuxKit Unified Kernel Image (UKI)
|
||||||
|
└── loader
|
||||||
|
└── loader.conf # systemd-boot configuration file
|
||||||
|
```
|
||||||
|
|
||||||
|
UKIs in `EFI/Linux` do not need an explicit entry in `loader/entries` but are automatically picked up by `systemd-boot`.
|
||||||
Reference in New Issue
Block a user