kernel

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentRelease

func CurrentRelease() (string, error)

CurrentRelease returns the current kernel release ensuring that ubuntu and debian release numbers are accurate.

func CurrentVersion

func CurrentVersion() (uint32, error)

CurrentVersion returns the current kernel version in LINUX_VERSION_CODE format (see VersionFromRelease())

func Version

func Version(major, minor, patch int) uint32

Version implements KERNEL_VERSION equivalent macro #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))

func VersionFromRelease

func VersionFromRelease(releaseString string) (uint32, error)

VersionFromRelease converts a release string with format 4.4.2[-1] to a kernel version number in LINUX_VERSION_CODE format. That is, for kernel "a.b.c", the version number will be (a<<16 + b<<8 + c)

Types

This section is empty.

Jump to

Keyboard shortcuts

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