kernel

package
v0.0.2-0...-4ce78c8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Arch

func Arch() string

Arch returns the kernel architecture value, often used within the kernel `include/arch` directory.

func FindHeaderDirs

func FindHeaderDirs() ([]string, error)

FindHeaderDirs finds kernel header base directories that contain a `LINUX_VERSION_CODE` matching the running kernel. If no directories are found, it will attempt a fallback to extracting from `/sys/kernel/kheaders.tar.xz` which is enabled via the `kheaders` kernel module and the `CONFIG_KHEADERS` kernel config option. The `kheaders` module will be automatically added and removed if present and needed.

func IsDebugFSMounted

func IsDebugFSMounted() (bool, error)

IsDebugFSMounted would test the existence of file /sys/kernel/debug/tracing/kprobe_events to determine if debugfs is mounted or not returns a boolean and a possible error message

func IsIPv6Enabled

func IsIPv6Enabled() bool

IsIPv6Enabled returns whether or not IPv6 has been enabled on the host

func ValidateHeaderDir

func ValidateHeaderDir(path string) error

ValidateHeaderDir verifies that the kernel headers in the directory match the kernel version of the running host

Types

type Version

type Version uint32

Version is a numerical representation of a kernel version

func HostVersion

func HostVersion() (Version, error)

HostVersion returns the running kernel version of the host

func ParseVersion

func ParseVersion(s string) Version

ParseVersion parses a string in the format of x.x.x to a Version

func VersionCode

func VersionCode(major, minor, patch byte) Version

VersionCode returns a Version computed from the individual parts of a x.x.x version

func (Version) String

func (v Version) String() string

String returns a string representing the version in x.x.x format

Jump to

Keyboard shortcuts

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