sdboot

package
v1.10.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MPL-2.0 Imports: 23 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

View Source
var LoaderConfBytes []byte

LoaderConfBytes is the content of the loader.conf file.

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 IsUEFIBoot

func IsUEFIBoot() bool

IsUEFIBoot returns true if the system is booted using UEFI.

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(disk string, options options.ProbeOptions) (*Config, error)

Probe for existing sd-boot bootloader.

func ProbeWithCallback

func ProbeWithCallback(disk string, options options.ProbeOptions, callback func(*Config) error) (*Config, error)

ProbeWithCallback probes the sd-boot bootloader, and calls the callback function with the Config.

func (*Config) Install

func (c *Config) Install(opts options.InstallOptions) (*options.InstallResult, error)

Install the bootloader.

func (*Config) KexecLoad

func (c *Config) KexecLoad(r runtime.Runtime, disk string) error

KexecLoad does a kexec using the bootloader config.

func (*Config) RequiredPartitions added in v1.8.0

func (c *Config) RequiredPartitions() []partition.Options

RequiredPartitions returns the list of partitions required by the bootloader.

func (*Config) Revert

func (c *Config) Revert(disk string) error

Revert the bootloader to the previous version.

Jump to

Keyboard shortcuts

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