mirror of
https://github.com/rancher/os.git
synced 2025-06-28 15:56:58 +00:00
Use mount command to mount /dev
This commit is contained in:
parent
90cefae4d8
commit
360b576411
@ -9,7 +9,6 @@ import (
|
|||||||
"github.com/codegangsta/cli"
|
"github.com/codegangsta/cli"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
|
|
||||||
"github.com/docker/docker/pkg/mount"
|
|
||||||
"github.com/rancher/os/cmd/cloudinitexecute"
|
"github.com/rancher/os/cmd/cloudinitexecute"
|
||||||
"github.com/rancher/os/config"
|
"github.com/rancher/os/config"
|
||||||
"github.com/rancher/os/docker"
|
"github.com/rancher/os/docker"
|
||||||
@ -22,8 +21,11 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func entrypointAction(c *cli.Context) error {
|
func entrypointAction(c *cli.Context) error {
|
||||||
if err := mount.Mount("/host/dev", "/dev", "", "rbind"); err != nil {
|
if _, err := os.Stat("/host/dev"); err == nil {
|
||||||
log.Error(err)
|
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) {
|
if err := util.FileCopy(caBase, ca); err != nil && !os.IsNotExist(err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user