Documentation ¶
Index ¶
- Constants
- Variables
- func GetResolvingURLs(urls []string) ([]string, error)
- func KernelDownloadScript(b Builder, kernelurls []string, kr kernelrelease.KernelRelease, ...) (string, error)
- func LibsDownloadScript(c Config) (string, error)
- func Script(b Builder, c Config, kr kernelrelease.KernelRelease) (string, error)
- func Targets() []string
- type Build
- type Builder
- type BuilderImageNetworkMode
- type Config
- type FileImagesLister
- type GCCVersionRequestor
- type Image
- type ImageKey
- type ImagesLister
- type ImagesMap
- type LocalBuilder
- func (l *LocalBuilder) GetDriverBuildDir() string
- func (l *LocalBuilder) GetModuleFullPath(c Config, kr kernelrelease.KernelRelease) string
- func (l *LocalBuilder) GetProbeFullPath(c Config) string
- func (l *LocalBuilder) KernelTemplateData(_ kernelrelease.KernelRelease, _ []string) interface{}
- func (l *LocalBuilder) MinimumURLs() int
- func (l *LocalBuilder) Name() string
- func (l *LocalBuilder) TemplateData(c Config, kr kernelrelease.KernelRelease) interface{}
- func (l *LocalBuilder) TemplateKernelUrlsScript() string
- func (l *LocalBuilder) TemplateScript() string
- func (l *LocalBuilder) URLs(_ kernelrelease.KernelRelease) ([]string, error)
- type MinimumURLsBuilder
- type RepoImagesLister
- type TemplateDataSpecifier
- type Type
- type YAMLImage
- type YAMLImagesList
Constants ¶
const (
DriverDirectory = "/tmp/driver"
)
DriverDirectory is the directory the processor uses to store the driver.
Variables ¶
var HeadersNotFoundErr = errors.New("kernel headers not found")
Functions ¶
func GetResolvingURLs ¶
func KernelDownloadScript ¶
func KernelDownloadScript(b Builder, kernelurls []string, kr kernelrelease.KernelRelease, printer *output.Printer, ) (string, error)
KernelDownloadScript returns the script that will download and extract kernel headers
func LibsDownloadScript ¶
LibsDownloadScript returns the script that downloads and configures libs repo at requested commit/tag
func Script ¶
func Script(b Builder, c Config, kr kernelrelease.KernelRelease) (string, error)
Script retrieves the actually drivers building script
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 BuilderImage string BuilderRepos []string ImagesListers []ImagesLister KernelUrls []string GCCVersion string RepoOrg string RepoName string Images ImagesMap RegistryName string RegistryUser string RegistryPassword string RegistryPlainHTTP bool *output.Printer }
Build contains the info about the on-going build.
func (*Build) GetBuilderImage ¶
func (*Build) KernelReleaseFromBuildConfig ¶
func (b *Build) KernelReleaseFromBuildConfig() kernelrelease.KernelRelease
func (*Build) LoadImages ¶
func (b *Build) LoadImages()
type Builder ¶
type Builder interface { Name() string TemplateKernelUrlsScript() string TemplateScript() string URLs(kr kernelrelease.KernelRelease) ([]string, error) KernelTemplateData(kr kernelrelease.KernelRelease, urls []string) interface{} // error return type is managed }
Builder represents a builder capable of generating a script for a driverkit target.
type BuilderImageNetworkMode ¶
type BuilderImageNetworkMode interface { // sets the network mode of the builder image, allows individual builders to override BuilderImageNetMode() string }
type Config ¶
Config contains all the configurations needed to build the kernel module or the eBPF probe.
func (Config) ToDriverFullPath ¶
func (Config) ToProbeFullPath ¶
type FileImagesLister ¶
func NewFileImagesLister ¶
func NewFileImagesLister(filePath string, build *Build) (*FileImagesLister, error)
func (*FileImagesLister) LoadImages ¶
func (f *FileImagesLister) LoadImages(printer *output.Printer) []Image
type GCCVersionRequestor ¶
type GCCVersionRequestor interface { // GCCVersion returns the GCC version to be used. // If the returned value is empty, the default algorithm will be enforced. GCCVersion(kr kernelrelease.KernelRelease) semver.Version }
type ImagesLister ¶
type LocalBuilder ¶
func (*LocalBuilder) GetDriverBuildDir ¶
func (l *LocalBuilder) GetDriverBuildDir() string
func (*LocalBuilder) GetModuleFullPath ¶
func (l *LocalBuilder) GetModuleFullPath(c Config, kr kernelrelease.KernelRelease) string
func (*LocalBuilder) GetProbeFullPath ¶
func (l *LocalBuilder) GetProbeFullPath(c Config) string
func (*LocalBuilder) KernelTemplateData ¶
func (l *LocalBuilder) KernelTemplateData(_ kernelrelease.KernelRelease, _ []string) interface{}
func (*LocalBuilder) MinimumURLs ¶
func (l *LocalBuilder) MinimumURLs() int
func (*LocalBuilder) Name ¶
func (l *LocalBuilder) Name() string
func (*LocalBuilder) TemplateData ¶
func (l *LocalBuilder) TemplateData(c Config, kr kernelrelease.KernelRelease) interface{}
func (*LocalBuilder) TemplateKernelUrlsScript ¶
func (l *LocalBuilder) TemplateKernelUrlsScript() string
func (*LocalBuilder) TemplateScript ¶
func (l *LocalBuilder) TemplateScript() string
func (*LocalBuilder) URLs ¶
func (l *LocalBuilder) URLs(_ kernelrelease.KernelRelease) ([]string, error)
type MinimumURLsBuilder ¶
type MinimumURLsBuilder interface {
MinimumURLs() int
}
MinimumURLsBuilder is an optional interface implemented by builders to specify minimum number of requested headers urls
type RepoImagesLister ¶
type RepoImagesLister struct {
*repository.Repository
}
func NewRepoImagesLister ¶
func NewRepoImagesLister(repo string, build *Build) (*RepoImagesLister, error)
func (*RepoImagesLister) LoadImages ¶
func (repo *RepoImagesLister) LoadImages(printer *output.Printer) []Image
type TemplateDataSpecifier ¶
type TemplateDataSpecifier interface {
TemplateData(c Config, kr kernelrelease.KernelRelease) interface{}
}
TemplateDataSpecifier is an optional interface implemented by builders to specify a custom template data instead of the default one.
type Type ¶
type Type string
Type is a type representing targets.
const TargetTypeAlinux Type = "alinux"
TargetTypeAlinux identifies the AliyunLinux 2 and 3 target.
const TargetTypeAlma Type = "almalinux"
TargetTypeAlma identifies the AlmaLinux target.
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 TargetTypeAmazonLinux2023 Type = "amazonlinux2023"
TargetTypeAmazonLinux2023 identifies the AmazonLinux2023 target.
const TargetTypeArchlinux Type = "arch"
TargetTypeArchlinux identifies the Archlinux target.
const TargetTypeBottlerocket Type = "bottlerocket"
TargetTypeBottlerocket identifies the Bottlerocket target.
const TargetTypeCentos Type = "centos"
TargetTypeCentos identifies the Centos target.
const TargetTypeDebian Type = "debian"
TargetTypeDebian identifies the Debian target.
const TargetTypeFedora Type = "fedora"
TargetTypeFedora identifies the Fedora target.
const TargetTypeFlatcar Type = "flatcar"
TargetTypeFlatcar identifies the Flatcar target.
const TargetTypeMinikube Type = "minikube"
TargetTypeMinikube identifies the Minikube target.
const TargetTypeOpenSUSE Type = "opensuse"
TargetTypeOpenSUSE identifies the OpenSUSE 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 TargetTypeSLES Type = "sles"
TargetTypeSLES identifies the sles target.
const TargetTypeTalos Type = "talos"
TargetTypeTalos identifies the Talos target.
const TargetTypeUbuntu Type = "ubuntu"
TargetTypeUbuntu identifies the Ubuntu target.
const TargetTypeVanilla Type = "vanilla"
TargetTypeVanilla identifies the Vanilla target.
const TargetTypeoracle Type = "ol"
TargetTypeoracle identifies the oracle target ("ol" is the ID from /etc/os-release that Oracle uses)
type YAMLImagesList ¶
type YAMLImagesList struct {
Images []YAMLImage `yaml:"images"`
}