driverdistro

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package driverdistro implements all the distro specific driver-related logic.

Index

Constants

View Source
const (

	// UndeterminedDistro is the string used for the generic distro object returned when we cannot determine the distro.
	UndeterminedDistro = "undetermined"
)

Variables

View Source
var (

	// ErrUnsupported is the error returned when the target distro is not supported.
	ErrUnsupported = errors.New("failed to determine distro")
	// ErrAlreadyPresent is the error returned when a driver is already present on filesystem.
	ErrAlreadyPresent = errors.New("driver already present")
)

Functions

func Build

func Build(ctx context.Context,
	d Distro,
	printer *output.Printer,
	kr kernelrelease.KernelRelease,
	driverName string,
	driverType drivertype.DriverType,
	driverVer string,
	downloadHeaders bool,
) (string, error)

Build will try to build the desired driver for the specified distro and kernel release.

func Download

func Download(ctx context.Context,
	d Distro,
	printer *output.Printer,
	kr kernelrelease.KernelRelease,
	driverName string,
	driverType drivertype.DriverType,
	driverVer string, repos []string,
	httpHeaders string,
) (string, error)

Download will try to download drivers for a distro trying specified repos.

Types

type Distro

type Distro interface {
	FixupKernel(kr kernelrelease.KernelRelease) kernelrelease.KernelRelease // private

	PreferredDriver(kr kernelrelease.KernelRelease, allowedDriverTypes []drivertype.DriverType) drivertype.DriverType
	fmt.Stringer
	// contains filtered or unexported methods
}

Distro is the common interface used by distro-specific implementations. Most of the distro-specific only partially override the default `generic` implementation.

func Discover

func Discover(kr kernelrelease.KernelRelease, hostroot string) (Distro, error)

Discover tries to fetch the correct Distro by looking at /etc/os-release or by cycling on all supported distros and checking them one by one.

Jump to

Keyboard shortcuts

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