From 445de61a80c8a7f79a77d4da795970cfc386f66f Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Tue, 27 Sep 2022 12:19:51 +0200 Subject: [PATCH] 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. --- internal/manifest/commit_deployment.go | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/internal/manifest/commit_deployment.go b/internal/manifest/commit_deployment.go index 928651ae9..03cdf6763 100644 --- a/internal/manifest/commit_deployment.go +++ b/internal/manifest/commit_deployment.go @@ -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)