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:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user