Skip to content

Commit

Permalink
Merge pull request containers#15290 from dfr/freebsd-build
Browse files Browse the repository at this point in the history
FreeBSD build fixes for pkg/util and pkg/machine
  • Loading branch information
openshift-merge-robot authored Aug 13, 2022
2 parents 2e2d752 + 5ee3522 commit 4136496
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
RM ?= rm

# Put it first so that "make" without argument is like "make help".
help:
Expand Down
8 changes: 8 additions & 0 deletions pkg/machine/ignition_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//go:build freebsd
// +build freebsd

package machine

func getLocalTimeZone() (string, error) {
return "", nil
}
13 changes: 13 additions & 0 deletions pkg/machine/qemu/options_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package qemu

import (
"os"
)

func getRuntimeDir() (string, error) {
tmpDir, ok := os.LookupEnv("TMPDIR")
if !ok {
tmpDir = "/tmp"
}
return tmpDir, nil
}
18 changes: 18 additions & 0 deletions pkg/machine/qemu/options_freebsd_amd64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package qemu

var (
QemuCommand = "qemu-system-x86_64"
)

func (v *MachineVM) addArchOptions() []string {
opts := []string{"-machine", "q35,accel=hvf:tcg", "-cpu", "host"}
return opts
}

func (v *MachineVM) prepare() error {
return nil
}

func (v *MachineVM) archRemovalFiles() []string {
return []string{}
}
12 changes: 12 additions & 0 deletions pkg/util/utils_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//go:build freebsd
// +build freebsd

package util

import (
"errors"
)

func GetContainerPidInformationDescriptors() ([]string, error) {
return []string{}, errors.New("this function is not supported on freebsd")
}
4 changes: 2 additions & 2 deletions pkg/util/utils_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build darwin || windows
// +build darwin windows
//go:build darwin || windows || freebsd
// +build darwin windows freebsd

package util

Expand Down

0 comments on commit 4136496

Please sign in to comment.