Documentation ¶
Index ¶
- func Mount(mountpoints *Points) (err error)
- func Move(mountpoints *Points, prefix string) (err error)
- func PrefixMountTargets(mountpoints *Points, targetPrefix string) error
- func SystemPartitionMount(r runtime.Runtime, logger *log.Logger, label string, opts ...Option) (err error)
- func SystemPartitionUnmount(r runtime.Runtime, logger *log.Logger, label string) (err error)
- func Unmount(mountpoints *Points) (err error)
- func UnmountAll() error
- type Flags
- type Hook
- type Option
- type Options
- type Point
- func (p *Point) Data() string
- func (p *Point) Flags() uintptr
- func (p *Point) Fstype() string
- func (p *Point) GrowFilesystem() (err error)
- func (p *Point) IsMounted() (bool, error)
- func (p *Point) Mount() (err error)
- func (p *Point) Move(prefix string) (err error)
- func (p *Point) ResizePartition() (resized bool, err error)
- func (p *Point) Source() string
- func (p *Point) Target() string
- func (p *Point) Unmount() (err error)
- type PointMap
- type Points
- func BPFMountPoints() (mountpoints *Points, err error)
- func CGroupMountPoints() (mountpoints *Points, err error)
- func NewMountPoints() *Points
- func OverlayMountPoints() (mountpoints *Points, err error)
- func PseudoMountPoints() (mountpoints *Points, err error)
- func PseudoSubMountPoints() (mountpoints *Points, err error)
- func SquashfsMountPoints(prefix string) (mountpoints *Points, err error)
- func SystemMountPointsForDevice(devpath string, opts ...Option) (mountpoints *Points, err error)
- type PointsIterator
- type RetryFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Move ¶ added in v0.5.0
Move moves the device(s). TODO(andrewrynhard): We need to skip calling the move method on mountpoints that are a child of another mountpoint. The kernel will handle moving the child mountpoints for us.
func PrefixMountTargets ¶ added in v0.7.0
PrefixMountTargets prefixes all mountpoints targets with fixed path.
func SystemPartitionMount ¶ added in v0.7.0
func SystemPartitionMount(r runtime.Runtime, logger *log.Logger, label string, opts ...Option) (err error)
SystemPartitionMount mounts a system partition by the label.
func SystemPartitionUnmount ¶ added in v0.7.0
SystemPartitionUnmount unmounts a system partition by the label.
func UnmountAll ¶ added in v0.8.2
func UnmountAll() error
UnmountAll attempts to unmount all the mounted filesystems via "self" mountinfo.
Types ¶
type Flags ¶ added in v0.9.0
type Flags uint
Flags is the mount flags.
const ( // ReadOnly is a flag for setting the mount point as readonly. ReadOnly Flags = 1 << iota Shared // Resize indicates that a the partition for a given mount point should be // resized to the maximum allowed. Resize // Overlay indicates that a the partition for a given mount point should be // mounted using overlayfs. Overlay // SystemOverlay indicates that overlay directory should be created under tmpfs. // // SystemOverlay should be combined with Overlay option. SystemOverlay // ReadonlyOverlay indicates that a the partition for a given mount point should be // mounted using multi-layer readonly overlay from multiple partitions given as sources. ReadonlyOverlay // SkipIfMounted is a flag for skipping mount if the mountpoint is already mounted. SkipIfMounted // SkipIfNoFilesystem is a flag for skipping formatting and mounting if the mountpoint has not filesystem. SkipIfNoFilesystem )
func (Flags) Intersects ¶ added in v0.9.0
Intersects checks if at least one flag is set.
type Option ¶
type Option func(*Options)
Option is the functional option func.
func WithEncryptionConfig ¶ added in v0.9.0
func WithEncryptionConfig(cfg config.Encryption) Option
WithEncryptionConfig partition encryption configuration.
func WithPostUnmountHooks ¶ added in v0.9.0
WithPostUnmountHooks adds functions to be called after unmounting the partition.
func WithPreMountHooks ¶ added in v0.9.0
WithPreMountHooks adds functions to be called before mounting the partition.
func WithPrefix ¶
WithPrefix is a functional option for setting the mount point prefix.
type Options ¶
type Options struct { Loopback string Prefix string MountFlags Flags PreMountHooks []Hook PostUnmountHooks []Hook Encryption config.Encryption }
Options is the functional options struct.
func NewDefaultOptions ¶
NewDefaultOptions initializes a Options struct with default values.
type Point ¶
type Point struct { *Options // contains filtered or unexported fields }
Point represents a Linux mount point.
func NewMountPoint ¶
func NewMountPoint(source, target, fstype string, flags uintptr, data string, setters ...Option) *Point
NewMountPoint initializes and returns a Point struct.
func SystemMountPointForLabel ¶ added in v0.5.0
func SystemMountPointForLabel(device *blockdevice.BlockDevice, label string, opts ...Option) (mountpoint *Point, err error)
SystemMountPointForLabel returns a mount point for the specified device and label.
func (*Point) GrowFilesystem ¶ added in v0.2.0
GrowFilesystem grows a partition's filesystem to the maximum size allowed. NB: An XFS partition MUST be mounted, or this will fail.
func (*Point) IsMounted ¶ added in v0.4.0
IsMounted checks whether mount point is active under /proc/mounts.
func (*Point) Mount ¶ added in v0.2.0
Mount attempts to retry a mount on EBUSY. It will attempt a retry every 100 milliseconds over the course of 5 seconds.
func (*Point) ResizePartition ¶ added in v0.2.0
ResizePartition resizes a partition to the maximum size allowed.
type Points ¶
type Points struct {
// contains filtered or unexported fields
}
Points represents an ordered set of mount points.
func BPFMountPoints ¶ added in v0.5.0
BPFMountPoints returns the bpf mount points.
func CGroupMountPoints ¶ added in v0.5.0
CGroupMountPoints returns the cgroup mount points.
func NewMountPoints ¶
func NewMountPoints() *Points
NewMountPoints initializes and returns a Points struct.
func OverlayMountPoints ¶ added in v0.5.0
OverlayMountPoints returns the mountpoints required to boot the system. These mountpoints are used as overlays on top of the read only rootfs.
func PseudoMountPoints ¶ added in v0.5.0
PseudoMountPoints returns the mountpoints required to boot the system.
func PseudoSubMountPoints ¶ added in v0.5.0
PseudoSubMountPoints returns the mountpoints required to boot the system.
func SquashfsMountPoints ¶ added in v0.5.0
SquashfsMountPoints returns the mountpoints required to boot the system.
func SystemMountPointsForDevice ¶ added in v0.5.0
SystemMountPointsForDevice returns the mountpoints required to boot the system. This function is called exclusively during installations ( both image creation and bare metall installs ). This is why we want to look up device by specified disk as well as why we don't want to grow any filesystems.
func (*Points) Iter ¶
func (p *Points) Iter() *PointsIterator
Iter initializes and returns a mount point iterator.
func (*Points) IterRev ¶
func (p *Points) IterRev() *PointsIterator
IterRev initializes and returns a mount point iterator that advances in reverse.
type PointsIterator ¶
type PointsIterator struct {
// contains filtered or unexported fields
}
PointsIterator represents an iteratable group of mount points.
func (*PointsIterator) Next ¶
func (i *PointsIterator) Next() bool
Next advances the iterator to the next value.
func (*PointsIterator) Value ¶
func (i *PointsIterator) Value() *Point
Value returns current mount point.