1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 06:40:31 +00:00

machine support for rancherOS

This commit is contained in:
wlan0
2015-04-28 04:34:32 -07:00
parent 9c7663b0d3
commit 1626247f48
8 changed files with 93 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ package init
import (
"os"
"os/exec"
"strings"
"syscall"
log "github.com/Sirupsen/logrus"
@@ -12,6 +13,8 @@ import (
"github.com/rancherio/rancher-compose/project"
)
const boot2dockerMagic = "boot2docker, please format-me"
func autoformat(cfg *config.Config) error {
if len(cfg.State.Autoformat) == 0 || util.ResolveDevice(cfg.State.Dev) != "" {
return nil
@@ -43,10 +46,18 @@ outer:
continue
}
for _, b := range buffer {
if b != 0 {
log.Infof("%s not empty", dev)
continue outer
boot2docker := false
if strings.HasPrefix(string(buffer[:len(boot2dockerMagic)]), boot2dockerMagic) {
boot2docker = true
}
if boot2docker == false {
for _, b := range buffer {
if b != 0 {
log.Infof("%s not empty", dev)
continue outer
}
}
}
@@ -73,6 +84,9 @@ outer:
config.SCOPE + "=" + config.SYSTEM,
},
LogDriver: "json-file",
Environment: []string{
"MAGIC=" + boot2dockerMagic,
},
},
"udev": &udev,
})