builder

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const DriverDirectory = "/tmp/driver"

DriverDirectory is the directory the processor uses to store the driver.

View Source
const ModuleFileName = "module.ko"

ModuleFileName is the standard file name for the kernel module.

View Source
const ProbeFileName = "probe.o"

ProbeFileName is the standard file name for the eBPF probe.

Variables

View Source
var BaseImage = "placeholder" // This is overwritten when using the Makefile to build
View Source
var BuilderByTarget = Targets{}

BuilderByTarget maps targets to their builder.

View Source
var HeadersNotFoundErr = errors.New("kernel headers not found")

ModuleFullPath is the standard path for the kernel module. Builders must place the compiled module at this location.

View Source
var ProbeFullPath = path.Join(DriverDirectory, "bpf", ProbeFileName)

ProbeFullPath is the standard path for the eBPF probe. Builders must place the compiled probe at this location.

Functions

func Script added in v0.9.6

Types

type Build

type Build struct {
	TargetType         Type
	KernelConfigData   string
	KernelRelease      string
	KernelVersion      string
	DriverVersion      string
	Architecture       string
	ModuleFilePath     string
	ProbeFilePath      string
	ModuleDriverName   string
	ModuleDeviceName   string
	CustomBuilderImage string
	KernelUrls         []string
	GCCVersion         string
	RepoOrg            string
	RepoName           string
}

Build contains the info about the on-going build.

func (*Build) GetBuilderImage added in v0.10.0

func (b *Build) GetBuilderImage() string

func (*Build) KernelReleaseFromBuildConfig added in v0.9.3

func (b *Build) KernelReleaseFromBuildConfig() kernelrelease.KernelRelease

func (*Build) ToConfig added in v0.10.0

func (b *Build) ToConfig() Config

type Builder

type Builder interface {
	Name() string
	TemplateScript() string
	URLs(c Config, kr kernelrelease.KernelRelease) ([]string, error)
	TemplateData(c Config, kr kernelrelease.KernelRelease, urls []string) interface{} // error return type is managed
}

Builder represents a builder capable of generating a script for a driverkit target.

func Factory

func Factory(target Type) (Builder, error)

Factory returns a builder for the given target.

type Config

type Config struct {
	DriverName      string
	DeviceName      string
	DownloadBaseURL string
	*Build
}

Config contains all the configurations needed to build the kernel module or the eBPF probe.

type GCCVersionRequestor added in v0.10.0

type GCCVersionRequestor interface {
	GCCVersion(kr kernelrelease.KernelRelease) semver.Version
}

type Image added in v0.10.0

type Image struct {
	GCCVersion map[kernelrelease.Architecture][]string
}

type MinimumURLsBuilder added in v0.9.6

type MinimumURLsBuilder interface {
	MinimumURLs() int
}

MinimumURLsBuilder is an optional interface to specify minimum number of requested headers urls

type Targets

type Targets map[Type]Builder

Targets is a type representing the list of the supported targets.

func (Targets) Targets

func (t Targets) Targets() []string

Targets returns the list of all the supported targets.

type Type

type Type string

Type is a type representing targets.

const TargetTypeAmazonLinux Type = "amazonlinux"

TargetTypeAmazonLinux identifies the AmazonLinux target.

const TargetTypeAmazonLinux2 Type = "amazonlinux2"

TargetTypeAmazonLinux2 identifies the AmazonLinux2 target.

const TargetTypeAmazonLinux2022 Type = "amazonlinux2022"

TargetTypeAmazonLinux2022 identifies the AmazonLinux2022 target.

const TargetTypeArchlinux Type = "arch"

TargetTypeArchlinux identifies the Archlinux target.

const TargetTypeCentos Type = "centos"

TargetTypeCentos identifies the Centos target.

const TargetTypeDebian Type = "debian"

TargetTypeDebian identifies the Debian target.

const TargetTypeFlatcar Type = "flatcar"

TargetTypeFlatcar identifies the Flatcar target.

const TargetTypeMinikube Type = "minikube"

TargetTypeMinikube identifies the Minikube target.

const TargetTypePhoton Type = "photon"

TargetTypePhoton identifies the Photon target.

const TargetTypeRedhat Type = "redhat"

TargetTypeRedhat identifies the redhat target.

const TargetTypeRocky Type = "rocky"

TargetTypeRocky identifies the Rocky target.

const TargetTypeUbuntu Type = "ubuntu"

TargetTypeUbuntu identifies the Ubuntu target.

const TargetTypeVanilla Type = "vanilla"

TargetTypeVanilla identifies the Vanilla target.

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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