update

package
v0.0.0-...-8d377ce Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// Path to the mount point of the EFI System Partition (ESP).
	ESPPath string
	// gpt.Partition of the ESP System Partition.
	ESPPart *gpt.Partition
	// Partition number (1-based) of the ESP in the GPT partitions array.
	ESPPartNumber uint32

	// Logger service for the update service.
	Logger logtree.LeveledLogger
}

Service contains data and functionality to perform A/B updates on a Metropolis node.

func (*Service) CurrentlyRunningSlot

func (s *Service) CurrentlyRunningSlot() Slot

CurrentlyRunningSlot returns the slot the current system is booted from.

func (*Service) InstallBundle

func (s *Service) InstallBundle(ctx context.Context, bundleURL string, withKexec bool) error

InstallBundle installs the bundle at the given HTTP(S) URL into the currently inactive slot and sets that slot to boot next. If it doesn't return an error, a reboot boots into the new slot.

func (*Service) MarkBootSuccessful

func (s *Service) MarkBootSuccessful() error

MarkBootSuccessful must be called after each boot if some implementation- defined criteria for a successful boot are met. If an update has been installed and booted and this function is called, the updated version is marked as default. If an issue occurs during boot and so this function is not called the old version will be started again on next boot.

func (*Service) ProvideESP

func (s *Service) ProvideESP(path string, partNum uint32, part *gpt.Partition)

ProvideESP is a convenience function for providing information about the ESP after the update service has been instantiated.

type Slot

type Slot int
const (
	SlotInvalid Slot = 0
	SlotA       Slot = 1
	SlotB       Slot = 2
)

func (Slot) EFIBootPath

func (s Slot) EFIBootPath() string

func (Slot) Other

func (s Slot) Other() Slot

Other returns the "other" slot, i.e. returns slot A for B and B for A. It returns SlotInvalid for any s which is not SlotA or SlotB.

func (Slot) String

func (s Slot) String() string

Directories

Path Synopsis
e2e

Jump to

Keyboard shortcuts

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