Merge pull request #15290 from dfr/freebsd-build

FreeBSD build fixes for pkg/util and pkg/machine
This commit is contained in:
OpenShift Merge Robot 2022-08-13 11:41:57 +00:00 committed by GitHub
commit 4136496ee7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 54 additions and 2 deletions

View File

@ -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:

View File

@ -0,0 +1,8 @@
//go:build freebsd
// +build freebsd
package machine
func getLocalTimeZone() (string, error) {
return "", nil
}

View File

@ -0,0 +1,13 @@
package qemu
import (
"os"
)
func getRuntimeDir() (string, error) {
tmpDir, ok := os.LookupEnv("TMPDIR")
if !ok {
tmpDir = "/tmp"
}
return tmpDir, nil
}

View File

@ -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
pkg/util/utils_freebsd.go Normal file
View File

@ -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")
}

View File

@ -1,5 +1,5 @@
//go:build darwin || windows
// +build darwin windows
//go:build darwin || windows || freebsd
// +build darwin windows freebsd
package util