image

package
v0.0.0-...-bc60ea4 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: GPL-3.0 Imports: 28 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Stdout io.Writer = os.Stdout
	Stderr io.Writer = os.Stderr
)

Functions

func FetchAndCheckComponentAssertions

func FetchAndCheckComponentAssertions(comp CompInfoPath, info *snap.Info, model *asserts.Model, f asserts.Fetcher, db asserts.RODatabase) error

FetchAndCheckSnapAssertions fetches and cross checks the snap assertions matching the given component file using the provided asserts.Fetcher and assertion database. The optional model assertion must be passed for full cross checks.

func FetchAndCheckSnapAssertions

func FetchAndCheckSnapAssertions(snapPath string, info *snap.Info, comps []CompInfoPath, model *asserts.Model, f asserts.Fetcher, db asserts.RODatabase) (*asserts.SnapDeclaration, error)

FetchAndCheckSnapAssertions fetches and cross checks the snap assertions matching the given snap file and wanted components using the provided asserts.Fetcher and assertion database. The optional model assertion must be passed for full cross checks.

func MockTrusted

func MockTrusted(mockTrusted []asserts.Assertion) (restore func())

func Prepare

func Prepare(opts *Options) error

Types

type CompInfoPath

type CompInfoPath struct {
	Info *snap.ComponentInfo
	Path string
}

CompInfoPath contains information for a component file that we need to get its assertions.

type Customizations

type Customizations struct {
	// ConsoleConf can be set to "disabled" to disable console-conf
	// forcefully (UC16/18 only ATM).
	ConsoleConf string `json:"console-conf"`
	// CloudInitUserData can optionally point to cloud init user-data
	// (UC16/18 only)
	CloudInitUserData string `json:"cloud-init-user-data"`
	// BootFlags can be set to a list of boot flags
	// to set in the recovery bootloader (UC20 only).
	// Currently only the "factory" hint flag is supported.
	BootFlags []string `json:"boot-flags"`
	// Validation controls whether validations should be taken
	// into account by the store to select snap revisions.
	// It can be set to "enforce" or "ignore".
	Validation string `json:"validation"`
}

Customizatons defines possible image customizations. Not all of them applies to all kind of systems.

type Options

type Options struct {
	ModelFile string
	Classic   bool

	// Preseed requests the image to be preseeded (only for UC20)
	Preseed bool
	// PreseedSignKey is the name of the key to use for signing preseed
	// assertion (empty means the default key).
	PreseedSignKey string

	// AppArmor kernel features directory to bind-mount when preseeding.
	// If empty then the features from /sys/kernel/security/apparmor will be used.
	// (only for UC20)
	AppArmorKernelFeaturesDir string

	// SysfsOverlay is the optional sysfs overlay to be used for
	// preseeding.
	// Directories from /sys/class/* and /sys/devices/platform
	// will be bind-mounted to the chroot when preseeding.
	SysfsOverlay string

	Channel string

	// TODO: use OptionsSnap directly here?
	Snaps        []string
	Components   []string
	SnapChannels map[string]string

	// SeedManifest is a pre-provided seed manifest, to allow for
	// creating reproducible seeds. If provided, the snap revisions and
	// validation-sets specified in the seed manifest will be used to
	// (re-)create the image seed.
	SeedManifest *seedwriter.Manifest
	// SeedManifestPath if set, specifies the file path where the
	// seed.manifest file should be written.
	SeedManifestPath string

	// WideCohortKey can be used to supply a cohort covering all
	// the snaps in the image, there is no generally suppported API
	// to create such a cohort key.
	WideCohortKey string

	PrepareDir string

	// Architecture to use if none is specified by the model,
	// useful only for classic mode. If set must match the model otherwise.
	Architecture string

	Customizations Customizations
}

Directories

Path Synopsis
Package preseed provides functions for preseeding of classic and UC20 systems.
Package preseed provides functions for preseeding of classic and UC20 systems.

Jump to

Keyboard shortcuts

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