From 5ee3522f56f2c87db7b65e3843b6452d98bb4663 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Sun, 8 May 2022 12:56:59 +0100 Subject: pkg: Build pkg/machine on FreeBSD Add missing symbols for freebsd and freebsd/amd64. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson --- pkg/machine/ignition_freebsd.go | 8 ++++++++ pkg/machine/qemu/options_freebsd.go | 13 +++++++++++++ pkg/machine/qemu/options_freebsd_amd64.go | 18 ++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 pkg/machine/ignition_freebsd.go create mode 100644 pkg/machine/qemu/options_freebsd.go create mode 100644 pkg/machine/qemu/options_freebsd_amd64.go (limited to 'pkg/machine') diff --git a/pkg/machine/ignition_freebsd.go b/pkg/machine/ignition_freebsd.go new file mode 100644 index 000000000..ddea40782 --- /dev/null +++ b/pkg/machine/ignition_freebsd.go @@ -0,0 +1,8 @@ +//go:build freebsd +// +build freebsd + +package machine + +func getLocalTimeZone() (string, error) { + return "", nil +} diff --git a/pkg/machine/qemu/options_freebsd.go b/pkg/machine/qemu/options_freebsd.go new file mode 100644 index 000000000..124358db8 --- /dev/null +++ b/pkg/machine/qemu/options_freebsd.go @@ -0,0 +1,13 @@ +package qemu + +import ( + "os" +) + +func getRuntimeDir() (string, error) { + tmpDir, ok := os.LookupEnv("TMPDIR") + if !ok { + tmpDir = "/tmp" + } + return tmpDir, nil +} diff --git a/pkg/machine/qemu/options_freebsd_amd64.go b/pkg/machine/qemu/options_freebsd_amd64.go new file mode 100644 index 000000000..ff8d10db1 --- /dev/null +++ b/pkg/machine/qemu/options_freebsd_amd64.go @@ -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{} +} -- cgit v1.2.3-54-g00ecf