distro: fix bootc default filesystem handling when missing #2007
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.
[this will unblock https://github.com/osbuild/image-builder-cli/pull/324]
We need a way to
a) set the bootc default filesystem
b) detect when its unset and provide a clear error
This commit fixes both issue, we had a way to setup the default filesystem but that is now applied too late because we now share the partition table loading with the generic image types which have no concept of an empty default. So this moves the default-fs setting into the
bootc.NewBootcDistro()as a newDistroOptionsstruct.It also adds a proper error type for when no default-fs is set, this way ibcli can detect this and pick a default on its own (this is what Achilleas suggested in [0]).
There is also a bugfix in setupDefaultFS() so that we do not switch to "btrfs" on the /boot partition. This is the wrong layer to know about /boot and details like this, we will need a followup that moves this into disk instead.
[0] osbuild/image-builder-cli#324 (comment)