bootloader

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithGrubClearBootEntry

func WithGrubClearBootEntry(clearBootEntry bool) func(g *Grub) error

func WithGrubDisableBootEntry

func WithGrubDisableBootEntry(disableBootEntry bool) func(g *Grub) error

func WithGrubPrefix

func WithGrubPrefix(prefix string) func(g *Grub) error

func WithSecureBoot

func WithSecureBoot(secureboot bool) func(g *Grub) error

Types

type Grub

type Grub struct {
	// contains filtered or unexported fields
}

func NewGrub

func NewGrub(cfg *v1.Config, opts ...GrubOptions) *Grub

func (*Grub) CreateEntry

func (g *Grub) CreateEntry(shimName string, relativeTo string, efiVariables eleefi.Variables) error

createBootEntry will create an entry in the efi vars for our shim and set it to boot first in the bootorder

func (*Grub) DoEFIEntries

func (g *Grub) DoEFIEntries(shimName, efiDir string) error

DoEFIEntries creates clears any previous entry if requested and creates a new one with the given shim name.

func (*Grub) Install

func (g *Grub) Install(rootDir, bootDir, deviceLabel string) (err error)

Install installs grub into the device, copy the config file and add any extra TTY to grub

func (Grub) InstallConfig

func (g Grub) InstallConfig(rootDir, bootDir string) error

InstallConfig installs grub configuraton files to the expected location. rootDir is the root of the OS image, bootDir is the folder grub read the configuration from, usually EFI partition mountpoint

func (*Grub) InstallEFI

func (g *Grub) InstallEFI(rootDir, bootDir, efiDir, deviceLabel string) error

func (*Grub) InstallEFIElementalBinaries

func (g *Grub) InstallEFIElementalBinaries(rootDir, efiDir, _ string) error

func (*Grub) InstallEFIFallbackBinaries

func (g *Grub) InstallEFIFallbackBinaries(rootDir, efiDir, _ string) error

func (*Grub) SetDefaultEntry

func (g *Grub) SetDefaultEntry(partMountPoint, imgMountPoint, defaultEntry string) error

SetDefaultEntry Sets the default_meny_entry value in RunConfig.GrubOEMEnv file at in State partition mountpoint. If there is not a custom value in the os-release file, we do nothing As the grub config already has a sane default

func (*Grub) SetPersistentVariables

func (g *Grub) SetPersistentVariables(grubEnvFile string, vars map[string]string) error

Sets the given key value pairs into as grub variables into the given file

type GrubOptions

type GrubOptions func(g *Grub) error

Jump to

Keyboard shortcuts

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