-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add kexec support #1076
base: main
Are you sure you want to change the base?
Add kexec support #1076
Conversation
db47e9c
to
585c7d3
Compare
Related to, but doesn't fix #76 |
I literally just sat down to make this change 😂. Just tested with |
When --kexec is passed, an upgrade or switch will load the new deployment into the kernel's kexec buffer I don't know how to get a bootc dev environment quickly, so it's very possible this doesn't actually work. Please feel free to take this as a base and make changes :) Signed-off-by: Mary Strodl <[email protected]>
585c7d3
to
58be6bc
Compare
@cgwalters this looks good to me! What else needs to be done to merge? |
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.
Sorry for the delay and thanks so much for starting this!
Maybe it could work out more generally to have bootc prepare-kexec
that can be applied as a secondary step after any operation?
Hmm also ideally this would be something visible in bootc status
...digging in very slightly behind what kexec --status
does it looks like there's /sys/kernel/kexec_loaded
which just gives a 1
or 0
...pretty primitive, but eh.
I guess we could store some state in e.g. /run/bootc
...or hmm, arguably the ostree API should store something in the per-deployment state.
(I should have thought about this when we merged the ostree PR, but at the bootc level I really try hard to think about spec/status and machine readable APIs)
@@ -552,6 +573,12 @@ fn origin_from_imageref(imgref: &ImageReference) -> Result<glib::KeyFile> { | |||
Ok(origin) | |||
} | |||
|
|||
#[derive(Debug, Clone, Default)] | |||
#[non_exhaustive] | |||
pub(crate) struct StageOptions { |
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.
Not opposed but this feels slightly overkill at this point - we don't have that many parameters to the function.
(And if we did we may as well move the progress writer in?)
I think a simple kexec: bool
would be OK no?
let steps_total = 4 + (deploy_kexec as u64); | ||
let mut steps = 0; |
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.
How about:
let mut steps = 4;
if deploy_kexec {
steps += 1;
}
?
Feels like it will "scale" a bit more cleanly if we have more conditionals later.
(This all said, I'd really like to have higher level wrappers for the progress API because the numbers here are SO easy to mess up)
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.
Yeah, that's pretty much the same idea, but I see how that would be cleaner.
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.
I think I originally arrived at this from:
let steps_total = 4 + if deploy_kexec { 1 } else { 0 };
When --kexec is passed, an upgrade or switch will load
the new deployment into the kernel's kexec buffer
I don't know how to get a bootc dev environment quickly,
so it's very possible this doesn't actually work.
Please feel free to take this as a base and make changes :)