install

package
v0.14.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MPL-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoFilesystem = &Target{
	FormatOptions: &partition.FormatOptions{
		FileSystemType: partition.FilesystemTypeNone,
	},
}

NoFilesystem preset to override default filesystem type to none.

Functions

func Install

func Install(p runtime.Platform, seq runtime.Sequence, opts *Options) (err error)

Install installs Talos.

func VerifyBootPartition

func VerifyBootPartition(opts *Options) (err error)

VerifyBootPartition verifies the supplied boot device options.

func VerifyDiskAvailability

func VerifyDiskAvailability(devpath, label string) (err error)

VerifyDiskAvailability verifies that no filesystems currently exist with the labels used by the OS.

func VerifyEphemeralPartition

func VerifyEphemeralPartition(opts *Options) (err error)

VerifyEphemeralPartition verifies the supplied data device options.

Types

type Asset

type Asset struct {
	Source      string
	Destination string
}

Asset represents a file required by a target.

type Device added in v0.7.0

type Device struct {
	Device string

	ResetPartitionTable bool
	Zero                bool

	SkipOverlayMountsCheck bool
}

Device represents device options.

type Installer

type Installer struct {
	Current string
	Next    string
	// contains filtered or unexported fields
}

Installer represents the installer logic. It serves as the entrypoint to all installation methods.

func NewInstaller

func NewInstaller(cmdline *procfs.Cmdline, seq runtime.Sequence, opts *Options) (i *Installer, err error)

NewInstaller initializes and returns an Installer.

func (*Installer) Install

func (i *Installer) Install(seq runtime.Sequence) (err error)

Install fetches the necessary data locations and copies or extracts to the target locations.

type Manifest

type Manifest struct {
	PartitionOptions  *runtime.PartitionOptions
	Devices           map[string]Device
	Targets           map[string][]*Target
	LegacyBIOSSupport bool
}

Manifest represents the instructions for preparing all block devices for an installation.

func NewManifest

func NewManifest(label string, sequence runtime.Sequence, bootPartitionFound bool, opts *Options) (manifest *Manifest, err error)

NewManifest initializes and returns a Manifest.

func (*Manifest) Execute added in v0.7.0

func (m *Manifest) Execute() (err error)

Execute partitions and formats all disks in a manifest.

func (*Manifest) SystemMountpoints added in v0.7.0

func (m *Manifest) SystemMountpoints(opts ...mount.Option) (*mount.Points, error)

SystemMountpoints returns list of system mountpoints for the manifest.

type Options

type Options struct {
	ConfigSource      string
	Disk              string
	Platform          string
	Arch              string
	Board             string
	ExtraKernelArgs   []string
	Bootloader        bool
	Upgrade           bool
	Force             bool
	Zero              bool
	LegacyBIOSSupport bool
}

Options represents the set of options available for an install.

type PreserveSource added in v0.7.0

type PreserveSource struct {
	Label          string
	FnmatchFilters []string
	FileSystemType partition.FileSystemType
}

PreserveSource instructs Talos where to look for source files to preserve.

type Target

type Target struct {
	*partition.FormatOptions
	Device string

	LegacyBIOSBootable bool

	Assets []*Asset

	// Preserve contents of the partition with the same label (if it exists).
	PreserveContents bool

	// Extra preserved locations (for upgrading from older versions of Talos).
	//
	// Used only if PreserveContents is true.
	ExtraPreserveSources []PreserveSource

	// Skip makes manifest skip any actions with the partition (creating, formatting).
	//
	// Skipped partitions should exist on the disk by the time manifest execution starts.
	Skip bool

	// set during execution
	PartitionName string
	Contents      *bytes.Buffer
}

Target represents an installation partition.

func BIOSTarget added in v0.8.0

func BIOSTarget(device string, extra *Target) *Target

BIOSTarget builds the default BIOS target.

func BootTarget added in v0.8.0

func BootTarget(device string, extra *Target) *Target

BootTarget builds the default boot target.

func EFITarget added in v0.8.0

func EFITarget(device string, extra *Target) *Target

EFITarget builds the default EFI target.

func EphemeralTarget added in v0.8.0

func EphemeralTarget(device string, extra *Target) *Target

EphemeralTarget builds the default ephemeral target.

func MetaTarget added in v0.8.0

func MetaTarget(device string, extra *Target) *Target

MetaTarget builds the default meta target.

func StateTarget added in v0.8.0

func StateTarget(device string, extra *Target) *Target

StateTarget builds the default state target.

func (*Target) Format

func (t *Target) Format() error

Format creates a filesystem on the device/partition.

func (*Target) Locate added in v0.8.0

func (t *Target) Locate(pt *gpt.GPT) (*gpt.Partition, error)

Locate existing partition on the disk.

func (*Target) Partition

func (t *Target) Partition(pt *gpt.GPT, pos int, bd *blockdevice.BlockDevice) (err error)

Partition creates a new partition on the specified device.

func (*Target) RestoreContents added in v0.7.0

func (t *Target) RestoreContents() error

RestoreContents restores previously saved contents to the disk.

func (*Target) Save

func (t *Target) Save() (err error)

Save copies the assets to the bootloader partition.

func (*Target) SaveContents added in v0.7.0

func (t *Target) SaveContents(device Device, source *gpt.Partition, fileSystemType partition.FileSystemType, fnmatchFilters []string) error

SaveContents saves contents of partition to the target (in-memory).

func (*Target) String added in v0.8.0

func (t *Target) String() string

Jump to

Keyboard shortcuts

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