Documentation
¶
Index ¶
- Variables
- func AmHostRoot() bool
- func EnsureDir(dir string) error
- func FileChanged(a os.FileInfo, path string) bool
- func GetBackingDevice(mountpoint string) (string, error)
- func GetMountNSName() (string, error)
- func GuestMount(fsImgFile string, mountpoint string, fuseCmd FuseCmd) error
- func HostMount(fsImgFile string, fsType string, mountpoint string, rootHash string, ...) error
- func IsEmptyDir(path string) (bool, error)
- func IsMountedAtDir(_, dest string) (bool, error)
- func IsMountpoint(dest string) bool
- func MaybeCleanupBackingDevice(devPath string) error
- func PathExists(d string) bool
- func ReplacePathSeparators(p string) string
- func RuntimeDir(metadir string) string
- func Umount(mountpoint string) error
- func Which(name string) string
- type ExcludePaths
- type FuseCmd
Constants ¶
This section is empty.
Variables ¶
var TestOverrideRuntimeDirKey = "ATOMFS_TEST_RUN_DIR"
Functions ¶
func AmHostRoot ¶
func AmHostRoot() bool
func GetBackingDevice ¶
func GetMountNSName ¶
func GuestMount ¶
Mount a filesystem as container root, without host root privileges. We do this using fuse "cmd" which is passed in from actual filesystem backends.
func IsEmptyDir ¶
func IsMountedAtDir ¶
func IsMountpoint ¶
func MaybeCleanupBackingDevice ¶
given a device path that had been used as the backing device for a squash mountpoint, cleans up and detaches verity device if it still exists.
If the device path does not exist, that is OK - this happens if the device was a regular loopback and not -verity.
func PathExists ¶
func ReplacePathSeparators ¶
remove dir separators to make one dir name. It is OK that this can't be cleanly backed out, we don't need it to
func RuntimeDir ¶
Allow overriding runtime dir for tests so we can assert empty dirs, etc.
Types ¶
type ExcludePaths ¶
type ExcludePaths struct {
// contains filtered or unexported fields
}
ExcludePaths represents a list of paths to exclude in a filesystem listing. Users should do something like filepath.Walk() over the whole filesystem, calling AddExclude() or AddInclude() based on whether they want to include or exclude a particular file. Note that if e.g. /usr is excluded, then everyting underneath is also implicitly excluded. The AddExclude()/AddInclude() methods do the math to figure out what is the correct set of things to exclude or include based on what paths have been previously included or excluded.
func NewExcludePaths ¶
func NewExcludePaths() *ExcludePaths
func (*ExcludePaths) AddExclude ¶
func (eps *ExcludePaths) AddExclude(p string)
func (*ExcludePaths) AddInclude ¶
func (eps *ExcludePaths) AddInclude(orig string, isDir bool)
func (*ExcludePaths) String ¶
func (eps *ExcludePaths) String() (string, error)