Repository navigation
defs: allow templating kernel arguments - #2818
Merged
Merged
Conversation
Allow for using Go templates in kernel arguments. This has a singular main use case (see [1]). When building UKIs we need a way to couple potentially auto-mounted partitions to the UKI. "Normally" this is done by a matching `roothash` or `usrhash` value, but we aren't ready for doing that yet. UKIs should really only boot with the correct partition, but by not supplying any image filter or hashes `systemd-dissect` always selects the latest version of a partition. This means systems fail to boot if we explicitly select an older UKI. To fix this, let's allow templating the kernel arguments so we can embed an `image_filter` into the UKI's arguments that ensures we select the corresponding partitions. [1]: teamsbc/distribution#53 Signed-off-by: Simon de Vlieger <[email protected]>
croissanne
approved these changes
Nov 10, 2026
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.
Allow for using Go templates in kernel arguments. This has a singular main use case (see 1).
When building UKIs we need a way to couple potentially auto-mounted partitions to the UKI. "Normally" this is done by a matching
roothashorusrhashvalue, but we aren't ready for doing that yet.UKIs should really only boot with the correct partition, but by not supplying any image filter or hashes
systemd-dissectalways selects the latest version of a partition. This means systems fail to boot if we explicitly select an older UKI.To fix this, let's allow templating the kernel arguments so we can embed an
image_filterinto the UKI's arguments that ensures we select the corresponding partitions.This is part of few changes. I won't directly use this in TeamSBC (instead I'm using a workaround) but if/when we want to create UKIs separatey from the
ospipeline's RPM transaction we will need these options to be templateable anyhow.