1
0
mirror of https://github.com/rancher/os.git synced 2025-06-27 15:26:50 +00:00

Use mount command to mount /dev

This commit is contained in:
Josh Curl 2016-08-23 11:07:13 -07:00
parent 90cefae4d8
commit 360b576411
No known key found for this signature in database
GPG Key ID: 82B504B9BCCFA677

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) {