sys

package
v0.0.0-...-3f84afe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBootKernelConfigMap

func GetBootKernelConfigMap(bootDir, kernelVersion string) (configMap map[string]string, err error)

GetBootKernelConfigMap reads the kernel config into a key-value map. It tries to read kernel config from ${bootDir}/config-${kernelVersion}, and comments are ignored. If the bootDir is empty, it points to /boot by default.

func GetKernelRelease

func GetKernelRelease() (string, error)

GetKernelRelease returns the kernel release string.

func GetOSDistro

func GetOSDistro(osReleaseContent string) (string, error)

GetOSDistro reads the /etc/os-release file and returns the ID field.

func GetProcKernelConfigMap

func GetProcKernelConfigMap(procDir string) (configMap map[string]string, err error)

GetProcKernelConfigMap reads the kernel config into a key-value map. It tries to read kernel config from procfs mounted at procDir from the view of processName in namespace. If the procDir is empty, it points to /proc by default.

func GetSystemBlockDeviceInfo

func GetSystemBlockDeviceInfo() (map[string]types.BlockDeviceInfo, error)

GetSystemBlockDeviceInfo returns the block device info for the system.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL