I have tried to install systemd-boot as you say and also as it says here:
https://en.opensuse.org/Systemd-boot#Modified_Packages
As of November 2022 the following packages require modifications to work with systemd-boot:
- systemd: hooks to add snapshot awareness to kernel-install
- dracut: avoid overwriting existing initrds, do not delete initrds on removal in kernel-install script
- suse-module-tools: split kernel scriptlets into separate subpackage so file triggers can be used
- snapper: fixes for plugin support
- transactional-update: call snapper plugins after transaction
- patterns-microos: don't require bootloader pattern (which is grub)
- combustion: don't require ignition grub integration
I have managed to install it without any problems but it is quite limited in MicroOS.
As discussed above, if I put the /boot partition separate and unencrypted, systemd-cryptenroll with TPM2.0 works for me but I lose the ability to restore snapshots. If I put it encrypted as subvolume inside the / partition of type btrfs, I must to use LUKS1. And if I use LUKS1, systemd-cryptenroll doesn’t work.
So, I have used the following partition scheme:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 32G 0 disk
├─nvme0n1p1
│ 259:1 0 512M 0 part /boot/efi
├─nvme0n1p2
│ 259:2 0 18G 0 part
│ └─cr_root
│ 254:0 0 18G 0 crypt /boot/grub2/x86_64-efi
│ /boot/grub2/i386-pc
│ /.snapshots
│ /boot/writable
│ /opt
│ /srv
│ /usr/local
│ /var
│ /root
│ /
└─nvme0n1p3
259:3 0 13,5G 0 part
└─cr_home
254:1 0 13,5G 0 crypt /home
I’ve tried Clevis and can’t get it to work. However, due to the current limitations of systemd-boot in MicroOS, it’s not worth the effort. I don’t know what will come first, that GRUB2 will have support to unlock LUKS volumes, or that Systemd-boot will be fully supported in MicroOS. There is no timeline of development dates.