Documentation ¶
Index ¶
- func CreateMissingPartitions(dv *gadget.OnDiskVolume, gv *gadget.Volume, opts *CreateOptions) ([]*gadget.OnDiskAndGadgetStructurePair, error)
- func KeysForRole(setupData *EncryptionSetupData) map[string]keys.EncryptionKey
- func MatchDisksToGadgetVolumes(gVols map[string]*gadget.Volume, ...) (map[string]map[int]*gadget.OnDiskStructure, error)
- func MountVolumes(onVolumes map[string]*gadget.Volume, encSetupData *EncryptionSetupData) (seedMntDir string, unmount func() error, err error)
- func SaveStorageTraits(model gadget.Model, vols map[string]*gadget.Volume, ...) error
- func WriteContent(onVolumes map[string]*gadget.Volume, ...) ([]*gadget.OnDiskVolume, error)
- type CreateOptions
- type EncryptionSetupData
- type InstalledSystemSideData
- type KernelSnapInfo
- type MockEncryptedDeviceAndRole
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMissingPartitions ¶
func CreateMissingPartitions(dv *gadget.OnDiskVolume, gv *gadget.Volume, opts *CreateOptions) ([]*gadget.OnDiskAndGadgetStructurePair, error)
CreateMissingPartitions calls createMissingPartitions but returns only OnDiskStructure, as it is meant to be used externally (i.e. by muinstaller).
func KeysForRole ¶
func KeysForRole(setupData *EncryptionSetupData) map[string]keys.EncryptionKey
func MatchDisksToGadgetVolumes ¶
func MatchDisksToGadgetVolumes(gVols map[string]*gadget.Volume, volCompatOpts *gadget.VolumeCompatibilityOptions) (map[string]map[int]*gadget.OnDiskStructure, error)
MatchDisksToGadgetVolumes matches gadget volumes with disks present in the system, taking into account the provided compatibility options. It returns a map of volume names to maps of gadget structure yaml indices to real disk structures.
func MountVolumes ¶
func MountVolumes(onVolumes map[string]*gadget.Volume, encSetupData *EncryptionSetupData) (seedMntDir string, unmount func() error, err error)
MountVolumes mounts partitions for the volumes specified by onVolumes. It returns the partition with the system-seed{,-null} role and a function that needs to be called for unmounting them.
func SaveStorageTraits ¶
func WriteContent ¶
func WriteContent(onVolumes map[string]*gadget.Volume, allLaidOutVols map[string]*gadget.LaidOutVolume, encSetupData *EncryptionSetupData, kSnapInfo *KernelSnapInfo, 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 MockEncryptionSetupData ¶
func MockEncryptionSetupData(labelToEncDevice map[string]*MockEncryptedDeviceAndRole) *EncryptionSetupData
MockEncryptionSetupData is meant to be used for unit tests from other packages.
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 string, kernelSnapInfo *KernelSnapInfo, bootDevice string, options Options, observer gadget.ContentObserver, perfTimings timings.Measurer) (*InstalledSystemSideData, error)
func Run ¶
func Run(model gadget.Model, gadgetRoot string, kernelSnapInfo *KernelSnapInfo, 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 KernelSnapInfo ¶
type KernelSnapInfo struct { Name string Revision snap.Revision // MountPoint is the root of the files from the kernel snap MountPoint string // NeedsDriversTree will be set if a drivers tree needs to be // build on installation NeedsDriversTree bool // IsCore is set if this is UC IsCore bool }
KernelSnapInfo includes information from the kernel snap that is needed to build a drivers tree.
type MockEncryptedDeviceAndRole ¶
MockEncryptedDeviceAndRole is meant to be used for unit tests from other packages.
type Options ¶
type Options struct { // Also mount the filesystems after creation Mount bool // Encrypt the data/save partitions EncryptionType secboot.EncryptionType }