FreeBSD: add build support
Signed-off-by: Tino Breddin <t@tolbrino.com>
|
@ -0,0 +1,45 @@
|
|||
package virtualbox
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/docker/machine/libmachine/log"
|
||||
)
|
||||
|
||||
// IsVTXDisabled checks if VT-X is disabled in the BIOS. If it is, the vm will fail to start.
|
||||
// If we can't be sure it is disabled, we carry on and will check the vm logs after it's started.
|
||||
// We want to check that either vmx or svm flags are present in /proc/cpuinfo.
|
||||
func (d *Driver) IsVTXDisabled() bool {
|
||||
cpuinfo, err := ioutil.ReadFile("/proc/cpuinfo")
|
||||
if err != nil {
|
||||
log.Debugf("Couldn't check that VT-X/AMD-v is enabled. Will check that the vm is properly created: %v", err)
|
||||
return false
|
||||
}
|
||||
return isVTXDisabled(cpuinfo)
|
||||
}
|
||||
|
||||
func isVTXDisabled(cpuinfo []byte) bool {
|
||||
features := [2][]byte{
|
||||
{'v', 'm', 'x'},
|
||||
{'s', 'v', 'm'},
|
||||
}
|
||||
for _, v := range features {
|
||||
if bytes.Contains(cpuinfo, v) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func detectVBoxManageCmd() string {
|
||||
return detectVBoxManageCmdInPath()
|
||||
}
|
||||
|
||||
func getShareDriveAndName() (string, string) {
|
||||
return "hosthome", "/home"
|
||||
}
|
||||
|
||||
func isHyperVInstalled() bool {
|
||||
return false
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package crashreport
|
||||
|
||||
import "os/exec"
|
||||
|
||||
func localOSVersion() string {
|
||||
command := exec.Command("uname", "-r")
|
||||
output, err := command.Output()
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return string(output)
|
||||
}
|
Before Width: | Height: | Size: 348 KiB After Width: | Height: | Size: 348 KiB |
Before Width: | Height: | Size: 311 KiB After Width: | Height: | Size: 311 KiB |
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 194 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 315 KiB After Width: | Height: | Size: 315 KiB |
Before Width: | Height: | Size: 375 KiB After Width: | Height: | Size: 375 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |