bootloader

package
v2.42.5-go-mod+incompa... Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBootloader is returned if the bootloader can not be determined
	ErrBootloader = errors.New("cannot determine bootloader")
)

Functions

func Force

func Force(booloader Bootloader)

Force can be used to force setting a booloader to that Find will not use the usual lookup process; use nil to reset to normal lookup.

func ForceError

func ForceError(err error)

Force can be used to force Find to return an error; use nil to reset to normal lookup.

func InstallBootConfig

func InstallBootConfig(gadgetDir, rootDir string) error

InstallBootConfig installs the bootloader config from the gadget snap dir into the right place.

Types

type Bootloader

type Bootloader interface {
	// Return the value of the specified bootloader variable
	GetBootVars(names ...string) (map[string]string, error)

	// Set the value of the specified bootloader variable
	SetBootVars(values map[string]string) error

	// Name returns the bootloader name
	Name() string

	// ConfigFile returns the name of the config file
	ConfigFile() string

	// ExtractKernelAssets extracts kernel assets from the given kernel snap
	ExtractKernelAssets(s snap.PlaceInfo, snapf snap.Container) error

	// RemoveKernelAssets removes the assets for the given kernel snap.
	RemoveKernelAssets(s snap.PlaceInfo) error
}

Bootloader provides an interface to interact with the system bootloader

func Find

func Find(rootdir string, opts *Options) (Bootloader, error)

Find returns the bootloader for the system or an error if no bootloader is found.

type Options

type Options struct {
	// PrepareImageTime indicates whether the booloader is being
	// used at prepare-image time, that means not on a runtime
	// system.
	PrepareImageTime bool
}

Options carries bootloader options.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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