diff --git a/pkg/manifest/raw_bootc.go b/pkg/manifest/raw_bootc.go index d92716fb59..3df58aeaff 100644 --- a/pkg/manifest/raw_bootc.go +++ b/pkg/manifest/raw_bootc.go @@ -129,6 +129,12 @@ func (p *RawBootcImage) serialize() osbuild.Pipeline { mounts = append(mounts, *osbuild.NewOSTreeDeploymentMountDefault("ostree.deployment", osbuild.OSTreeMountSourceMount)) mounts = append(mounts, *osbuild.NewBindMount("bind-ostree-deployment-to-tree", "mount://", "tree://")) + // we always include the fstab stage + fstabStage := osbuild.NewFSTabStage(osbuild.NewFSTabStageOptions(pt)) + fstabStage.Mounts = mounts + fstabStage.Devices = devices + pipeline.AddStage(fstabStage) + // customize the image if len(p.Groups) > 0 { groupsStage := osbuild.GenGroupsStage(p.Groups) diff --git a/pkg/manifest/raw_bootc_test.go b/pkg/manifest/raw_bootc_test.go index 3436fab4eb..45485306c1 100644 --- a/pkg/manifest/raw_bootc_test.go +++ b/pkg/manifest/raw_bootc_test.go @@ -191,3 +191,32 @@ func TestRawBootcImageSerializeCustomizationGenCorrectStages(t *testing.T) { } } } + +func RawBootcImageSerializeCommonPipelines(t *testing.T) { + expectedCommonStages := []string{ + "org.osbuild.truncate", + "org.osbuild.sfdisk", + "org.osbuild.mkfs.ext4", + "org.osbuild.mkfs.ext4", + "org.osbuild.mkfs.fat", + "org.osbuild.bootc.install-to-filesystem", + "org.osbuild.fstab", + } + rawBootcPipeline := makeFakeRawBootcPipeline() + pipeline := rawBootcPipeline.Serialize() + + pipelineStages := make([]string, len(pipeline.Stages)) + for i, st := range pipeline.Stages { + pipelineStages[i] = st.Type + } + assert.Equal(t, expectedCommonStages, pipelineStages[0:len(expectedCommonStages)]) +} + +func RawBootcImageSerializeFstabPipelineHasBootcMounts(t *testing.T) { + rawBootcPipeline := makeFakeRawBootcPipeline() + pipeline := rawBootcPipeline.Serialize() + + stage := manifest.FindStage("org.osbuild.fstab", pipeline.Stages) + assert.NotNil(t, stage) + assertBootcDeploymentAndBindMount(t, stage) +}