Skip to content

Commit 2daa115

Browse files
Merge pull request #1438 from hqhq/fix_rootfs_comments
Fix comments about when to pivot_root
2 parents d37c558 + 96e0df7 commit 2daa115

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

libcontainer/rootfs_linux.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ func needsSetupDev(config *configs.Config) bool {
3737
}
3838

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

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

0 commit comments

Comments
 (0)