-
Notifications
You must be signed in to change notification settings - Fork 7
mount: enable bind mounting folders from initrd #21
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
base: main
Are you sure you want to change the base?
Conversation
src/cmdline.rs
Outdated
|
|
||
| #[test] | ||
| fn test_rsinit_bind() { | ||
| let cmdline = "root=/dev/root rsinit.bind=/lib/modules\n"; |
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.
Why the new line?
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.
Good question, the test fails if it isn't added. I haven't looked deeply into the parsing logic though.
src/cmdline.rs
Outdated
| pub nfsroot: Option<String>, | ||
| pub init: String, | ||
| pub cleanup: bool, | ||
| pub bind_mount: Option<String>, |
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.
Does this allow for multiple bind_mount= parameters?
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.
No, but I can add them if you want
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.
Added, please have a look.
5e190af to
8f15fd9
Compare
8f15fd9 to
8afa205
Compare
|
So this is not something I want in the main rsinit binary. I see the use-case for something like that and I think we should have a "development" init for this and other features. The goal would be to create one "development" init that can cover most development use-cases. |
| "init" => options.init = ensure_value(key, value)?.into(), | ||
| "rsinit.bind" => options | ||
| .bind_mount | ||
| .push(ensure_value(key, value)?.to_string()), |
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 this will obviously not work like this from a separate crate. What would be a good way in rust to make the parser extendable? I'm looking for something where a custom function would be called for any unknown command-line option.
For the bind-mount case in particular, I think it makes sense to configure the mounts in the initramfs (some kind of config file?) since that's where the directories that are mounted come from anyways.
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 I had a stab at implementing callbacks at various stages of the rsinit binary, which allows implementing the functionality of this PR e.g. parsing the necessary command line options and running custom commands e.g. after the rootfs was setup. I opened a RFC PR for that #22
Agreed, separating this from the main rsinit implementation is a good idea.
I'm for the workspace solution. I don't see the need for another repository (yet) at this point.
|
No description provided.