Documentation ¶
Overview ¶
Package installer provides a uniform, cross-platform implementation for handling OS installer provisioning for supported target platforms.
Index ¶
- Variables
- type Configuration
- type Device
- type Installer
- func (i *Installer) Cache() string
- func (i *Installer) DownloadSFU() error
- func (i *Installer) Finalize(devices []Device, dismount bool) error
- func (i *Installer) PlaceSFU(d Device) error
- func (i *Installer) Prepare(d Device) error
- func (i *Installer) Provision(d Device) error
- func (i *Installer) Retrieve() (err error)
- type SFUManifest
Constants ¶
This section is empty.
Variables ¶
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) DownloadSFU ¶
DownloadSFU downloads the SFU file and places it in the cache.
func (*Installer) Finalize ¶
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 ¶
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 ¶
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 ¶
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.
type SFUManifest ¶
type SFUManifest struct {
Filename string
}
SFUManifest struct for SFU manifest json.