Skip to content

Commit 6dafa01

Browse files
alexlarssonachilleas-k
authored andcommitted
image: Apply disk or filesystem customization from embedded image customization
This allows bootc images to specify more detailed requirements for the partitioning, which is useful to either add extra partitions (like a separate /var), or to override details of the normal partitions (like uuids, labels, etc). This is discussed in bootc-dev/bootc#926
1 parent 2443a17 commit 6dafa01

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

bib/cmd/bootc-image-builder/image.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,18 @@ func genPartitionTable(c *ManifestConfig, customizations *blueprint.Customizatio
209209
if err != nil {
210210
return nil, fmt.Errorf("error reading disk customizations: %w", err)
211211
}
212+
213+
// Embedded disk customization applies if there was no local customization
214+
if fsCust == nil && diskCust == nil && c.SourceInfo != nil && c.SourceInfo.ImageCustomization != nil {
215+
imageCustomizations := c.SourceInfo.ImageCustomization
216+
217+
fsCust = imageCustomizations.GetFilesystems()
218+
diskCust, err = imageCustomizations.GetPartitioning()
219+
if err != nil {
220+
return nil, fmt.Errorf("error reading disk customizations: %w", err)
221+
}
222+
}
223+
212224
switch {
213225
// XXX: move into images library
214226
case fsCust != nil && diskCust != nil:

0 commit comments

Comments
 (0)