installer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package installer provides a uniform, cross-platform implementation for handling OS installer provisioning for supported target platforms.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrLabel is made public to that callers can warn on mismatches.
	ErrLabel = errors.New(`label error`)
)

Functions

This section is empty.

Types

type Configuration

type Configuration interface {
	ConfFile() string
	DistroLabel() string
	Image() string
	ImageFile() string
	Elevated() bool
	FFU() bool
	SFUManifest() string
	SFUPath() string
	PowerOff() bool
	SeedDest() string
	SeedFile() string
	SeedServer() string
	SFUDest() string
	UpdateOnly() bool
	FileName() string
	Path() string
}

Configuration represents config.Configuration.

type Device

type Device interface {
	Dismount() error
	Eject() error
	FriendlyName() string
	Identifier() string
	Partition(string) error
	DetectPartitions(bool) error
	SelectPartition(uint64, storage.FileSystem) (*storage.Partition, error)
	Size() uint64
	Wipe() error
}

Device represents storage.Device.

type Installer

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

Installer represents an operating system installer.

func New

func New(config Configuration) (*Installer, error)

New generates a new Installer from a configuration, with all the information needed to provision the installer on an available device.

func (*Installer) Cache

func (i *Installer) Cache() string

Cache returns the location of the cache folder for a given installer.

func (*Installer) DownloadSFU

func (i *Installer) DownloadSFU() error

DownloadSFU downloads the SFU file and places it in the cache.

func (*Installer) Finalize

func (i *Installer) Finalize(devices []Device, dismount bool) error

Finalize performs post-provisioning tasks for a device. It is meant to be called after all provisioning tasks are completed. For example, if a set of devices are being provisioned, it can be called at the end of the process so that artifacts like downloaded images can be obtained just once and re-used during Preparation and Provisioning steps. If the cache exists it is automatically cleaned up. Optionally, the device can also be dismounted and/or powered off during the Finalize step.

func (*Installer) PlaceSFU

func (i *Installer) PlaceSFU(d Device) error

PlaceSFU copies and renames SFU files and config files onto provisioned media from the local cache. For additional verification, PlaceSFU also writes a datetime file to the provisioned media.

func (*Installer) Prepare

func (i *Installer) Prepare(d Device) error

Prepare takes a device and prepares it for provisioning. It supports device preparation based on the source image file format. Currently, it supports preparation for the ISO and IMG (Raw) formats.

func (*Installer) Provision

func (i *Installer) Provision(d Device) error

Provision takes a device and provisions it with the installer. It provisions based on the source image file format. Each supported format enforces its own requirements for the device. Provision only checks that all needed configuration is present and that the image file has already been downloaded to cache.

func (*Installer) Retrieve

func (i *Installer) Retrieve() (err error)

Retrieve passes the necessary parameters to retrieveFile depending on whether or not the distribution will be FFU based.

type SFUManifest

type SFUManifest struct {
	Filename string
}

SFUManifest struct for SFU manifest json.

Jump to

Keyboard shortcuts

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