sdboot

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package sdboot provides the interface to the Systemd-Boot bootloader: config management, installation, etc.

Index

Constants

View Source
const (
	// SystemdBootGUIDString is the GUID of the SystemdBoot EFI variables.
	SystemdBootGUIDString = "4a67b082-0a4c-41cf-b6c7-440b29bb8c4f"
	// SystemdBootStubInfoPath is the path to the SystemdBoot StubInfo EFI variable.
	SystemdBootStubInfoPath = constants.EFIVarsMountPoint + "/" + "StubInfo-" + SystemdBootGUIDString
)
View Source
const (
	LoaderEntryDefaultName  = "LoaderEntryDefault"
	LoaderEntrySelectedName = "LoaderEntrySelected"
	LoaderConfigTimeoutName = "LoaderConfigTimeout"
)

Variable names.

Variables

SystemdBootGUID is the GUID of the SystemdBoot EFI variables.

Functions

func IsBootedUsingSDBoot

func IsBootedUsingSDBoot() bool

IsBootedUsingSDBoot returns true if the system is booted using sd-boot.

func ReadVariable

func ReadVariable(c efivario.Context, name string) (string, error)

ReadVariable reads a SystemdBoot EFI variable.

func WriteVariable

func WriteVariable(c efivario.Context, name, value string) error

WriteVariable reads a SystemdBoot EFI variable.

Types

type Config

type Config struct {
	Default  string
	Fallback string
}

Config describe sd-boot state.

func New

func New() *Config

New creates a new sdboot bootloader config.

func Probe

func Probe(ctx context.Context, disk string) (*Config, error)

Probe for existing sd-boot bootloader.

func (*Config) Install

func (c *Config) Install(options options.InstallOptions) error

Install the bootloader.

Assumes that EFI partition is already mounted. Writes down the UKI and updates the EFI variables.

func (*Config) PreviousLabel

func (c *Config) PreviousLabel() string

PreviousLabel returns the label of the previous bootloader version.

func (*Config) Revert

func (c *Config) Revert(ctx context.Context) error

Revert the bootloader to the previous version.

func (*Config) UEFIBoot

func (c *Config) UEFIBoot() bool

UEFIBoot returns true if bootloader is UEFI-only.

Jump to

Keyboard shortcuts

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