-
Notifications
You must be signed in to change notification settings - Fork 49
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 option in /proc/cmdline to enable/disable the generator #43
Conversation
Anaconda folks have decided to deprecate inst.zram and leave it up to zram-generator folks if there's a use case for command line inhibition. |
In that case, I think it is not worth implementing some option to disable it. |
Yeah, I think its "defaultness" (the state of whether it is or is not enabled by default) is so fundamental to the image in question that it must be correct. |
I think it'd be worthwhile to have a kernel-commandline option. I'm not sure about the name though. |
|
Updated with |
src/main.rs
Outdated
@@ -65,14 +65,22 @@ fn main() -> Result<()> { | |||
|
|||
let _ = kernlog::init_with_level(log_level); | |||
|
|||
let kernel_override = || match config::kernel_zram_option(root) { | |||
Some(false) => std::process::exit(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.
sth like {info!("Disabled by kernel cmdline option"); return Ok(())}
would be better
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.
But that'd just return from the closure, no?
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.
Oh, I'd missed the closure part; IIRC the log is explicitly flushed, so even though "no destructors on the current stack or any other thread's stack will be run", an info!(); exit(0)
should be fine, if imperfect, but all alternatives I came up with are even uglier, so.
bfd3076
to
41ff670
Compare
Pfff, time flies. Updated with a few minor typo fixes and |
41ff670
to
80fb430
Compare
See the man page diff for description of semantics.
Looking at the confusion in https://bugzilla.redhat.com/show_bug.cgi?id=1861463, I think it's always good to be very explicit where some file came from.
80fb430
to
fa8ea44
Compare
... and rebased. |
Closes #42.