Skip to content

Commit

Permalink
bib: tweak EnsureEnvironment() based on the feedback from Colin
Browse files Browse the repository at this point in the history
  • Loading branch information
mvo5 authored and cgwalters committed Mar 6, 2024
1 parent 3d68e37 commit 3673011
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions bib/internal/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 3673011

Please sign in to comment.