From e1cf3df886534180553e09a45ba19672cf400b0d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 6 Mar 2024 16:01:10 +0100 Subject: [PATCH] bib: tweak EnsureEnvironment() based on the feedback from Colin --- bib/internal/setup/setup.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bib/internal/setup/setup.go b/bib/internal/setup/setup.go index d3c9ec8d..d6d4d546 100644 --- a/bib/internal/setup/setup.go +++ b/bib/internal/setup/setup.go @@ -48,18 +48,19 @@ func EnsureEnvironment() error { if err := util.RunCmdSync("chcon", installType, destPath); err != nil { return err } - // Create a bind mount into our target location; we can't copy it because - // again we have to perserve the SELinux label. - if err := util.RunCmdSync("mount", "--bind", destPath, osbuildPath); err != nil { - return err - } // Ensure we have devfs inside the container to get dynamic loop // loop devices inside the container. - devMnt := "/dev/" - if err := util.RunCmdSync("mount", "-t", "devtmpfs", "devtmpfs", devMnt); err != nil { + if err := util.RunCmdSync("mount", "-t", "devtmpfs", "devtmpfs", "/dev"); err != nil { + return err + } + + // Create a bind mount into our target location; we can't copy it because + // again we have to perserve the SELinux label. + if err := util.RunCmdSync("mount", "--bind", destPath, osbuildPath); err != nil { return err } + // NOTE: Don't add new code here, do it before the bind mount which acts as the final success indicator return nil }