Merge pull request #21558 from Luap99/freebsd-build

pkg/machine: make it build for freebsd
This commit is contained in:
openshift-merge-bot[bot]
2024-02-08 18:54:09 +00:00
committed by GitHub
5 changed files with 34 additions and 61 deletions

View File

@ -488,35 +488,35 @@ osx_alt_build_task:
task_cleanup_script: *mac_cleanup task_cleanup_script: *mac_cleanup
# Build freebsd release natively on a FreeBSD VM. # Build freebsd release natively on a FreeBSD VM.
#freebsd_alt_build_task: freebsd_alt_build_task:
# name: "FreeBSD Cross" name: "FreeBSD Cross"
# alias: freebsd_alt_build alias: freebsd_alt_build
# # Only run on 'main' and PRs against 'main' # Only run on 'main' and PRs against 'main'
# # Docs: ./contrib/cirrus/CIModes.md # Docs: ./contrib/cirrus/CIModes.md
# only_if: | only_if: |
# $CIRRUS_CHANGE_TITLE !=~ '.*CI:MACHINE.*' && $CIRRUS_CHANGE_TITLE !=~ '.*CI:MACHINE.*' &&
# ( $CIRRUS_BRANCH == 'main' || $CIRRUS_BASE_BRANCH == 'main' ) ( $CIRRUS_BRANCH == 'main' || $CIRRUS_BASE_BRANCH == 'main' )
# depends_on: depends_on:
# - build - build
# env: env:
# <<: *stdenvars <<: *stdenvars
# # Functional FreeBSD builds must be built natively since they depend on CGO # Functional FreeBSD builds must be built natively since they depend on CGO
# DISTRO_NV: freebsd-13 DISTRO_NV: freebsd-13
# VM_IMAGE_NAME: notyet VM_IMAGE_NAME: notyet
# CTR_FQIN: notyet CTR_FQIN: notyet
# CIRRUS_SHELL: "/bin/sh" CIRRUS_SHELL: "/bin/sh"
# TEST_FLAVOR: "altbuild" TEST_FLAVOR: "altbuild"
# ALT_NAME: 'FreeBSD Cross' ALT_NAME: 'FreeBSD Cross'
# freebsd_instance: freebsd_instance:
# image_family: freebsd-13-2 image_family: freebsd-13-2
# setup_script: setup_script:
# - pkg install -y gpgme bash go-md2man gmake gsed gnugrep go pkgconf - pkg install -y gpgme bash go-md2man gmake gsed gnugrep go pkgconf
# build_amd64_script: build_amd64_script:
# - gmake podman-release - gmake podman-release
# # This task cannot make use of the shared repo.tbz artifact and must # This task cannot make use of the shared repo.tbz artifact and must
# # produce a new repo.tbz artifact for consumption by 'artifacts' task. # produce a new repo.tbz artifact for consumption by 'artifacts' task.
# repo_prep_script: *repo_prep repo_prep_script: *repo_prep
# repo_artifacts: *repo_artifacts repo_artifacts: *repo_artifacts
# Verify podman is compatible with the docker python-module. # Verify podman is compatible with the docker python-module.
@ -1076,7 +1076,7 @@ success_task:
- swagger - swagger
- alt_build - alt_build
- osx_alt_build - osx_alt_build
#- freebsd_alt_build - freebsd_alt_build
#- win_installer #- win_installer
- docker-py_test - docker-py_test
- unit_test - unit_test

View File

@ -4,15 +4,7 @@ var (
QemuCommand = "qemu-system-x86_64" QemuCommand = "qemu-system-x86_64"
) )
func (v *MachineVM) addArchOptions(_ *setNewMachineCMDOpts) []string { func (v *QEMUStubber) addArchOptions(_ *setNewMachineCMDOpts) []string {
opts := []string{"-machine", "q35,accel=hvf:tcg", "-cpu", "host"} opts := []string{"-machine", "q35,accel=hvf:tcg", "-cpu", "host"}
return opts return opts
} }
func (v *MachineVM) prepare() error {
return nil
}
func (v *MachineVM) archRemovalFiles() []string {
return []string{}
}

View File

@ -4,18 +4,10 @@ var (
QemuCommand = "qemu-system-aarch64" QemuCommand = "qemu-system-aarch64"
) )
func (v *MachineVM) addArchOptions(_ *setNewMachineCMDOpts) []string { func (v *QEMUStubber) addArchOptions(_ *setNewMachineCMDOpts) []string {
opts := []string{ opts := []string{
"-machine", "virt", "-machine", "virt",
"-accel", "tcg", "-accel", "tcg",
"-cpu", "host"} "-cpu", "host"}
return opts return opts
} }
func (v *MachineVM) prepare() error {
return nil
}
func (v *MachineVM) archRemovalFiles() []string {
return []string{}
}

View File

@ -1,3 +1,5 @@
//go:build linux || freebsd
package vmconfigs package vmconfigs
import ( import (

View File

@ -1,13 +0,0 @@
package vmconfigs
import "os"
// Stubs
type HyperVConfig struct{}
type WSLConfig struct{}
type QEMUConfig struct{}
type AppleHVConfig struct{}
func getHostUID() int {
return os.Getuid()
}