Repository navigation
install: Reject a config stateroot on composefs-only images - #2567
Open
andrewdunndev wants to merge 1 commit into
Open
andrewdunndev wants to merge 1 commit into
andrewdunndev wants to merge 1 commit into
Conversation
The composefs backend only uses the `default` stateroot. bootc-dev#2544 made `--stateroot` fail with it and left a stateroot from the install configuration unchecked, since an image may set one for its ostree installs. An image that ships a UKI, or selects composefs itself with no ostree prepare-root.conf, can't be installed with ostree, so its configured stateroot was always ignored and the install still landed in `default`. Check the configured stateroot for those images too, unless `--stateroot` is passed. With `--composefs-backend` on an image that can also be installed with ostree, it's still ignored. Assisted-by: AI Signed-off-by: Andrew Dunn <andrew@dunn.dev>
| "--stateroot {stateroot} is not supported with the composefs backend, which only uses {default}" | ||
| ); | ||
| } | ||
| if let (None, Some(stateroot)) = (stateroot, config_stateroot.filter(|&s| s != default)) |
Member
There was a problem hiding this comment.
This can be simplified to
Suggested change
| if let (None, Some(stateroot)) = (stateroot, config_stateroot.filter(|&s| s != default)) | |
| if let Some(stateroot) = config_stateroot.filter(|&s| s != default) |
since we're already checking stateroot in the above if?
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The composefs backend only uses the
defaultstateroot. #2544 made--staterootfail with it and left a stateroot from the install configuration unchecked, since an image may set one for its ostree installs. An image that ships a UKI, or selects composefs itself with no ostreeprepare-root.conf, can't be installed with ostree, so its configured stateroot was always ignored and the install still landed indefault.This checks the configured stateroot for those images too, unless
--staterootis passed. With--composefs-backendon an image that can also be installed with ostree, it's still ignored.flowchart TD A["prepare_install loads the install configuration<br/>stateroot = myroot"] --> B{"composefs_required (UKI) or<br/>defaults_to_composefs_backend?"} B -- no --> C["config_stateroot is None<br/>kept for ostree installs"] B -- yes --> D{"--stateroot passed?"} D -- yes --> E["Only the --stateroot check applies"] D -- no --> F["InstallComposefsOpts::validate fails<br/>stateroot myroot in the install configuration<br/>is not supported with the composefs backend,<br/>which only uses default"]Testing:
test_composefs_opts_validategets install configuration cases. On a Fedora 44 VM, with this change on #2544's branch,bootc install to-diskof an image that selects composefs and setsstateroot = "myroot"exited 1 with the new error and left no partition table, and with--stateroot defaultit installed intostate/os/default. An ostree-capable image with the same configuration installed as before on both backends. An image with a UKI wasn't tested.Assisted-by: AI