install

package
v0.0.0-...-0f8ce4c Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package install allows planning and executing the installation of Metropolis to a block device.

Index

Constants

View Source
const (
	SystemALabel = "METROPOLIS-SYSTEM-A"
	SystemBLabel = "METROPOLIS-SYSTEM-B"
	DataLabel    = "METROPOLIS-NODE-DATA"
	ESPLabel     = "ESP"

	EFIBootAPath = "EFI/metropolis/boot-a.efi"
	EFIBootBPath = "EFI/metropolis/boot-b.efi"
)
View Source
const Mi = 1024 * 1024

Variables

View Source
var (
	SystemAType = uuid.MustParse("ee96054b-f6d0-4267-aaaa-724b2afea74c")
	SystemBType = uuid.MustParse("ee96054b-f6d0-4267-bbbb-724b2afea74c")

	DataType = uuid.MustParse("9eeec464-6885-414a-b278-4305c51f7966")
)
View Source
var BootcodeX86 []byte
View Source
var EFIBootName = map[string]string{
	"x86_64":  "BOOTx64.EFI",
	"aarch64": "BOOTAA64.EFI",
}

Functions

func EFIBootPath

func EFIBootPath(architecture string) (string, error)

EFIBootPath returns the default file path according to the UEFI Specification v2.11 Section 3.5.1.1. This file is booted by any compliant UEFI firmware in absence of another bootable boot entry.

func Plan

func Plan(p *Params) (*plan, error)

Plan allows to prepare an installation without modifying any data on the system. To apply the planned installation, call Apply on the returned plan.

func Write

func Write(params *Params) (*efivarfs.LoadOption, error)

Write installs Metropolis OS to a block device.

Types

type Params

type Params struct {
	// Output is the block device to which the OS is installed.
	Output blockdev.BlockDev
	// OSImage is the image from which the OS is installed.
	OSImage *osimage.Image
	// UnverifiedPayloads disables verification of payloads if set.
	// This only works with uncompressed OS images.
	UnverifiedPayloads bool
	// ABLoader provides the A/B loader which then loads the EFI loader for the
	// correct slot.
	ABLoader structfs.Blob
	// NodeParameters provides contents of the node parameters file. If nil,
	// the node parameters file won't be created in the target ESP
	// filesystem.
	NodeParameters structfs.Blob
	// DiskGUID is a unique identifier of the image and a part of Table
	// header. It's optional and can be left blank if the identifier is
	// to be randomly generated. Setting it to a predetermined value can
	// help in implementing reproducible builds.
	DiskGUID uuid.UUID
	// PartitionSize specifies a size for the ESP, Metropolis System and
	// Metropolis data partition.
	PartitionSize PartitionSizeInfo
}

Params contains parameters used by Plan or Write to install Metropolis OS.

type PartitionSizeInfo

type PartitionSizeInfo struct {
	// Size of the EFI System Partition (ESP), in mebibytes. The size must
	// not be zero.
	ESP int64
	// Size of the Metropolis system partition, in mebibytes. The partition
	// won't be created if the size is zero.
	System int64
	// Size of the Metropolis data partition, in mebibytes. The partition
	// won't be created if the size is zero. If the image is output to a
	// block device, the partition will be extended to fill the remaining
	// space.
	Data int64
}

PartitionSizeInfo contains parameters used during partition table initialization and, in case of image files, space allocation.

Jump to

Keyboard shortcuts

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