bootloader: Add bootc loader-entries set-options-for-source support#827
Draft
jmarrero wants to merge 1 commit intoredhat-performance:masterfrom
Draft
bootloader: Add bootc loader-entries set-options-for-source support#827jmarrero wants to merge 1 commit intoredhat-performance:masterfrom
jmarrero wants to merge 1 commit intoredhat-performance:masterfrom
Conversation
On bootc systems with transient /etc, the state file
/etc/tuned/bootcmdline is lost after each reboot. This causes
TuneD to lose track of which kernel arguments it previously
set, leading to kargs stacking up on every reboot cycle.
bootc loader-entries set-options-for-source solves this by
recording kargs ownership directly in the BLS config on /boot,
which persists across reboots regardless of /etc transience.
With --source tuned, bootc automatically removes all previous
kargs from the "tuned" source and replaces them with the new
set, eliminating the need for TuneD to maintain its own state
for diffing.
This commit adds bootc source tracking to the bootloader plugin:
1. Detect set-options-for-source availability by checking
"bootc loader-entries set-options-for-source --help" exit
code during plugin init.
2. When available, use "bootc loader-entries
set-options-for-source --source tuned --options ..." for
applying kargs and the same command without --options for
clearing all TuneD-owned kargs on profile removal.
3. The bootc path is a top-level dispatch branch, checked
before rpm-ostree. Fallback chain: bootc -> rpm-ostree
legacy --delete/--append -> GRUB2. All existing code paths
are unchanged.
4. Continue writing to /etc/tuned/bootcmdline as best-effort
for diagnostics and backward compatibility, but do not
depend on it for correctness when bootc source tracking
is available.
5. Add 15 unit tests for the bootloader plugin covering:
bootc detection (3), apply (3), removal (2), init flag
derivation (2), and top-level dispatch (5).
Requires: bootc with loader-entries set-options-for-source
(bootc PR #2114) and ostree >= 2026.1
See: bootc-dev/bootc#899
See: bootc-dev/bootc#2114
Assisted-by: OpenCode (Claude Opus 4.6)
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.
bootloader: Add bootc loader-entries set-options-for-source support
On bootc systems with transient /etc, the state file
/etc/tuned/bootcmdline is lost after each reboot. This causes
TuneD to lose track of which kernel arguments it previously
set, leading to kargs stacking up on every reboot cycle.
bootc loader-entries set-options-for-source solves this by
recording kargs ownership directly in the BLS config on /boot,
which persists across reboots regardless of /etc transience.
With --source tuned, bootc automatically removes all previous
kargs from the "tuned" source and replaces them with the new
set, eliminating the need for TuneD to maintain its own state
for diffing.
This commit adds bootc source tracking to the bootloader plugin:
Detect set-options-for-source availability by checking
"bootc loader-entries set-options-for-source --help" exit
code during plugin init.
When available, use "bootc loader-entries
set-options-for-source --source tuned --options ..." for
applying kargs and the same command without --options for
clearing all TuneD-owned kargs on profile removal.
The bootc path is a top-level dispatch branch, checked
before rpm-ostree. Fallback chain: bootc -> rpm-ostree
legacy --delete/--append -> GRUB2. All existing code paths
are unchanged.
Continue writing to /etc/tuned/bootcmdline as best-effort
for diagnostics and backward compatibility, but do not
depend on it for correctness when bootc source tracking
is available.
Add 15 unit tests for the bootloader plugin covering:
bootc detection (3), apply (3), removal (2), init flag
derivation (2), and top-level dispatch (5).
Requires: bootc with loader-entries set-options-for-source
(bootc PR #2114) and ostree >= 2026.1
See: bootc-dev/bootc#899
See: bootc-dev/bootc#2114
Assisted-by: OpenCode (Claude Opus 4.6)