Skip to content

Commit

Permalink
Merge pull request #1438 from hqhq/fix_rootfs_comments
Browse files Browse the repository at this point in the history
Fix comments about when to pivot_root
  • Loading branch information
crosbymichael authored May 6, 2017
2 parents d37c558 + 96e0df7 commit 2daa115
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions libcontainer/rootfs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ func needsSetupDev(config *configs.Config) bool {
}

// prepareRootfs sets up the devices, mount points, and filesystems for use
// inside a new mount namespace. It doesn't set anything as ro or pivot_root,
// because console setup happens inside the caller. You must call
// finalizeRootfs in order to finish the rootfs setup.
// inside a new mount namespace. It doesn't set anything as ro. You must call
// finalizeRootfs after this function to finish setting up the rootfs.
func prepareRootfs(pipe io.ReadWriter, config *configs.Config) (err error) {
if err := prepareRoot(config); err != nil {
return newSystemErrorWithCause(err, "preparing rootfs")
Expand Down Expand Up @@ -114,8 +113,8 @@ func prepareRootfs(pipe io.ReadWriter, config *configs.Config) (err error) {
return nil
}

// finalizeRootfs actually switches the root of the process and sets anything
// to ro if necessary. You must call prepareRootfs first.
// finalizeRootfs sets anything to ro if necessary. You must call
// prepareRootfs first.
func finalizeRootfs(config *configs.Config) (err error) {
// remount dev as ro if specified
for _, m := range config.Mounts {
Expand Down

0 comments on commit 2daa115

Please sign in to comment.