-
rel: UKI = Unified Kernel Image, UEFI = Unified Extensible Firmware Interface, Linux
-
how to get an image:
/usr/lib/systemd/ukify build \
--linux="/boot/vmlinuz-$1" \
--initrd="$2" \
--cmdline="replace with your cmdline" \
--splash="/path/to/splash.bmp" \ # Remove this line if you don't want one
--output="/boot/efi/EFI/Linux/debian.efi"
from: https://wiki.debian.org/UKI
as i recently learned the linux bzImage already is a valid PE = Portable Executable file for efi. meaning you can directly move $KERNEL_SRC/arch/x86/boot/bzImage /boot/EFI/BOOT/BOOTX64.EFI and it any EFI compatible PC will boot it. it is AT THE SAME TIME a valid MBR = Master Boot Record (you used to just flash the kernel onto a floppy and boot from that… although the straight booting from the MBR is now no longer supported )
(note the MZ in the beginning and the 55aa at the end)
root@nico:~/work/c2vi/acern-fixing/nix-linux# cat arch/x86/boot/bzImage | head -c 512 | xxd
00000000: 4d5a 0000 0000 0000 0000 0000 0000 0000 MZ..............
00000010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000030: 0000 0000 0000 0000 cd23 8281 4000 0000 .........#..@...
00000040: 5045 0000 6486 0400 0000 0000 0000 0000 PE..d...........
00000050: 0100 0000 a000 0602 0b02 0214 0000 a203 ................
00000060: 0020 0400 0000 0000 61d0 a103 0050 0000 . ......a....P..
00000070: 0000 0000 0000 0000 0010 0000 0002 0000 ................
00000080: 0000 0000 0300 0000 0000 0000 0000 0000 ................
00000090: 0070 a603 0010 0000 0000 0000 0a00 0001 .p..............
000000a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000c0: 0000 0000 0600 0000 0000 0000 0000 0000 ................
000000d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000f0: 0000 0000 0000 0000 2e73 6574 7570 0000 .........setup..
00000100: 0030 0000 0010 0000 0030 0000 0010 0000 .0.......0......
00000110: 0000 0000 0000 0000 0000 0000 4000 0042 ............@..B
00000120: 2e63 6f6d 7061 7400 0010 0000 0040 0000 .compat......@..
00000130: 0010 0000 0040 0000 0000 0000 0000 0000 .....@..........
00000140: 0000 0000 4000 0042 2e74 6578 7400 0000 ....@..B.text...
00000150: 0000 a203 0050 0000 0000 a203 0050 0000 .....P.......P..
00000160: 0000 0000 0000 0000 0000 0000 2000 0060 ............ ..`
00000170: 2e64 6174 6100 0000 0020 0400 0050 a203 .data.... ...P..
00000180: 0004 0000 0050 a203 0000 0000 0000 0000 .....P..........
00000190: 0000 0000 4000 00c0 ffff ffff ffff ffff ....@...........
000001a0: ffff ffff ffff ffff ffff ffff ffff ffff ................
000001b0: ffff ffff ffff ffff ffff ffff ffff ffff ................
000001c0: ffff ffff ffff ffff ffff ffff ffff ffff ................
000001d0: ffff ffff ffff ffff ffff ffff ffff ffff ................
000001e0: ffff ffff ffff ffff ffff ffff ffff ffff ................
000001f0: ff27 0100 4020 3a00 0000 ffff 0000 55aa .'..@ :.......U.