Documentation
¶
Index ¶
- func CreateMissingPartitions(dl *gadget.OnDiskVolume, pv *gadget.LaidOutVolume, opts *CreateOptions) ([]gadget.OnDiskStructure, error)
- func KeysForRole(setupData *EncryptionSetupData) map[string]keys.EncryptionKey
- func MountVolumes(onVolumes map[string]*gadget.Volume, encSetupData *EncryptionSetupData) (espMntDir string, unmount func() error, err error)
- func SaveStorageTraits(model gadget.Model, allLaidOutVols map[string]*gadget.LaidOutVolume, ...) error
- func WriteContent(onVolumes map[string]*gadget.Volume, ...) ([]*gadget.OnDiskVolume, error)
- type CreateOptions
- type EncryptionSetupData
- type InstalledSystemSideData
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMissingPartitions ¶
func CreateMissingPartitions(dl *gadget.OnDiskVolume, pv *gadget.LaidOutVolume, opts *CreateOptions) ([]gadget.OnDiskStructure, error)
CreateMissingPartitions creates the partitions listed in the laid out volume pv that are missing from the existing device layout, returning a list of structures that have been created.
func KeysForRole ¶
func KeysForRole(setupData *EncryptionSetupData) map[string]keys.EncryptionKey
func MountVolumes ¶
func MountVolumes(onVolumes map[string]*gadget.Volume, encSetupData *EncryptionSetupData) (espMntDir string, unmount func() error, err error)
MountVolumes mounts partitions for the volumes specified by onVolumes. It returns the ESP partition and a function that needs to be called for unmounting them.
func SaveStorageTraits ¶
func SaveStorageTraits(model gadget.Model, allLaidOutVols map[string]*gadget.LaidOutVolume, encryptSetupData *EncryptionSetupData) error
func WriteContent ¶
func WriteContent(onVolumes map[string]*gadget.Volume, allLaidOutVols map[string]*gadget.LaidOutVolume, encSetupData *EncryptionSetupData, observer gadget.ContentObserver, perfTimings timings.Measurer) ([]*gadget.OnDiskVolume, error)
WriteContent writes gadget content to the devices specified in onVolumes. It returns the resolved on disk volumes.
Types ¶
type CreateOptions ¶
type EncryptionSetupData ¶
type EncryptionSetupData struct {
// contains filtered or unexported fields
}
EncryptionSetupData stores information needed across install API calls.
func EncryptPartitions ¶
func (*EncryptionSetupData) EncryptedDevices ¶
func (esd *EncryptionSetupData) EncryptedDevices() map[string]string
EncryptedDevices returns a map partition role -> LUKS mapper device.
type InstalledSystemSideData ¶
type InstalledSystemSideData struct { // KeysForRoles contains key sets for the relevant structure roles. KeyForRole map[string]keys.EncryptionKey // DeviceForRole maps a roles to their corresponding device nodes. For // structures with roles that require data to be encrypted, the device // is the raw encrypted device node (eg. /dev/mmcblk0p1). DeviceForRole map[string]string }
InstalledSystemSideData carries side data of an installed system, eg. secrets to access its partitions.
func FactoryReset ¶
func FactoryReset(model gadget.Model, gadgetRoot, kernelRoot, bootDevice string, options Options, observer gadget.ContentObserver, perfTimings timings.Measurer) (*InstalledSystemSideData, error)
func Run ¶
func Run(model gadget.Model, gadgetRoot, kernelRoot, bootDevice string, options Options, observer gadget.ContentObserver, perfTimings timings.Measurer) (*InstalledSystemSideData, error)
Run creates partitions, encrypts them when expected, creates filesystems, and finally writes content on them.
type Options ¶
type Options struct { // Also mount the filesystems after creation Mount bool // Encrypt the data/save partitions EncryptionType secboot.EncryptionType }