many: initial systemd-boot support#2392
Open
supakeen wants to merge 5 commits into
Open
Conversation
25385a3 to
679a18b
Compare
supakeen
added a commit
to teamsbc/artifacts
that referenced
this pull request
Jun 1, 2026
Switch over the `standard` image type to use `systemd-boot`. This cannot land yet as upstream `image-builder` hasn't landed support but a PR for this is open [1]. [1]: osbuild/images#2392 Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
brlane-rht
requested changes
Jun 2, 2026
Contributor
brlane-rht
left a comment
There was a problem hiding this comment.
Looks pretty good to me, one minor comment and one error I assume is because you changed your mind about naming the stage :)
This implements the recently added (and expanded) `bootctl.install.root` stage in `osbuild` so it can be used in `images`. Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
A new toggle in the `osbuild` `fix-bls` stage allows us to replace paths that don't have a prefix. When BLS files are created by `90-loaderentry` there won't be any other prefix than `/boot` which without setting this flag wouldn't be replaced. Replacement of `/boot` is necessary when `/boot` is a mountpoint (either XBOOTLDR, or on the ESP directly. Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
Implement a new bootmode that indicates that `systemd-boot` should be used. Also add some tests that we didn't have before to ensure round trips between the string representations of the enums. Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
This commit introduces the initial support for `systemd-boot` to the pipeline generators. `systemd-boot` follows the BLS quite strictly so in `os.go` we set the boot root depending on if the ESP *and* XBOOTLDR exist or only the ESP. The user (the one who writes YAML) has to ensure the ESP is large enough if no XBOOTLDR is provided. The installation of `systemd-boot` happens in the `image` pipeline generator as `systemd-boot` is quite strict about vetting mountpoints and filesystems. In the future it might be able to run in the `os` pipeline but that will require a new `systemd` release. Lots of opportunities for cleanups here. For example generalizing the finding of partitions in `os.go` to `disk/` but also the behavior for the `/efi` vs `/boot` automatic mountpoint assignment if we want to. We probably should also be much more strict on the partition tables in this case, but that can also come later. Tested locally with setups with either only an ESP (mounted to /boot) or an ESP and an XBOOTLDR (/efi and /boot respectively) which works. Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
GPT type UUIDs are often set directly in the YAML definitions; if so users are likely to copy/paste them from somewhere else where mixed casing exists. Let's make sure we compare case insensitively for UUIDs in this case. Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements the new/changes stages for
bootctl.install.rootandfix-bls. It then introduces a new bootloadersystemd.When/if
systemd-bootis selected as the bootloader in a platform we automatically determine the boot-root in the way the BLS dictates us to do. We don't installsystemd-bootinside theospipeline as it does checks on the paths it is given to determine if they are actual mountpoints and/or filesystems. We pass the ESP/XBOOTLDR explicitly but they could also be auto-detected if we want that.This works in my testing for YAML definitions that have only an ESP, or both an ESP and XBOOTLDR.
There's probably plenty we can improve here such as moving the find*Mountpoint functions into
pkg/diskand generalizing them; however I'd like to do that as part of more sweeping change topkg/diskwhere I'll also cover auto-mountpoints, auto-types, based on the recently added policies.Let's not have a boot test yet until I've used this for a bit and am sure it's stable and doesn't need to change. There are likely functionalities missing that I might like still and haven't thought about yet.