-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bootc-fstab-edit: 2 small improvements #1113
Open
champtar
wants to merge
2
commits into
bootc-dev:main
Choose a base branch
from
champtar:fstab-comment-line
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+35
−7
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK so just to make sure we're on the same page:
defaults
Is that right? (Mainly the second part)
If so...yes, I'm fine with this, we can merge it.
But the more I think about this the more I feel a stronger fix is for us to change the generator to actually hard switch to
rootflags
in the kargs too. That would fix the non-defaults
mount option case (which is an important one because it's common to have root mount arguments for e.g. btrfs).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct,
defaults
already handles most non btrfs use cases I guess (my personal focus is RHEL/Alma, not Fedora)the why is because rollback is a must for how we use rpm-ostree today, if a bug is discovered in our appliance, support team needs to be able to bisect when the bug appeared, so "upgrading" to old version is a must. As for runtime disabling of composefs not sure it make sense indeed.
So something like:
/
line/
line ?Do we have the option to edit kargs inplace just for the current deployment ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, definitely. There's an intentionally-obscure command
ostree admin instutil set-kargs
because part of the philosophy here is that deployments should be "immutable" mostly, and if you change kargs you want a rollback.But it's just using a public API https://github.com/ostreedev/ostree/blob/82b660b12dd886439912cc38d1f6316f32ec8599/src/ostree/ot-admin-instutil-builtin-set-kargs.c#L109
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So to flesh this out then, I think in the non-
defaults
case, we would generate a systemd unit that does e.g.ExecStart=bootc internals convert-to-rootflags
and in thatconvert-to-rootflags
code we'd do the karg mutations.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we are abusing generators here, there is nothing dynamic, if we want a check before running we can use
ExecCondition=
, but we could just always run and say there is nothing to do, so in the end we run bootc only once.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cgwalters what do you think of
Then in
fixup-etc-fstab
we always setrootflags
if missing (set todefaults
if there is no/
line), and always comment the/
line.With all the conditions we don't need a generator anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the end my goal in using generators for this is mostly cosmetic - it means we don't display the "Starting bootc-fstab fixup" log message to the console (or the journal) if we don't have anything to do.
In a quick test, it looks like even with a unit that does
ExecCondition=/bin/sh -c 'exit 1'
we do still log the starting message to the journal and the console.I am not opposed if you want to do that, but I am not excited by it either.