grub

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BootA is a bootloader label.
	BootA = "A"

	// BootB is a bootloader label.
	BootB = "B"

	// GrubConfig is the path to the grub config.
	GrubConfig = constants.BootMountPoint + "/grub/grub.cfg"

	// GrubDeviceMap is the path to the grub device map.
	GrubDeviceMap = constants.BootMountPoint + "/grub/device.map"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BootEntry added in v0.13.0

type BootEntry struct {
	// Paths to kernel and initramfs image.
	Linux, Initrd string
	// Cmdline for the kernel.
	Cmdline string
}

BootEntry describes GRUB boot entry.

type Cfg

type Cfg struct {
	Default  string
	Fallback string
	Labels   []*Label
}

Cfg reprsents the cfg file.

type Grub

type Grub struct {
	BootDisk string
	Arch     string
}

Grub represents the grub bootloader.

func (*Grub) Default

func (g *Grub) Default(label string) (err error)

Default implements the bootloader interface.

func (*Grub) GetCurrentEntry added in v0.13.0

func (g *Grub) GetCurrentEntry() (*BootEntry, error)

GetCurrentEntry fetches current boot entry, vmlinuz/initrd path, boot args.

func (*Grub) Install

func (g *Grub) Install(fallback string, config interface{}, sequence runtime.Sequence) (err error)

Install implements the Bootloader interface. It sets up grub with the specified kernel parameters.

func (*Grub) Labels

func (g *Grub) Labels() (current, next string, err error)

Labels implements the Bootloader interface.

type Label

type Label struct {
	Root   string
	Kernel string
	Initrd string
	Append string
}

Label reprsents a label in the cfg file.

Jump to

Keyboard shortcuts

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