From 6a5d7a43341ec735bc10081f42ae82c1a328e9e9 Mon Sep 17 00:00:00 2001 From: Jason Dobies Date: Thu, 31 Oct 2024 12:26:00 -0400 Subject: [PATCH] explicitly mount and unmount /var for os files handling (#602) --- RELEASE_NOTES.md | 1 + pkg/combustion/osfiles_test.go | 2 ++ pkg/combustion/templates/19-copy-os-files.sh | 2 ++ 3 files changed, 5 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 20963113..66e7c885 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -12,6 +12,7 @@ ## Bug Fixes +* [#593](https://github.com/suse-edge/edge-image-builder/issues/593) - OS files script should mount /var * [#594](https://github.com/suse-edge/edge-image-builder/issues/594) - Package install breaks package resolution if packages is already installed on root OS --- diff --git a/pkg/combustion/osfiles_test.go b/pkg/combustion/osfiles_test.go index f4eee663..410d2b4b 100644 --- a/pkg/combustion/osfiles_test.go +++ b/pkg/combustion/osfiles_test.go @@ -48,7 +48,9 @@ func TestConfigureOSFiles(t *testing.T) { expectedCombustionScript := filepath.Join(ctx.CombustionDir, osFilesScriptName) contents, err := os.ReadFile(expectedCombustionScript) require.NoError(t, err) + assert.Contains(t, string(contents), "mount /var") assert.Contains(t, string(contents), "cp -R") + assert.Contains(t, string(contents), "umount /var") // -- Files expectedFile := filepath.Join(ctx.CombustionDir, osFilesConfigDir, "etc", "ssh", "test-config-file") diff --git a/pkg/combustion/templates/19-copy-os-files.sh b/pkg/combustion/templates/19-copy-os-files.sh index 19bb76bc..71f0725d 100644 --- a/pkg/combustion/templates/19-copy-os-files.sh +++ b/pkg/combustion/templates/19-copy-os-files.sh @@ -1,4 +1,6 @@ #!/bin/bash set -euo pipefail +mount /var cp -R ./os-files/* / +umount /var \ No newline at end of file