configuration

package
v0.0.0-...-4cb4cf9 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EFIPartitionType    = "efi"
	LegacyPartitionType = "legacy"
)

Variables

View Source
var (
	DefaultFileConfig = FileConfig{
		Path:        "",
		Permissions: nil,
	}
)

Functions

func ConfigureNetwork

func ConfigureNetwork(installChroot *safechroot.Chroot, systemConfig SystemConfig) (err error)

ConfigureNetwork performs network configuration during the installation process

func GetKernelCmdLineValue

func GetKernelCmdLineValue(option string) (cmdlineValue string, err error)

GetKernelCmdLineValue returns the output of a specific option setting in /proc/cmdline

func ParseKickStartPartitionScheme

func ParseKickStartPartitionScheme(partitionFile string) (retdisks []Disk, retpartitionSettings []PartitionSetting, err error)

ParseKickStartPartitionScheme parses a kickstart-generated partition file and construct the Disk and PartitionSetting information

func SystemBootType

func SystemBootType() (bootType string)

SystemBootType returns the current boot type of the system being ran on.

func UpdatePackageRepo

func UpdatePackageRepo(installChroot *safechroot.Chroot, config SystemConfig) (err error)

UpdatePackageRepo creates additional repo files specified by image configuration and returns error if the operation fails

Types

type Artifact

type Artifact struct {
	Compression string `json:"Compression"`
	Name        string `json:"Name"`
	Type        string `json:"Type"`
}

Artifact [non-ISO image building only] defines the name, type and optional compression of the output Mariner image.

type CGroup

type CGroup string

CGroup sets the CGroup version

const (
	// CGroupDefault enables cgroupv1
	CGroupDefault CGroup = ""
	// CGroupV1 enables cgroupv1
	CGroupV1 CGroup = "version_one"
	// CGroupV2 enables cgroupv2
	CGroupV2 CGroup = "version_two"
)

func (*CGroup) GetValidCGroup

func (c *CGroup) GetValidCGroup() (types []CGroup)

GetValidCGroup returns a list of all the supported cgroup version options

func (*CGroup) IsValid

func (c *CGroup) IsValid() (err error)

IsValid returns an error if the CGroup is not valid

func (CGroup) String

func (c CGroup) String() string

func (*CGroup) UnmarshalJSON

func (c *CGroup) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals a CGroup entry

type Config

type Config struct {
	// Values representing the contents of the config JSON file.
	Disks         []Disk         `json:"Disks"`
	SystemConfigs []SystemConfig `json:"SystemConfigs"`

	// Computed values not present in the config JSON.
	DefaultSystemConfig *SystemConfig // A system configuration with the "IsDefault" field set or the first system configuration if there is no explicit default.
}

Config holds the parsed values of the configuration schemas as well as a few computed values simplifying access to certain pieces of the configuration.

func Load

func Load(configFilePath string) (config Config, err error)

Load loads the config schema from a JSON file found under the 'configFilePath'.

func LoadWithAbsolutePaths

func LoadWithAbsolutePaths(configFilePath, baseDirPath string) (config Config, err error)

LoadWithAbsolutePaths loads the config schema from a JSON file found under the 'configFilePath' and resolves all relative paths into absolute ones using 'baseDirPath' as a starting point for all relative paths.

func (*Config) GetBootPartition

func (c *Config) GetBootPartition() (partitionIndex int, partition *Partition)

func (*Config) GetDiskContainingPartition

func (c *Config) GetDiskContainingPartition(partition *Partition) (disk *Disk)

GetDiskByPartition returns the disk containing the provided partition

func (*Config) GetDiskPartByID

func (c *Config) GetDiskPartByID(ID string) (diskPart *Partition)

GetDiskPartByID returns the disk partition object with the desired ID, nil if no partition found

func (*Config) IsValid

func (c *Config) IsValid() (err error)

IsValid returns an error if the Config is not valid

func (*Config) SetDefaultConfig

func (c *Config) SetDefaultConfig()

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals a Config entry

type Disk

type Disk struct {
	PartitionTableType PartitionTableType `json:"PartitionTableType"`
	MaxSize            uint64             `json:"MaxSize"`
	TargetDisk         TargetDisk         `json:"TargetDisk"`
	Artifacts          []Artifact         `json:"Artifacts"`
	Partitions         []Partition        `json:"Partitions"`
	RawBinaries        []RawBinary        `json:"RawBinaries"`
}

Disk holds the disk partitioning, formatting and size information. It may also define artifacts generated for each disk.

func (*Disk) IsValid

func (d *Disk) IsValid() (err error)

IsValid returns an error if the PartitionTableType is not valid

func (*Disk) UnmarshalJSON

func (d *Disk) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals a Disk entry

type FileConfig

type FileConfig struct {
	// The file path in the target OS that the file will be copied to.
	Path string `json:"Path"`

	// The file permissions to set on the file.
	Permissions *FilePermissions `json:"Permissions"`
}

FileConfig specifies options for how a file is copied in the target OS.

func (*FileConfig) IsValid

func (f *FileConfig) IsValid() (err error)

func (*FileConfig) UnmarshalJSON

func (f *FileConfig) UnmarshalJSON(b []byte) error

type FileConfigList

type FileConfigList []FileConfig

DestinationFileConfigList is a list of destination files where the source file will be copied to in the final image. This type exists to allow a custom marshaller to be attached to it.

func (*FileConfigList) IsValid

func (l *FileConfigList) IsValid() (err error)

func (*FileConfigList) UnmarshalJSON

func (l *FileConfigList) UnmarshalJSON(b []byte) error

type FilePermissions

type FilePermissions os.FileMode

The file permissions to set on the file.

Accepted formats:

- Octal string (e.g. "660")

func (*FilePermissions) IsValid

func (p *FilePermissions) IsValid() (err error)

func (FilePermissions) MarshalJSON

func (p FilePermissions) MarshalJSON() ([]byte, error)

func (*FilePermissions) UnmarshalJSON

func (p *FilePermissions) UnmarshalJSON(b []byte) error

type Group

type Group struct {
	Name string `json:"Name"`
	GID  string `json:"GID"`
}

Group defines a single group to be created on the new system.

type ImaPolicy

type ImaPolicy string

ImaPolicy sets the ima_policy kernel command line option

const (
	// ImaPolicyTcb selects the tcb IMA policy
	ImaPolicyTcb ImaPolicy = "tcb"
	// ImaPolicyAppraiseTcb selects the appraise_tcb IMA policy
	ImaPolicyAppraiseTcb ImaPolicy = "appraise_tcb"
	// ImaPolicySecureBoot selects the secure_boot IMA policy
	ImaPolicySecureBoot ImaPolicy = "secure_boot"
	// ImaPolicyNone selects no IMA policy
	ImaPolicyNone ImaPolicy = ""
)

func (*ImaPolicy) GetValidImaPolicies

func (i *ImaPolicy) GetValidImaPolicies() (types []ImaPolicy)

GetValidImaPolicies returns a list of all the supported disk partition types

func (*ImaPolicy) IsValid

func (i *ImaPolicy) IsValid() (err error)

IsValid returns an error if the ImaPolicy is not valid

func (ImaPolicy) String

func (i ImaPolicy) String() string

func (*ImaPolicy) UnmarshalJSON

func (i *ImaPolicy) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals an ImaPolicy entry

type InstallScript

type InstallScript struct {
	Args string `json:"Args"`
	Path string `json:"Path"`
}

InstallScript defines a script to be run before or after other installation steps and provides a way to pass parameters to it.

type KernelCommandLine

type KernelCommandLine struct {
	CGroup           CGroup      `json:"CGroup"`
	ImaPolicy        []ImaPolicy `json:"ImaPolicy"`
	SELinux          SELinux     `json:"SELinux"`
	SELinuxPolicy    string      `json:"SELinuxPolicy"`
	EnableFIPS       bool        `json:"EnableFIPS"`
	ExtraCommandLine string      `json:"ExtraCommandLine"`
}

KernelCommandLine holds extra command line parameters which can be added to the grub config file.

  • ImaPolicy: A list of IMA policies which will be used together
  • ExtraCommandLine: Arbitrary parameters which will be appended to the end of the kernel command line

func (*KernelCommandLine) GetSedDelimeter

func (k *KernelCommandLine) GetSedDelimeter() (delimeter string)

GetSedDelimeter returns the delimeter which should be used with sed to find/replace the command line strings.

func (*KernelCommandLine) IsValid

func (k *KernelCommandLine) IsValid() (err error)

IsValid returns an error if the KernelCommandLine is not valid

func (*KernelCommandLine) UnmarshalJSON

func (k *KernelCommandLine) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals a KernelCommandLine entry

type MountIdentifier

type MountIdentifier string

MountIdentifier indicates how a partition should be identified in the fstab file

const (
	// MountIdentifierUuid mounts this partition via the filesystem UUID
	MountIdentifierUuid MountIdentifier = "uuid"
	// MountIdentifierPartUuid mounts this partition via the GPT/MBR PARTUUID
	MountIdentifierPartUuid MountIdentifier = "partuuid"
	// MountIdentifierPartLabel mounts this partition via the GPT PARTLABEL
	MountIdentifierPartLabel MountIdentifier = "partlabel"

	MountIdentifierDefault MountIdentifier = MountIdentifierPartUuid
	MountIdentifierNone    MountIdentifier = ""
)

label

func GetDefaultMountIdentifier

func GetDefaultMountIdentifier() (defaultVal MountIdentifier)

func (*MountIdentifier) GetValidMountIdentifiers

func (m *MountIdentifier) GetValidMountIdentifiers() (types []MountIdentifier)

GetValidMountIdentifiers returns a list of all the supported mount identifiers

func (*MountIdentifier) IsValid

func (m *MountIdentifier) IsValid() (err error)

IsValid returns an error if the PartitionFlag is not valid

func (MountIdentifier) String

func (m MountIdentifier) String() string

func (*MountIdentifier) UnmarshalJSON

func (m *MountIdentifier) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals an MountIdentifier entry

type Network

type Network struct {
	BootProto   string   `json:"BootProto"`
	GateWay     string   `json:"GateWay"`
	Ip          string   `json:"Ip"`
	NetMask     string   `json:"NetMask"`
	OnBoot      bool     `json:"OnBoot"`
	NameServers []string `json:"NameServer"`
	Device      string   `json:"Device"`
}

func (*Network) IsValid

func (n *Network) IsValid() (err error)

IsValid returns an error if the Network struct is not valid

func (*Network) UnmarshalJSON

func (n *Network) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals a Network entry

type PackageRepo

type PackageRepo struct {
	Name         string `json:"Name"`
	BaseUrl      string `json:"BaseUrl"`
	Install      bool   `json:"Install"`
	GPGCheck     bool   `json:"GPGCheck"`     // Default value is true
	RepoGPGCheck bool   `json:"RepoGPGCheck"` // Default value is true
	GPGKeys      string `json:"GPGKeys"`      // Default value is "file:///etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY file:///etc/pki/rpm-gpg/MICROSOFT-METADATA-GPG-KEY"
}

PackageRepo defines the RPM repo to pull packages from during the installation or after the system is installed. The "Install" option indicates that the provided repository configuration will be saved in the installed system if specified, and only available during the installation process if not

func (*PackageRepo) IsValid

func (p *PackageRepo) IsValid() (err error)

IsValid returns an error if the PackageRepo struct is not valid

func (*PackageRepo) UnmarshalJSON

func (p *PackageRepo) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals a PackageRepo entry

type Partition

type Partition struct {
	FsType    string          `json:"FsType"`
	ID        string          `json:"ID"`
	Name      string          `json:"Name"`
	End       uint64          `json:"End"`
	Start     uint64          `json:"Start"`
	Flags     []PartitionFlag `json:"Flags"`
	Artifacts []Artifact      `json:"Artifacts"`
}

Partition defines the size, name and file system type for a partition. "Start" and "End" fields define the offset from the beginning of the disk in MBs. An "End" value of 0 will determine the size of the partition using the next partition's start offset or the value defined by "MaxSize", if this is the last partition on the disk. "Grow" tells the logical volume to fill up any available space (**Only used for kickstart-style unattended installation**)

func (*Partition) HasFlag

func (p *Partition) HasFlag(flag PartitionFlag) bool

HasFlag returns true if a given partition has a specific flag set.

func (*Partition) IsValid

func (p *Partition) IsValid() (err error)

IsValid returns an error if the Partition is not valid

func (*Partition) UnmarshalJSON

func (p *Partition) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals a Partition entry

type PartitionFlag

type PartitionFlag string

PartitionFlag describes the features of a partition

const (
	// PartitionFlagESP indicates this is the UEFI esp partition
	PartitionFlagESP PartitionFlag = "esp"
	// PartitionFlagGrub indicates this is a grub boot partition
	PartitionFlagGrub PartitionFlag = "grub"
	// PartitionFlagBiosGrub indicates this is a bios grub boot partition
	PartitionFlagBiosGrub PartitionFlag = "bios_grub"
	// PartitionFlagBiosGrubLegacy indicates this is a bios grub boot partition. Needed to preserve legacy config behavior.
	PartitionFlagBiosGrubLegacy PartitionFlag = "bios-grub"
	// PartitionFlagBoot indicates this is a boot partition
	PartitionFlagBoot PartitionFlag = "boot"
	// PartitionFlagDeviceMapperRoot indicates this partition will be used for a device mapper root device
	PartitionFlagDeviceMapperRoot PartitionFlag = "dmroot"
)

func BootPartitionConfig

func BootPartitionConfig(bootType string, partitionTableType PartitionTableType) (mountPoint, mountOptions string, flags []PartitionFlag, err error)

BootPartitionConfig returns the partition flags and mount point that should be used for a given boot type.

func (*PartitionFlag) GetValidPartitionFlags

func (p *PartitionFlag) GetValidPartitionFlags() (types []PartitionFlag)

GetValidPartitionFlags returns a list of all the supported partition flags

func (*PartitionFlag) IsValid

func (p *PartitionFlag) IsValid() (err error)

IsValid returns an error if the PartitionFlag is not valid

func (PartitionFlag) String

func (p PartitionFlag) String() string

func (*PartitionFlag) UnmarshalJSON

func (p *PartitionFlag) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals an PartitionFlag entry

type PartitionSetting

type PartitionSetting struct {
	RemoveDocs       bool            `json:"RemoveDocs"`
	ID               string          `json:"ID"`
	MountIdentifier  MountIdentifier `json:"MountIdentifier"`
	MountOptions     string          `json:"MountOptions"`
	MountPoint       string          `json:"MountPoint"`
	OverlayBaseImage string          `json:"OverlayBaseImage"`
	RdiffBaseImage   string          `json:"RdiffBaseImage"`
}

PartitionSetting holds the mounting information for each partition.

func FindMountpointPartitionSetting

func FindMountpointPartitionSetting(partitionSettings []PartitionSetting, mountPoint string) (partitionSetting *PartitionSetting)

FindMountpointPartitionSetting will search a list of partition settings for the partition setting corresponding to a mount point.

func FindRootPartitionSetting

func FindRootPartitionSetting(partitionSettings []PartitionSetting) (rootPartitionSetting *PartitionSetting)

FindRootPartitionSetting returns a pointer to the partition setting describing the disk which will be mounted at "/", or nil if no partition is found

func GetDefaultPartitionSetting

func GetDefaultPartitionSetting() (defaultVal PartitionSetting)

GetDefaultPartitionSetting returns a copy of the default partition setting

func (*PartitionSetting) IsValid

func (p *PartitionSetting) IsValid() (err error)

IsValid returns an error if the PartitionSetting is not valid

func (*PartitionSetting) UnmarshalJSON

func (p *PartitionSetting) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals a PartitionSetting entry

type PartitionTableType

type PartitionTableType string

PartitionTableType is either gpt, mbr, or none

const (
	// PartitionTableTypeGpt selects gpt
	PartitionTableTypeGpt PartitionTableType = "gpt"
	// PartitionTableTypeMbr selects mbr
	PartitionTableTypeMbr PartitionTableType = "mbr"
	// PartitionTableTypeNone selects no partition type
	PartitionTableTypeNone PartitionTableType = ""
)

func (*PartitionTableType) ConvertToPartedArgument

func (p *PartitionTableType) ConvertToPartedArgument() (partedArgument string, err error)

ConvertToPartedArgument returns the parted argument corresponding to the partition table type

func (*PartitionTableType) GetValidPartitionTableTypes

func (p *PartitionTableType) GetValidPartitionTableTypes() (types []PartitionTableType)

GetValidPartitionTableTypes returns a list of all the supported disk partition types

func (*PartitionTableType) IsValid

func (p *PartitionTableType) IsValid() (err error)

IsValid returns an error if the PartitionTableType is not valid

func (PartitionTableType) String

func (p PartitionTableType) String() string

func (*PartitionTableType) UnmarshalJSON

func (p *PartitionTableType) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals a PartitionTableType entry

type RawBinary

type RawBinary struct {
	BinPath   string `json:"BinPath"`
	BlockSize uint64 `json:"BlockSize"`
	Seek      uint64 `json:"Seek"`
}

RawBinary allow the users to specify a binary they would like to copy byte-for-byte onto the disk.

type ReadOnlyVerityRoot

type ReadOnlyVerityRoot struct {
	Enable                       bool                `json:"Enable"`
	Name                         string              `json:"Name"`
	ErrorCorrectionEnable        bool                `json:"ErrorCorrectionEnable"`
	ErrorCorrectionEncodingRoots int                 `json:"ErrorCorrectionEncodingRoots"`
	RootHashSignatureEnable      bool                `json:"RootHashSignatureEnable"`
	ValidateOnBoot               bool                `json:"ValidateOnBoot"`
	VerityErrorBehavior          VerityErrorBehavior `json:"VerityErrorBehavior"`
	TmpfsOverlays                []string            `json:"TmpfsOverlays"`
	TmpfsOverlaySize             string              `json:"TmpfsOverlaySize"`
	TmpfsOverlayDebugEnabled     bool                `json:"TmpfsOverlayDebugEnabled"`
}

ReadOnlyVerityRoot controls DM-Verity read-only filesystems which will be mounted at startup It will create a verity disk from the partition mounted at "/". The verity data is stored as part of the image's initramfs.

  • Enable: Enable dm-verity on the root filesystem and add the root hash to the initramfs
  • Name: Custom name for the mounted root (default is "verity_root_fs")
  • ErrorCorrectionEnable: Enable Reed-Solomon forward error correction of read-only data and add the FEC data to the initramfs
  • ErrorCorrectionEncodingRoots: Increase overhead to increase resiliency, default is 2 encoding bytes per 255 bytes of real data) giving 0.8% overhead ( RS(255,253) ) For a given N (where N = 255 - #Roots), the number of consecutive recoverable blocks is: ceiling(# of 4k blocks in disk / (N)) * (255-N) ie for 2GiB disk: ceiling(524288 / 253) * (255-253) = 2073 * 2 = 4146 blocks = ~16MiB
  • RootHashSignatureEnable: Validate the root hash against a key stored in the kernel's system keyring. The signature file should be called "<Name>.p7" and must be stored in the initramfs. This signature WILL NOT BE included automatically in the initramfs. It must be included via an out of band build step (extract initramfs, create signature from root, add signature file, recompress).
  • ValidateOnBoot: Run a validation of the full disk at boot time, normally blocks are validated only as needed. This can take several minutes if the disk is corrupted.
  • VerityErrorBehavior: System behavior when encountering an unrecoverable verity corruption. One of 'ignore', 'restart', 'panic'
  • TmpfsOverlays: Mount these paths as writable overlays backed by a tmpfs in memory. They are discarded on reboot. Overlays should not overlap each other. If a directory is not already present it will be created automatically. Persistant overlays can be created by mounting writable partitions as normal.
  • TmpfsOverlayDebugEnabled: Make the tmpfs overlay mounts easily accessible for debugging purposes. They can be found in /mnt/verity_overlay_debug_tmpfs

func GetDefaultReadOnlyVerityRoot

func GetDefaultReadOnlyVerityRoot() (defaultVal ReadOnlyVerityRoot)

GetDefaultReadOnlyVerityRoot returns a copy of the default verity root config

func (*ReadOnlyVerityRoot) IsValid

func (v *ReadOnlyVerityRoot) IsValid() (err error)

IsValid returns an error if the ReadOnlyVerityRoot is not valid

func (*ReadOnlyVerityRoot) UnmarshalJSON

func (v *ReadOnlyVerityRoot) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals a ReadOnlyVerityRoot entry

type RootEncryption

type RootEncryption struct {
	Enable   bool   `json:"Enable"`
	Password string `json:"Password"`
}

RootEncryption enables encryption on the root partition

type SELinux

type SELinux string

SELinux sets the SELinux mode

const (
	// SELinuxOff disables SELinux
	SELinuxOff SELinux = ""
	// SELinuxEnforcing sets SELinux to enforcing
	SELinuxEnforcing SELinux = "enforcing"
	// SELinuxPermissive sets SELinux to permissive
	SELinuxPermissive SELinux = "permissive"
	// SELinuxForceEnforcing both sets SELinux to enforcing, and forces it via the kernel command line
	SELinuxForceEnforcing SELinux = "force_enforcing"
)

func (*SELinux) GetValidSELinux

func (s *SELinux) GetValidSELinux() (types []SELinux)

GetValidImaPolicies returns a list of all the supported disk partition types

func (*SELinux) IsValid

func (s *SELinux) IsValid() (err error)

IsValid returns an error if the SELinux is not valid

func (SELinux) String

func (s SELinux) String() string

func (*SELinux) UnmarshalJSON

func (s *SELinux) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals an SELinux entry

type SystemConfig

type SystemConfig struct {
	IsDefault            bool                      `json:"IsDefault"`
	IsKickStartBoot      bool                      `json:"IsKickStartBoot"`
	IsIsoInstall         bool                      `json:"IsIsoInstall"`
	BootType             string                    `json:"BootType"`
	Hostname             string                    `json:"Hostname"`
	Name                 string                    `json:"Name"`
	PackageLists         []string                  `json:"PackageLists"`
	Packages             []string                  `json:"Packages"`
	KernelOptions        map[string]string         `json:"KernelOptions"`
	KernelCommandLine    KernelCommandLine         `json:"KernelCommandLine"`
	AdditionalFiles      map[string]FileConfigList `json:"AdditionalFiles"`
	PartitionSettings    []PartitionSetting        `json:"PartitionSettings"`
	PreInstallScripts    []InstallScript           `json:"PreInstallScripts"`
	PostInstallScripts   []InstallScript           `json:"PostInstallScripts"`
	FinalizeImageScripts []InstallScript           `json:"FinalizeImageScripts"`
	Networks             []Network                 `json:"Networks"`
	PackageRepos         []PackageRepo             `json:"PackageRepos"`
	Groups               []Group                   `json:"Groups"`
	Users                []User                    `json:"Users"`
	Encryption           RootEncryption            `json:"Encryption"`
	RemoveRpmDb          bool                      `json:"RemoveRpmDb"`
	ReadOnlyVerityRoot   ReadOnlyVerityRoot        `json:"ReadOnlyVerityRoot"`
	HidepidDisabled      bool                      `json:"HidepidDisabled"`
}

SystemConfig defines how each system present on the image is supposed to be configured.

func (*SystemConfig) GetMountpointPartitionSetting

func (s *SystemConfig) GetMountpointPartitionSetting(mountPoint string) (partitionSetting *PartitionSetting)

GetMountpointPartitionSetting will search the system configuration for the partition setting corresponding to a mount point.

func (*SystemConfig) GetRootPartitionSetting

func (s *SystemConfig) GetRootPartitionSetting() (rootPartitionSetting *PartitionSetting)

GetRootPartitionSetting returns a pointer to the partition setting describing the disk which will be mounted at "/", or nil if no partition is found

func (*SystemConfig) IsValid

func (s *SystemConfig) IsValid() (err error)

IsValid returns an error if the SystemConfig is not valid

func (*SystemConfig) UnmarshalJSON

func (s *SystemConfig) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals a Disk entry

type TargetDisk

type TargetDisk struct {
	Type  string `json:"Type"`
	Value string `json:"Value"`
}

TargetDisk [kickstart-only] defines the physical disk, to which Mariner should be installed.

type User

type User struct {
	Name                string   `json:"Name"`
	UID                 string   `json:"UID"`
	PasswordHashed      bool     `json:"PasswordHashed"`
	Password            string   `json:"Password"`
	PasswordExpiresDays int64    `json:"PasswordExpiresDays"`
	SSHPubKeyPaths      []string `json:"SSHPubKeyPaths"`
	SSHPubKeys          []string `json:"SSHPubKeys"`
	PrimaryGroup        string   `json:"PrimaryGroup"`
	SecondaryGroups     []string `json:"SecondaryGroups"`
	StartupCommand      string   `json:"StartupCommand"`
}

func (*User) IsValid

func (p *User) IsValid() (err error)

IsValid returns an error if the User struct is not valid

func (*User) NameIsValid

func (p *User) NameIsValid() (err error)

NameIsValid returns an error if the User name is empty

func (*User) PasswordExpiresDaysIsValid

func (p *User) PasswordExpiresDaysIsValid() (err error)

PasswordExpiresDaysISValid returns an error if the expire days is not within bounds set by the chage -M command

func (*User) UIDIsValid

func (p *User) UIDIsValid() (err error)

UIDIsValid returns an error if the UID is outside bounds.

func (*User) UnmarshalJSON

func (u *User) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals a User entry

type VerityErrorBehavior

type VerityErrorBehavior string

VerityErrorBehavior sets the error behavior for the root FS verity disk

const (
	// VerityErrorBehaviorIgnore ignores corruption
	VerityErrorBehaviorIgnore VerityErrorBehavior = "ignore"
	// VerityErrorBehaviorRestart restarts the device when corrupt blocks are found
	VerityErrorBehaviorRestart VerityErrorBehavior = "restart"
	// VerityErrorBehaviorPanic panics the kernel when corrupt blocks are found
	VerityErrorBehaviorPanic VerityErrorBehavior = "panic"
	// VerityErrorBehaviorDefault does not explicitly set the error behavior
	VerityErrorBehaviorDefault VerityErrorBehavior = ""
)

func (*VerityErrorBehavior) GetValidVerityErrorBehaviors

func (v *VerityErrorBehavior) GetValidVerityErrorBehaviors() (types []VerityErrorBehavior)

GetValidVerityErrorBehaviors returns a list of all the supported verity error handling behaviors

func (*VerityErrorBehavior) IsValid

func (v *VerityErrorBehavior) IsValid() (err error)

IsValid returns an error if the VerityErrorBehavior is not valid

func (VerityErrorBehavior) String

func (v VerityErrorBehavior) String() string

func (*VerityErrorBehavior) UnmarshalJSON

func (v *VerityErrorBehavior) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Unmarshals an VerityErrorBehavior entry

Jump to

Keyboard shortcuts

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