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.
Description
This PR creates a new image build method,
repartition
, which doesn't add much (or any, really) new functionality, but rather re-uses existing steps, effectively combining thenew
andresize
methods.This allows the user to, using a raw image file as a basis:
image_partitions
config)mkfs
(the user chooses which partitions they want to format, as we don't know which ones are 'newly created' since we don't parse partition tables of existing images)resize2fs
This is something that was especially useful in my particular use-case, but I think it could be useful more widely as well, hence this PR :)
Use-cases
/home
partitionBackwards compatibility
I've tried to make this change entirely backwards-compatible, so that no existing builds will be affected by it.
To do this:
skip_mkfs
defaults to false, and hence the Mkfs step behaviour is unchanged (it's only currently used with thenew
method, as far as I can tell, in which case we shouldn't be skipping it by default for any partitions)resize_fs
only has an effect when using the repartition method, and hence the behaviour of the resize step should be unchanged