recently I tried to switch from grub to systemd-boot, since grub took too long time for me until the boot started. Installing systemd-boot was fairly easy and everything work perfectly. Then I found systemd-boot-manager to update the systemd-boot files as well as the kernels after pacman installs. The problem: My EFI partition is /boot/efi, the kernels are installed unter /boot.
If I use systemd-boot in this condition, no boot entry would be generated since the tool searches in the EFI partition (/boot/efi) for kernels, does not find one and creates no entry therefore. In my case it indeed removes the exising entry which would have made my system unbootable hadn’t I still installed grub as a fallback.
My proposal would be to use kernel-install from systemd which works perfectly. If additional configuration from sdboot-manage.conf shall be applied, the generated loader/entries/* files could be adapted by e.g. sed with the options.
systemd-boot-manager was created by @dalto. He’s not as active here as he once was, so perhaps share your proposal in an issue or create a merge request.
I responded more fully on gitlab but to me kernel-install is an alternative to what systemd-boot-manager does. It provides similar automation in a very different way.
mkinitcpio is what is putting your kernels in /boot. You need to either use a hook/script to move them to the right place or override the mkinitcpio presets to put them in the right place to begin with.
While using /efi or /boot is the recommended convention, it isn’t a requirement. You can run systemd-boot from /boot/efi if you want to. It is, however, a very odd thing to do.
It makes sense if those distros use grub or some other bootloader which keeps the kernels separate from the esp. It makes less sense if you are using systemd-boot where the kernels need to be in the efi partition.
But, either way, it should work if that is your preference.
That being said, I like kernel-install too, especially for multi-booting. Getting it working smoothly and in an automatic was on Arch-based distros has been some fun. It definitely isn’t ideal out-of-the-box because of the Arch reliance on the kernels/initrams being in a consistent location.
As the systemd specification mandates the /loader directory to be in the root of the $esp this indirectly mandates a directory separate from the filesystems root.
The Arch bootctl binary defaults to /boot or /efi - but can be told to look elsewhere and your sdboot-manage script is coded to use those locations - right?
@svenihoney
Ubuntu uses GRUB as boot loader and therefore the ESP is mounted at /boot/efi - because that is a location grub can understand.
With systemd you can even skip mounting the system devices. If they are setup using the correct partition type UUID it will be loaded automagically.
And I just got a lot of info to digest - just by reading the BootLoaderSpec
I created and edited new config file Manjaro.conf in /boot/efi/loader/entries.
Then I copied all imgs and vmlinuz from /boot into /boot/efi/EFI/ManjaroBoot. It worked fine.
But my change is gone after pacman update.
I do not know how to change pacman’s hook.
You can add what you want to change in the file /etc/sdboot-manage.conf so that every time the boot loader update, it will add the options accordingly.
I think bootctl can not access /boot as ext4 in the same partition of / or I am wrong.
But you can copy img files into /boot/efi/. But the files are not updated in /boot/efi or there is no automation of update. Or you create new bash-script and write own command to update them.