Documentation ¶
Index ¶
- type Service
- func (s *Service) CurrentlyRunningSlot() Slot
- func (s *Service) InstallBundle(ctx context.Context, bundleURL string, withKexec bool) error
- func (s *Service) KexecLoadNext() error
- func (s *Service) MarkBootSuccessful() error
- func (s *Service) ProvideESP(path string, partNum uint32, part *gpt.Partition)
- func (s *Service) Rollback() error
- type Slot
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 logging.Leveled }
Service contains data and functionality to perform A/B updates on a Metropolis node.
func (*Service) CurrentlyRunningSlot ¶
CurrentlyRunningSlot returns the slot the current system is booted from.
func (*Service) InstallBundle ¶
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) KexecLoadNext ¶
KexecLoadNext loads the slot to be booted next into the kexec staging area. The next slot can then be launched by executing kexec via the reboot syscall. Calling this function counts as a next boot for the purposes of A/B state tracking, so it should not be called without kexecing afterwards.
func (*Service) MarkBootSuccessful ¶
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 ¶
ProvideESP is a convenience function for providing information about the ESP after the update service has been instantiated.
func (*Service) Rollback ¶
Rollback sets the currently-inactive slot as the next boot slot. This is intended to recover from scenarios where roll-forward fixing is difficult. Only the next boot slot is set to make sure that the node is not made unbootable accidentally. On successful bootup that code can switch the active slot to itself.