Skip to content

Commit

Permalink
Rename utils -> util
Browse files Browse the repository at this point in the history
Per style.
  • Loading branch information
cgwalters authored and achilleas-k committed Jan 10, 2024
1 parent 948adfc commit 0dd9197
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions bib/internal/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import (
"path/filepath"

"github.com/osbuild/bootc-image-builder/bib/internal/podmanutil"
"github.com/osbuild/bootc-image-builder/bib/internal/utils"
"github.com/osbuild/bootc-image-builder/bib/internal/util"
"golang.org/x/sys/unix"
)

// EnsureEnvironment mutates external filesystem state as necessary
// to run in a container environment. This function is idempotent.
func EnsureEnvironment() error {
osbuildPath := "/usr/bin/osbuild"
if utils.IsMountpoint(osbuildPath) {
if util.IsMountpoint(osbuildPath) {
return nil
}

Expand All @@ -36,21 +36,21 @@ func EnsureEnvironment() error {
if err := os.MkdirAll(runTmp, 0o755); err != nil {
return err
}
if !utils.IsMountpoint(runTmp) {
if err := utils.RunCmdSync("mount", "-t", "tmpfs", "tmpfs", runTmp); err != nil {
if !util.IsMountpoint(runTmp) {
if err := util.RunCmdSync("mount", "-t", "tmpfs", "tmpfs", runTmp); err != nil {
return err
}
}
destPath := filepath.Join(runTmp, "osbuild")
if err := utils.RunCmdSync("cp", "-p", "/usr/bin/osbuild", destPath); err != nil {
if err := util.RunCmdSync("cp", "-p", "/usr/bin/osbuild", destPath); err != nil {
return err
}
if err := utils.RunCmdSync("chcon", installType, destPath); err != nil {
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 := utils.RunCmdSync("mount", "--bind", destPath, osbuildPath); err != nil {
if err := util.RunCmdSync("mount", "--bind", destPath, osbuildPath); err != nil {
return err
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion bib/internal/utils/utils.go → bib/internal/util/util.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package utils
package util

import (
"fmt"
Expand Down

0 comments on commit 0dd9197

Please sign in to comment.