Documentation
¶
Overview ¶
Package mounts bootstraps the virtual filesystem hierarchy during Phase 0 of a PID-1 boot (GAPI-DIV-027), before cgroups or the event bus exist. Ordering is load-bearing: cgroups v2 assumes the hierarchy at /sys/fs/cgroup. Container environments where the OCI runtime owns the mounts skip the phase via --no-early-mounts; the executor is also idempotent over premounted targets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var EarlyMounts = []MountSpec{
{"devtmpfs", "/dev", "devtmpfs", flagNoSuid, ""},
{"proc", "/proc", "proc", flagNoSuid | flagNoDev | flagNoExec, ""},
{"sysfs", "/sys", "sysfs", flagNoSuid | flagNoDev | flagNoExec, ""},
{"cgroup2", "/sys/fs/cgroup", "cgroup2", flagNoSuid | flagNoDev | flagNoExec | flagRelatime, ""},
{"tmpfs", "/run", "tmpfs", flagNoSuid | flagNoDev, "mode=0755"},
{"tmpfs", "/tmp", "tmpfs", flagNoSuid | flagNoDev, ""},
}
EarlyMounts is the Phase-0 mount table (gapi-architecture.md).
Functions ¶
func MountEarly ¶
MountEarly executes specs in declared order, skipping targets that are already mounted and failing closed on the first error - continuing past a missing /proc corrupts everything after it.
Types ¶
type Mounter ¶
type Mounter interface {
Mount(source, target, fstype string, flags uintptr, data string) error
IsMounted(target string) (bool, error)
MkdirAll(path string) error
}
Mounter is the syscall surface, injectable so ordering and idempotence are unit-testable unprivileged.
type SysMounter ¶
type SysMounter struct{}
SysMounter is the real mount(2) surface.
func (SysMounter) IsMounted ¶
func (SysMounter) IsMounted(target string) (bool, error)
IsMounted scans /proc/self/mountinfo for the target; when /proc is not yet mounted (the true cold-boot case) nothing is mounted, and the scan failing with not-exist reports exactly that.
func (SysMounter) MkdirAll ¶
func (SysMounter) MkdirAll(path string) error