Implement uki support
Created by: Foxboron
Instead of the current system-transparency script soup with xorriso and parted etc we can now make ISOs with stmgr
.
$ stmgr mkiso create -config ./host_config.json -kernel ./stboot.efi -out mkiso.iso
Which can be tested with some incarnation like the one below:
qemu-system-x86_64 \
-drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2-ovmf/x64/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=OVMF_VARS.fd \
-enable-kvm -M q35 \
-m 4G -nographic \
-drive file=mkiso.iso,format=raw,if=none,media=cdrom,id=drive-cd1,readonly=on \
-device ahci,id=achi0 -device ide-cd,bus=achi0.0,drive=drive-cd1,id=cd1,bootindex=1
Note that this only really packages an EFI binary into the ISO. Using stub instead of relying on go-diskfs
to package the initramfs into some disk format seems easier(?)
Can be done with systemd-stub
objcopy \
--add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \
--add-section .cmdline=<(echo "console=ttyS0,115200") --change-section-vma .cmdline=0x30000 \
--add-section .linux=/boot/vmlinuz-linux --change-section-vma .linux=0x2000000 \
--add-section .initrd=stboot.cpio.gz --change-section-vma .initrd=0x3000000 \
/usr/lib/systemd/boot/efi/linuxx64.efi.stub \
stboot.efi
Fixes #28 (closed)
Edited by Morten Linderud