1
0
mirror of https://github.com/rancher/os.git synced 2025-09-04 00:04:25 +00:00

Copy init and cloud-init-save logs from before switchroot

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2017-07-18 14:13:11 +10:00
parent 32061238aa
commit cbfe50c5ee
6 changed files with 51 additions and 23 deletions

View File

@@ -11,6 +11,7 @@ import (
"strings"
"syscall"
"github.com/SvenDowideit/cpuid"
"github.com/docker/docker/pkg/mount"
"github.com/rancher/os/log"
)
@@ -121,3 +122,13 @@ func Blkid(label string) (deviceName, deviceType string) {
}
return
}
// GetHypervisor tries to detect if we're running in a VM, and returns a string for its type
func GetHypervisor() string {
if cpuid.CPU.HypervisorName == "" {
log.Infof("ros init: No Detected Hypervisor")
} else {
log.Infof("ros init: Detected Hypervisor: %s", cpuid.CPU.HypervisorName)
}
return cpuid.CPU.HypervisorName
}