modules

package
v0.0.0-...-02cb986 Latest Latest
Warning

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

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

Documentation

Overview

Package modules provides fucntionality to install and sign Linux kernel modules.

Package modules provides fucntionality to install and sign Linux kernel modules.

Index

Constants

View Source
const (
	// PKEYIDPKCS7 is a constant defined in https://github.com/torvalds/linux/blob/master/scripts/sign-file.c
	PKEYIDPKCS7 = byte(2)

	SecondaryKeyring = "%keyring:.secondary_trusted_keys"
	IMAKeyring       = "%keyring:.ima"
)

Variables

This section is empty.

Functions

func AppendSignature

func AppendSignature(outfilePath, modulefilePath, sigfilePath string) error

AppendSignature appends a raw PKCS#7 signature to the end of a given kernel module. This is basically the Go implementation of `scripts/sign-file -s` in Linux upstream.

func LoadModule

func LoadModule(module *Module, moduleParams ModuleParameters) error

LoadModule loads a given kernel module to kernel.

func LoadPublicKey

func LoadPublicKey(keyName, keyPath, keyring string) error

LoadPublicKey loads the given public key to system keyring.

func UpdateHostLdCache

func UpdateHostLdCache(hostRootDir, moduleLibDir string) error

UpdateHostLdCache updates the ld cache on host.

Types

type Module

type Module struct {
	Name         string
	Path         string
	Deps         []*Module
	SkipNotFound bool
}

type ModuleParameters

type ModuleParameters map[string][]string

func NewModuleParameters

func NewModuleParameters() ModuleParameters

func (*ModuleParameters) Set

func (i *ModuleParameters) Set(value string) error

func (*ModuleParameters) String

func (i *ModuleParameters) String() string

Jump to

Keyboard shortcuts

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