Documentation ¶
Index ¶
- func CreateUsernsProcess(idMap *specs.LinuxIDMapping, execFunc func(), cwd string, newMountNs bool) (int, func(), error)
- func GetDistro() (string, error)
- func GetDistroPath(rootfs string) (string, error)
- func GetKernelRelease() (string, error)
- func GetLinuxHeaderPath(distro string) (string, error)
- func KernelCurrentVersionCmp(k1Major, k1Minor int) (int, error)
- func KernelModSupported(mod string) (bool, error)
- func ParseKernelRelease(rel string) (int, int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateUsernsProcess ¶
func CreateUsernsProcess(idMap *specs.LinuxIDMapping, execFunc func(), cwd string, newMountNs bool) (int, func(), error)
CreateUsernsProcess forks the current process into a new Linux user-namespace, using the given the ID mapping (common to both uid and gid). Returns the pid of the new process and a "kill" function (so that the caller can kill the child when desired). The new process executes the given function.
NOTE: adapted from github.com/containers/storage/drivers/overlay
func GetDistroPath ¶
Obtain system's linux distribution in the passed rootfs.
func GetKernelRelease ¶
GetKernelRelease returns the kernel release (e.g., "4.18")
func GetLinuxHeaderPath ¶
Obtain location of kernel-headers for a given linux distro.
func KernelCurrentVersionCmp ¶
Compares the given kernel version versus the current kernel version. Returns 0 if versions are equal, 1 if the current kernel has higher version than the given one, -1 otherwise.
func KernelModSupported ¶
KernelModSupported returns nil if the given module is loaded in the kernel.
Types ¶
This section is empty.