uh - you just specify the location of your initramfs in the kernel boot params and that's it, no need for all the above
You hadn't specified it at first, so I thought it might be helpful to provide a more complete example with different parts (like the initrd) and offsets, with a gummiboot stub
Re:Linux Boot Partitions
by still_grokking on Thursday November 03, 2022 @10:40PM
(#33461325)
Having kernel and initrd separate makes things more complicated and brittle.
Also a secure boot setup is much more difficult this way.
I for my part love the UKI. Never had a simpler boot setup!
> a secure boot setup is much more difficult this way.
Is it? Don't you just sign the bootable kernel image that already has the initrd and command-line built in?
Oh, I guess if you're using Microsoft as a CA I can see why that would be tricky.
Re:Linux Boot Partitions
by still_grokking on Friday November 04, 2022 @11:21AM
(#33468218)
I think this is a misunderstanding. I've said secure boot is much more difficult in case kernel and initrd are separate.
In case of a UKI it's very simple of course. Just sign the boot image.
That's why I love the UKI. :-)
$ stub_line=$(objdump -h "/usr/lib/systemd/boot/efi/linuxx64.efi.stub" | tail -2 | head -1)
$ stub_size=0x$(echo "$stub_line" | awk '{print $3}')
$ stub_offs=0x$(echo "$stub_line" | awk '{print $4}')
$ osrel_offs=$((stub_size + stub_offs))
$ cmdline_offs=$((osrel_offs + $(stat -c%s "/usr/lib/os-release")))
$ splash_offs=$((cmdline_offs + $(stat -c%s "/etc/kernel/cmdline")))
$ linux_offs=$((splash_offs + $(stat -c%s "/usr/share/systemd/bootctl/splash-arch.bmp")))
$ initrd_offs=$((linux_offs + $(stat -c%s "vmlinuz-file")))
$ objcopy \
The resulting linux.efi" can be added directly with efibootmgr, and contains the kernel boot parameters (cmdline)