mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-11-10 20:16:36 +00:00
At present they use a small shared function called "prepare" that does the read-write remounts, that I will switch to doing overlay mounts soon. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
22 lines
469 B
Go
22 lines
469 B
Go
package main
|
|
|
|
// Please note this file is shared between pkg/runc and pkg/containerd
|
|
// Update it in both places if you make changes
|
|
|
|
import (
|
|
"path/filepath"
|
|
"syscall"
|
|
)
|
|
|
|
func prepare(path string) error {
|
|
rootfs := filepath.Join(path, "rootfs")
|
|
if err := syscall.Mount(rootfs, rootfs, "", syscall.MS_BIND, ""); err != nil {
|
|
return err
|
|
}
|
|
// remount rw
|
|
if err := syscall.Mount("", rootfs, "", syscall.MS_REMOUNT, ""); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|