I would need some explanation about systemd-boot in multiboot

Hello,

I am posting here because my English is not very good. Hoping to find someone who has had experience with the problem.

So, here it is, I have a triple boot installation on Btrfs.

Having, always hated grub (especially when it breaks) I saw that there was the bootloader of systemd.

So I read the doc, which is not very explicit, on how to install. I first installed it next to my current install and it didn’t work.
So after cloning my installation, I did a new installation in simple-boot on Btrfs file system, which booted normally.
It allowed me to understand better how it worked and in particular that after the installation a directory with the id of the machine was created in the esp partition. This last one contains a subdirectory with the name of the current kernel version and inside the initrd and the linux image. (which I didn’t get) on my triple-boot installation…

After a stroke of luck I ticked on a sentence of the doc about the shell reinstall-kernel (sentence that arrives there without understanding why), I launched this shell after having restored my triple-boot install, and the directory was created. After having filled in the boot file, I was able to boot on EOS.

Only now, I would like to boot on Sid and Mint too. And there the doc doesn’t seem clear to me:

here, on this point:
https://discovery.endeavouros.com/installation/systemd-boot/2022/12/

How to change the default entry to boot
There is a default entry inside /efi/loader/loader.conf that determine the default boot entry.

On a new install, it will look something like this:

default 665eca4ae83246df8ec17d1cbc6a1763*

That first string of characters is you entry token which identifies the install. That is important if you are dual-booting with another Linux, otherwise it can be replaced with *. That line supports wildcards and so if you want to boot the LTS kernel by default you could use something like this:

default 665eca4ae83246df8ec17d1cbc6a1763*lts.conf

Alternatively, if you want to boot the mainline kernel by default, something like this should work:

default 665eca4ae83246df8ec17d1cbc6a1763-*-arch?-?.conf

These changes will take effect on the next reboot and nothing else is required except modifying the file.

This means that if I want to boot on a mint for example, I have to create under entries/

a directory

665eca4ae83246df8ec17d1cbc6a1763-mint ?

which will contain my kernel images and the mint initrd

and this entry will be listed in the menu, thanks to the entry

665eca4ae83246df8ec17d1cbc6a1763* (which refers to all directories …763* so oes, mint ???

Last question reinstall-kernels updates the name of the subdirectory for the Eos install, but for the other distros, there is no tool to put the new kernels there when they are updated in the distribution.
In this case, did I understand correctly that you have to copy them there? In this case it is heavy…

nevertheless, I found a topic on this subject :

https://forums.linuxmint.com/viewtopic.php?t=299662

where curtvaughan seems to solve the problem with a script :

well, it’s nice but it’s still heavy, and I hope that systemd-boot has evolved and that it’s now easy to do.

paradoxically, I end up liking grub, and the chaining …even if the parade of screens with different styles is ugly as anything.

Thanks for your clarifications, probably you have with a little change a multiboot install with systemd-boot.

Do you have a single EFI partition shared by all your installs or do you have separate EFI partitions.

If all the distros share an EFI partition, it is easy to multiboot. If not, it is quite a bit harder.

hi,

yes only btrfs partition.

Can you share the output of sudo parted -l

okay,

Disque /dev/sda : 121GB
Taille des secteurs (logiques/physiques) : 512B/4096B
Table de partitions : gpt
Drapeaux de disque : 

Numéro  Début   Fin    Taille  Système de fichiers  Nom                   Drapeaux
 1      20,5kB  210MB  210MB   fat32                EFI System Partition  démarrage, esp
 2      211MB   121GB  121GB   btrfs


Where are the partitions for Mint and Sid?

Are those installs in that same btrfs partition?

If so, can you share the output of find /efi/EFI

they are not partitions but subvolumes …

[falke@falke-macbookair72 ~]$ sudo btrfs sub l / | grep "top level 5"
ID 257 gen 203619 top level 5 path @home
ID 283 gen 203625 top level 5 path @home_sid
ID 310 gen 203571 top level 5 path @snapshots
ID 356 gen 203583 top level 5 path @donnees
ID 1044 gen 203620 top level 5 path @
ID 1300 gen 203277 top level 5 path @archives_sid
ID 1406 gen 203376 top level 5 path @apt_sid
ID 1873 gen 203730 top level 5 path @home_endeavour
ID 1874 gen 203693 top level 5 path @cache
ID 1875 gen 203730 top level 5 path @log
ID 1878 gen 202687 top level 5 path timeshift-btrfs/snapshots/2023-04-29_11-00-02/@
ID 1879 gen 198508 top level 5 path timeshift-btrfs/snapshots/2023-04-29_11-00-02/@home
ID 1904 gen 202230 top level 5 path @endeavour.broken
ID 1905 gen 203730 top level 5 path @endeavour
ID 1907 gen 202230 top level 5 path @sid.broken
ID 1908 gen 203691 top level 5 path @sid
ID 1921 gen 202688 top level 5 path timeshift-btrfs/snapshots/2023-05-05_15-23-04/@
ID 1922 gen 202689 top level 5 path timeshift-btrfs/snapshots/2023-05-05_15-23-04/@home

and those in particulary

@ (mint) @sid @endeavour for the roots…

OK, that is fine. Can you share the output of find /efi/EFI

command doesn’t work

[root@falke-macbookair72 EFI]# ls -l /boot/efi/EFI
total 3
drwx------ 4 root root 512 25 janv. 2021 APPLE
drwx------ 2 root root 512 12 févr. 2022 BOOT
drwx------ 7 root root 1024 13 mai 22:49 refind
drwx------ 2 root root 512 22 janv. 2021 tools
drwx------ 2 root root 512 12 févr. 2022 ubuntu

Nb : I manage to do this with refind, but i’m still interested by systemd-boot which seems to be quite simple.

You mounted your EFI partition at /boot/efi? That is a really strage thing to do for systemd-boot. That is mostly a grub-ism. It should work, but it is odd.

OK, then I need this command. find /boot/efi/EFI

hi , yes i’ve seen that, it’s recommended to mout it on /boot but Sid installed it so for exple/

[sudo] Mot de passe de falke : 
/boot/efi/EFI
/boot/efi/EFI/APPLE
/boot/efi/EFI/APPLE/EXTENSIONS
/boot/efi/EFI/APPLE/EXTENSIONS/Firmware.scap
/boot/efi/EFI/APPLE/FIRMWARE
/boot/efi/EFI/APPLE/FIRMWARE/MBA71.fd
/boot/efi/EFI/ubuntu
/boot/efi/EFI/ubuntu/grubx64.efi
/boot/efi/EFI/ubuntu/shimx64.efi
/boot/efi/EFI/ubuntu/mmx64.efi
/boot/efi/EFI/ubuntu/BOOTX64.CSV
/boot/efi/EFI/ubuntu/grub.cfg
/boot/efi/EFI/BOOT
/boot/efi/EFI/BOOT/BOOTX64.EFI
/boot/efi/EFI/BOOT/fbx64.efi
/boot/efi/EFI/BOOT/mmx64.efi
/boot/efi/EFI/refind
/boot/efi/EFI/refind/refind_x64.efi
/boot/efi/EFI/refind/drivers_x64
/boot/efi/EFI/refind/drivers_x64/btrfs_x64.efi
/boot/efi/EFI/refind/drivers_x64/ext2_x64.efi
/boot/efi/EFI/refind/drivers_x64/ext4_x64.efi
/boot/efi/EFI/refind/drivers_x64/hfs_x64.efi
/boot/efi/EFI/refind/drivers_x64/iso9660_x64.efi
/boot/efi/EFI/refind/drivers_x64/reiserfs_x64.efi
/boot/efi/EFI/refind/icons
/boot/efi/EFI/refind/icons/arrow_left.png
/boot/efi/EFI/refind/icons/arrow_right.png
/boot/efi/EFI/refind/icons/boot_linux.png
/boot/efi/EFI/refind/icons/boot_win.png
/boot/efi/EFI/refind/icons/func_about.png
/boot/efi/EFI/refind/icons/func_bootorder.png
/boot/efi/EFI/refind/icons/func_csr_rotate.png
/boot/efi/EFI/refind/icons/func_exit.png
/boot/efi/EFI/refind/icons/func_firmware.png
/boot/efi/EFI/refind/icons/func_hidden.png
/boot/efi/EFI/refind/icons/func_install.png
/boot/efi/EFI/refind/icons/func_reset.png
/boot/efi/EFI/refind/icons/func_shutdown.png
/boot/efi/EFI/refind/icons/mouse.png
/boot/efi/EFI/refind/icons/os_arch.png
/boot/efi/EFI/refind/icons/os_artful.png
/boot/efi/EFI/refind/icons/os_bionic.png
/boot/efi/EFI/refind/icons/os_centos.png
/boot/efi/EFI/refind/icons/os_chakra.png
/boot/efi/EFI/refind/icons/os_chrome.png
/boot/efi/EFI/refind/icons/os_clover.png
/boot/efi/EFI/refind/icons/os_crunchbang.png
/boot/efi/EFI/refind/icons/os_debian.png
/boot/efi/EFI/refind/icons/os_devuan.png
/boot/efi/EFI/refind/icons/os_elementary.png
/boot/efi/EFI/refind/icons/os_fedora.png
/boot/efi/EFI/refind/icons/os_freebsd.png
/boot/efi/EFI/refind/icons/os_frugalware.png
/boot/efi/EFI/refind/icons/os_gentoo.png
/boot/efi/EFI/refind/icons/os_gummiboot.png
/boot/efi/EFI/refind/icons/os_haiku.png
/boot/efi/EFI/refind/icons/os_hwtest.png
/boot/efi/EFI/refind/icons/os_kubuntu.png
/boot/efi/EFI/refind/icons/os_legacy.png
/boot/efi/EFI/refind/icons/os_linux.png
/boot/efi/EFI/refind/icons/os_linuxmint.png
/boot/efi/EFI/refind/icons/os_lubuntu.png
/boot/efi/EFI/refind/icons/os_mac.png
/boot/efi/EFI/refind/icons/os_mageia.png
/boot/efi/EFI/refind/icons/os_mandriva.png
/boot/efi/EFI/refind/icons/os_manjaro.png
/boot/efi/EFI/refind/icons/os_netbsd.png
/boot/efi/EFI/refind/icons/os_network.png
/boot/efi/EFI/refind/icons/os_opensuse.png
/boot/efi/EFI/refind/icons/os_redhat.png
/boot/efi/EFI/refind/icons/os_refind.png
/boot/efi/EFI/refind/icons/os_refit.png
/boot/efi/EFI/refind/icons/os_slackware.png
/boot/efi/EFI/refind/icons/os_suse.png
/boot/efi/EFI/refind/icons/os_systemd.png
/boot/efi/EFI/refind/icons/os_trusty.png
/boot/efi/EFI/refind/icons/os_ubuntu.png
/boot/efi/EFI/refind/icons/os_uefi.png
/boot/efi/EFI/refind/icons/os_unknown.png
/boot/efi/EFI/refind/icons/os_void.png
/boot/efi/EFI/refind/icons/os_win.png
/boot/efi/EFI/refind/icons/os_win8.png
/boot/efi/EFI/refind/icons/os_xenial.png
/boot/efi/EFI/refind/icons/os_xubuntu.png
/boot/efi/EFI/refind/icons/os_zesty.png
/boot/efi/EFI/refind/icons/svg
/boot/efi/EFI/refind/icons/svg/boot_win.svg
/boot/efi/EFI/refind/icons/svg/func_csr_rotate.svg
/boot/efi/EFI/refind/icons/svg/mouse.svg
/boot/efi/EFI/refind/icons/svg/os_clover.svg
/boot/efi/EFI/refind/icons/svg/os_debian.svg
/boot/efi/EFI/refind/icons/svg/os_devuan.svg
/boot/efi/EFI/refind/icons/svg/os_elementary.svg
/boot/efi/EFI/refind/icons/svg/os_gummiboot.svg
/boot/efi/EFI/refind/icons/svg/os_haiku.svg
/boot/efi/EFI/refind/icons/svg/os_legacy.svg
/boot/efi/EFI/refind/icons/svg/os_mac.svg
/boot/efi/EFI/refind/icons/svg/os_netbsd.svg
/boot/efi/EFI/refind/icons/svg/os_redhat.svg
/boot/efi/EFI/refind/icons/svg/os_refind.svg
/boot/efi/EFI/refind/icons/svg/os_refit.svg
/boot/efi/EFI/refind/icons/svg/os_win.svg
/boot/efi/EFI/refind/icons/svg/os_xenial.svg
/boot/efi/EFI/refind/icons/svg/tool_fwupdate.svg
/boot/efi/EFI/refind/icons/svg/tool_memtest.svg
/boot/efi/EFI/refind/icons/svg/tool_rescue.svg
/boot/efi/EFI/refind/icons/tool_apple_rescue.png
/boot/efi/EFI/refind/icons/tool_fwupdate.png
/boot/efi/EFI/refind/icons/tool_memtest.png
/boot/efi/EFI/refind/icons/tool_mok_tool.png
/boot/efi/EFI/refind/icons/tool_netboot.png
/boot/efi/EFI/refind/icons/tool_part.png
/boot/efi/EFI/refind/icons/tool_rescue.png
/boot/efi/EFI/refind/icons/tool_shell.png
/boot/efi/EFI/refind/icons/tool_windows_rescue.png
/boot/efi/EFI/refind/icons/transparent.png
/boot/efi/EFI/refind/icons/vol_efi.png
/boot/efi/EFI/refind/icons/vol_external.png
/boot/efi/EFI/refind/icons/vol_internal.png
/boot/efi/EFI/refind/icons/vol_net.png
/boot/efi/EFI/refind/icons/vol_optical.png
/boot/efi/EFI/refind/keys
/boot/efi/EFI/refind/refind.conf
/boot/efi/EFI/refind/BOOT.CSV
/boot/efi/EFI/refind/vars
/boot/efi/EFI/refind/vars/PreviousBoot
/boot/efi/EFI/refind/themes
/boot/efi/EFI/tools



On endeavourOS, you should mount it at /efi. It can be mounted at a different spot in each distro. That being said, it should work where you have it.

OK, you can chainload the other two bootloaders very easily.

Create a file at /boot/efi/loader/entries/mint.conf with the following contents:

title  Linux Mint
efi    /EFI/ubuntu/grubx64.efi

Create another file at /boot/efi/loader/entries/refind.conf with the following contents:

title refind
efi /EFI/refind/refind_x64.efi

That should let systemd-boot chainload your other two bootloaders.

thank you, but I dont want to chain,

but want use systemd-boot (standalone) to bo directly the three distros

  • Eos, mint, and Sid…

:slight_smile: otherwise, i would use Refind directly

In that case, your best bet is to convert the other two distros to systemd-boot. Then everything will just work with no further config needed.

So I have to install systemd-boot on each one ? I think I don’t understand.

systemd-boot uses the boot loader specification(BLS) and should work with other distros which all support the BLS. If your distro doesn’t use the BLS, than you have two choices, chainload it(easy) or convert those distros to use systemd-boot(much more work).

ouch…

thank you…

1 Like

Hi @dalto,

i hope you still follow this post.

I have thought about your answer,
in fact it is possible to install systemd-boot on Debian, but :

it doesn’t seem that there are tools like Understanding reinstall-kernels like in Eos / debian

Blockquote

The script reinstall-kernels both regenerate the initrds and create/update the boot entries. It works with both dracut and mkinitcpio as long as you have either kernel-install-for-dracut(The default) or kernel-install-mkinitcpio(AUR) installed.

Blockquote

to copy/update kernels and ramdisk-images from /boot to the EFI partition…

Did you mean of such of script when you said :

Blockquote
and should work with other distros which all support the BLS.

Blockquote

in this case, I do not see the utility that these distros propose systemd-boot because it is in fact useless or even difficult to exploit because it would be necessary to copy the images by hand in the esp (particularly heavy)… I thought of creating a symbolic link of directory the esp towards the boot, that would have been easy for the maintenance, but impossible to create a symbolic link on a partition fat32 ESP. If then that’s a non-sense…

reinstall-kernels is just a script that calls kernel-install for each kernel. If you get kernel-install working, you can copy the reinstall-kernels script to almost any distro.

I use systemd-boot and kernel-install on debian and ubuntu based distros. That being said, it definitely requires some work to disconnect those distros from grub and get kernel-install working.

I haven’t tried every distro but at the very least I have done it with Neon, Ubuntu, Linux Mint and Debian. I suspect most Debian/Ubuntu-based distros would work the same.

Of course, chainloading would be much, much easier and require no changes to the other distros.

Moreover, it implies a lot of space:

a big ESP partition for the images (mine is only 200 MiB) and twice as much space for the kernels as usual (the /boot kernel must also be in the ESP)

in these conditions I doubt that used alone, systemd-boot is only useful and easily exploitable for the single-boot