1
0
mirror of https://github.com/rancher/os.git synced 2025-06-30 08:41:48 +00:00

Merge pull request #1180 from joshwget/dev-mount

Use mount command to mount /dev
This commit is contained in:
Darren Shepherd 2016-08-24 14:44:20 -07:00 committed by GitHub
commit 48c40a57c5

View File

@ -9,7 +9,6 @@ import (
"github.com/codegangsta/cli"
"golang.org/x/net/context"
"github.com/docker/docker/pkg/mount"
"github.com/rancher/os/cmd/cloudinitexecute"
"github.com/rancher/os/config"
"github.com/rancher/os/docker"
@ -22,8 +21,11 @@ const (
)
func entrypointAction(c *cli.Context) error {
if err := mount.Mount("/host/dev", "/dev", "", "rbind"); err != nil {
log.Error(err)
if _, err := os.Stat("/host/dev"); err == nil {
cmd := exec.Command("mount", "--rbind", "/host/dev", "/dev")
if err := cmd.Run(); err != nil {
log.Errorf("Failed to mount /dev: %v", err)
}
}
if err := util.FileCopy(caBase, ca); err != nil && !os.IsNotExist(err) {