Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to remove kernel arguments during installation via a new --karg-delete CLI option and a corresponding karg-deletes field in the installation configuration. The implementation includes logic to process these deletions before applying new arguments, a helper function for precise or key-based removal, and comprehensive unit and integration tests to verify the functionality. I have no feedback to provide.
|
I wasn't sure about a few things when implementing this.
|
22c5fa8 to
8cb46ce
Compare
This adds `--karg-delete` to install. In some relatively rare use cases, one might want to remove a kernel argument shipped in the container image. Fixes: bootc-dev#1229 Signed-off-by: Terence Lee <hone02@gmail.com>
Signed-off-by: Terence Lee <hone02@gmail.com>
Signed-off-by: Terence Lee <hone02@gmail.com>
Signed-off-by: Terence Lee <hone02@gmail.com>
ccccf8a to
ddbbb3f
Compare
|
For my tmt test, I used |
…plemented for composefs Signed-off-by: Terence Lee <hone02@gmail.com>
35c3e5d to
87f13a7
Compare
|
Hi @hone, please skip Packit s390x rpm build issue. The build is successful, but status can't be updated in PR. I already ask for help in Packit channel. |
| # summary: Test bootc install --karg-delete | ||
| # duration: 30m | ||
| # extra: | ||
| # fixme_skip_if_composefs: true |
There was a problem hiding this comment.
This should work for composefs backend as well since the config gathering in the install path is pretty much the same for ostree and composefs. Were you getting some sort of error when testing this for composefs backend?
There was a problem hiding this comment.
Just that if you use --to-filesystem you need to setup the entire boot partition table, so you can't use --bootloader none.
I was looking through setup_composefs_boot and it didn't look like it handled the CLI karg/-delete args I was working on in install_container.
There was a problem hiding this comment.
We can only do this with type1 BLS though to be clear with composefs, not UKIs. We have to error out on any local karg manipulations there.
cgwalters
left a comment
There was a problem hiding this comment.
Thanks! Looks sane offhand
| if let Some(install_config_karg_deletes) = install_config_karg_deletes { | ||
| for karg_delete in install_config_karg_deletes { | ||
| karg_deletes.push(karg_delete); | ||
| } | ||
| } | ||
| if let Some(deletes) = state.config_opts.karg_delete.as_ref() { | ||
| for karg_delete in deletes { | ||
| karg_deletes.push(karg_delete); | ||
| } | ||
| } |
There was a problem hiding this comment.
Minor style nit I think this could all be one combinator chain via .chain().flatten().collect()
|
|
||
| pub(crate) fn delete_kargs(existing: &mut Cmdline, deletes: &Vec<&str>) { | ||
| for delete in deletes { | ||
| if let Some(param) = utf8::Parameter::parse(&delete) { |
There was a problem hiding this comment.
Hmm when would we get None from parsing here? Just when it's an empty string right? We should probably have filtered those out or errored if I'm right
There was a problem hiding this comment.
Empty strings or strings with only whitespace will return None, anything else should successful parse.
I think as implemented the CLI should always win, right? We should probably error with
I'm not totally parsing this - it's more that the CLI and config all fold into the bootloader ocnfig.
It's confusing, what you did is fine, but a lot of the install tests were already duplicated. It's a complex problem though, I'll write up a separate tracker issue for this. |
Following up from the contribfest session. This adds
--karg-deleteto install.In some relatively rare use cases, one might want to remove a kernel argument shipped in the container image.
Fixes: #1229