manifest: move ostree config stage after the deployment

Configure ostree after it's deployed and add the ostree mount.
This fixes sysroot not being mounted 'ro' in the final image when it's
booted.
This commit is contained in:
Achilleas Koutsou 2022-09-27 12:19:51 +02:00 committed by Christian Kellner
parent 9eab01874a
commit 445de61a80

View file

@ -93,17 +93,6 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
OSName: p.osName,
},
))
pipeline.AddStage(osbuild.NewOSTreeConfigStage(
&osbuild.OSTreeConfigStageOptions{
Repo: repoPath,
Config: &osbuild.OSTreeConfig{
Sysroot: &osbuild.SysrootOptions{
ReadOnly: common.BoolToPtr(true),
Bootloader: "none",
},
},
},
))
pipeline.AddStage(osbuild.NewMkdirStage(&osbuild.MkdirStageOptions{
Paths: []osbuild.Path{
{
@ -156,6 +145,20 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
},
))
configStage := osbuild.NewOSTreeConfigStage(
&osbuild.OSTreeConfigStageOptions{
Repo: repoPath,
Config: &osbuild.OSTreeConfig{
Sysroot: &osbuild.SysrootOptions{
ReadOnly: common.BoolToPtr(true),
Bootloader: "none",
},
},
},
)
configStage.MountOSTree(p.osName, p.osTreeRef, 0)
pipeline.AddStage(configStage)
fstabOptions := osbuild.NewFSTabStageOptions(p.PartitionTable)
fstabStage := osbuild.NewFSTabStage(fstabOptions)
fstabStage.MountOSTree(p.osName, p.osTreeRef, 0)