What is the advantage of systemd-boot over GRUB2? #systemd #grub #grub2
@jarkko systemd-boot is simpler. It's just an EFI application that reads the files specified by the BootLoaderSpec, shows you a menu and then loads the next EFI app you choose (usually a Linux kernel). It doesn't need to implement all filesystems you might use for your /boot etc.
@esmil I do have file systems in BuildRoot of which I do not want to get rid of :-) I.e. I have separate ESP and rootfs.

But dropping dependency from my build makes more sense.

BTW, grub-efi is just an EFI application so in that sense there is zero difference. It is more related to fatness of the stack.

And if you want just to boot a kernel without rootfs why you even would bother using systemd-boot? You can compile just as well EFI stub to the kernel image... So systemd-boot would be in such scenario useless cruft. Just rename bzImage as BOOTx64.efi and you're set. Linux *is* an EFI. application.

Anyway, I'll go with systemd-boot because I need to build less by doing that :-)
@jarkko Yes, so with systemd-boot you might have to make your ESP a bit larger, since you need to put your kernel (and possibly initrd) on the ESP partition so systemd-boot can load and execute it.
On regular mutable distros kernel-install takes care of copying your kernel, initrd and configuration files to the ESP when you install the kernel package.
@esmil Yeah, in my case kernel-install is not useful because I build rootfs as part of the kernel build itself :-) But keeping the build as minimal as possible is good goal for sure.
@esmil I could actually do this without grub and without systemd-boot but I want to emulate the full stack for robustness sake. I.e. could just rename bzImage as BOOTx64.efi and place it correct location...
@jarkko That's right. Then you might have to configure your kernel with a built-in cmdline though.
@esmil Yep, it would be possible but overall it is more robust to pass it so I guess cmdline is actually in my case legit reason to use systemd-boot...