Skip to content

Commit

Permalink
Merge pull request #21 from ichirin2501/fix-proc-and-symlink
Browse files Browse the repository at this point in the history
fixed /proc not mounted and recursive symlink
  • Loading branch information
yuuki authored Jul 14, 2017
2 parents ad2fba9 + 2e79d78 commit 6a30fc5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mounter/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ func ResolveRootDir(dir string) (string, error) {
}

if osutil.IsSymlink(dir) {
dir, err = os.Readlink(dir)
dir, err = fp.EvalSymlinks(dir)
if err != nil {
return dir, err
}
}

return fp.Clean(dir), nil
return dir, nil
}

func (m *Mounter) MountSysProc() error {
// mount -t proc proc {{rootDir}}/proc
if err := mount.Mount("proc", fp.Join(m.rootDir, "/proc"), "proc", "remount"); err != nil {
if err := osutil.MountIfNotMounted("proc", fp.Join(m.rootDir, "/proc"), "proc", ""); err != nil {
return errors.Errorf("Failed to mount /proc: %s", err)
}
// mount --rbind /sys {{rootDir}}/sys
Expand Down

0 comments on commit 6a30fc5

Please sign in to comment.