install

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

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 CreateOptions struct {
	// The gadget root dir
	GadgetRootDir string

	// Create all missing partitions. If unset only
	// role-{data,boot,save} partitions will get created and it's
	// an error if other partition are missing.
	CreateAllMissingPartitions bool
}

type EncryptionSetupData

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

EncryptionSetupData stores information needed across install API calls.

func EncryptPartitions

func EncryptPartitions(onVolumes map[string]*gadget.Volume, encryptionType secboot.EncryptionType, model *asserts.Model, gadgetRoot, kernelRoot string, perfTimings timings.Measurer) (*EncryptionSetupData, error)

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
}

Jump to

Keyboard shortcuts

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