Documentation ¶
Index ¶
- Variables
- func UnmarshalYaml[ValueType HasIsValid](yamlData []byte, value ValueType) error
- func UnmarshalYamlFile[ValueType HasIsValid](yamlFilePath string, value ValueType) error
- type BootType
- type Config
- type Disk
- type FileConfig
- type FileConfigList
- type FilePermissions
- type FileSystemType
- type HasIsValid
- type IdType
- type KernelCommandLine
- type Module
- type Modules
- type MountIdentifierType
- type PackageList
- type Partition
- type PartitionFlag
- type PartitionSetting
- type PartitionTableType
- type Script
- type Service
- type Services
- type SystemConfig
- type User
- type Verity
- type VerityPartition
Constants ¶
This section is empty.
Variables ¶
var ( DefaultFileConfig = FileConfig{ Path: "", Permissions: nil, } )
Functions ¶
func UnmarshalYaml ¶
func UnmarshalYaml[ValueType HasIsValid](yamlData []byte, value ValueType) error
func UnmarshalYamlFile ¶
func UnmarshalYamlFile[ValueType HasIsValid](yamlFilePath string, value ValueType) error
Types ¶
type Config ¶
type Config struct { Disks *[]Disk `yaml:"Disks"` SystemConfig SystemConfig `yaml:"SystemConfig"` }
type Disk ¶
type Disk struct { // The type of partition table to use (e.g. mbr, gpt) PartitionTableType PartitionTableType `yaml:"PartitionTableType"` // The virtual size of the disk. MaxSize uint64 `yaml:"MaxSize"` // The partitions to allocate on the disk. Partitions []Partition `yaml:"Partitions"` }
type FileConfig ¶
type FileConfig struct { // The file path in the target OS that the file will be copied to. Path string `yaml:"Path"` // The file permissions to set on the file. Permissions *FilePermissions `yaml:"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) UnmarshalYAML ¶
func (f *FileConfig) UnmarshalYAML(value *yaml.Node) 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) UnmarshalYAML ¶
func (l *FileConfigList) UnmarshalYAML(value *yaml.Node) error
type FilePermissions ¶
The file permissions to set on the file.
Accepted formats:
- Octal string (e.g. "660")
func (*FilePermissions) IsValid ¶
func (p *FilePermissions) IsValid() error
func (*FilePermissions) UnmarshalYAML ¶
func (p *FilePermissions) UnmarshalYAML(value *yaml.Node) error
type FileSystemType ¶
type FileSystemType string
FileSystemType is a type of file system (e.g. ext4, xfs, etc.)
const ( FileSystemTypeExt4 FileSystemType = "ext4" FileSystemTypeXfs FileSystemType = "xfs" FileSystemTypeFat32 FileSystemType = "fat32" )
func (FileSystemType) IsValid ¶
func (t FileSystemType) IsValid() error
type HasIsValid ¶
type HasIsValid interface {
IsValid() error
}
type KernelCommandLine ¶
type KernelCommandLine struct { // Extra kernel command line args. ExtraCommandLine string `yaml:"ExtraCommandLine"` }
func (*KernelCommandLine) IsValid ¶
func (s *KernelCommandLine) IsValid() error
type MountIdentifierType ¶
type MountIdentifierType string
MountIdentifierType indicates how a partition should be identified in the fstab file
const ( // MountIdentifierTypeUuid mounts this partition via the filesystem UUID MountIdentifierTypeUuid MountIdentifierType = "uuid" // MountIdentifierTypePartUuid mounts this partition via the GPT/MBR PARTUUID MountIdentifierTypePartUuid MountIdentifierType = "partuuid" // MountIdentifierTypePartLabel mounts this partition via the GPT PARTLABEL MountIdentifierTypePartLabel MountIdentifierType = "partlabel" // MountIdentifierTypeDefault uses the default type, which is PARTUUID. MountIdentifierTypeDefault MountIdentifierType = "" )
func (MountIdentifierType) IsValid ¶
func (m MountIdentifierType) IsValid() error
type PackageList ¶
type PackageList struct {
Packages []string `yaml:"Packages"`
}
func (*PackageList) IsValid ¶
func (s *PackageList) IsValid() error
type Partition ¶
type Partition struct { // ID is used to correlate `Partition` objects with `PartitionSetting` objects. ID string `yaml:"ID"` // FsType is the type of file system to use on the partition. FsType FileSystemType `yaml:"FsType"` // Name is the label to assign to the partition. Name string `yaml:"Name"` // Start is the offset where the partition begins (inclusive), in MiBs. Start uint64 `yaml:"Start"` // End is the offset where the partition ends (exclusive), in MiBs. End *uint64 `yaml:"End"` // Size is the size of the partition in MiBs. Size *uint64 `yaml:"Size"` // Flags assigns features to the partition. Flags []PartitionFlag `yaml:"Flags"` }
type PartitionFlag ¶
type PartitionFlag string
PartitionFlag describes the features of a partition.
const ( // PartitionFlagEsp indicates this is a UEFI System Partition (ESP). // // On GPT disks, "boot" and "esp" must always be specified together. PartitionFlagESP PartitionFlag = "esp" // PartitionFlagBiosGrub indicates this is the BIOS boot partition. // This is required for GPT disks that wish to be bootable using legacy BIOS mode. // This partition must start at block 1. // // See, https://en.wikipedia.org/wiki/BIOS_boot_partition PartitionFlagBiosGrub PartitionFlag = "bios_grub" // PartitionFlagBoot indicates this is a boot partition. // // On GPT disks, "boot" and "esp" must always be specified together. PartitionFlagBoot PartitionFlag = "boot" )
func (PartitionFlag) IsValid ¶
func (p PartitionFlag) IsValid() (err error)
type PartitionSetting ¶
type PartitionSetting struct { ID string `yaml:"ID"` MountIdentifier MountIdentifierType `yaml:"MountIdentifier"` MountOptions string `yaml:"MountOptions"` MountPoint string `yaml:"MountPoint"` }
PartitionSetting holds the mounting information for each partition.
func (*PartitionSetting) IsValid ¶
func (p *PartitionSetting) IsValid() error
IsValid returns an error if the PartitionSetting is not valid
type PartitionTableType ¶
type PartitionTableType string
PartitionTableType is either gpt, mbr, or none
const (
PartitionTableTypeGpt PartitionTableType = "gpt"
)
func (PartitionTableType) IsValid ¶
func (t PartitionTableType) IsValid() error
type SystemConfig ¶
type SystemConfig struct { BootType BootType `yaml:"BootType"` Hostname string `yaml:"Hostname"` UpdateBaseImagePackages bool `yaml:"UpdateBaseImagePackages"` PackageListsInstall []string `yaml:"PackageListsInstall"` PackagesInstall []string `yaml:"PackagesInstall"` PackageListsRemove []string `yaml:"PackageListsRemove"` PackagesRemove []string `yaml:"PackagesRemove"` PackageListsUpdate []string `yaml:"PackageListsUpdate"` PackagesUpdate []string `yaml:"PackagesUpdate"` KernelCommandLine KernelCommandLine `yaml:"KernelCommandLine"` AdditionalFiles map[string]FileConfigList `yaml:"AdditionalFiles"` PartitionSettings []PartitionSetting `yaml:"PartitionSettings"` PostInstallScripts []Script `yaml:"PostInstallScripts"` FinalizeImageScripts []Script `yaml:"FinalizeImageScripts"` Users []User `yaml:"Users"` Services Services `yaml:"Services"` Modules Modules `yaml:"Modules"` Verity *Verity `yaml:"Verity"` }
SystemConfig defines how each system present on the image is supposed to be configured.
func (*SystemConfig) IsValid ¶
func (s *SystemConfig) IsValid() error
type User ¶
type User struct { Name string `yaml:"Name"` UID *int `yaml:"UID"` PasswordHashed bool `yaml:"PasswordHashed"` Password string `yaml:"Password"` PasswordPath string `yaml:"PasswordPath"` PasswordExpiresDays *int64 `yaml:"PasswordExpiresDays"` SSHPubKeyPaths []string `yaml:"SSHPubKeyPaths"` SSHPubKeys []string `yaml:"SSHPubKeys"` PrimaryGroup string `yaml:"PrimaryGroup"` SecondaryGroups []string `yaml:"SecondaryGroups"` StartupCommand string `yaml:"StartupCommand"` }
type Verity ¶
type Verity struct { DataPartition VerityPartition `yaml:"DataPartition"` HashPartition VerityPartition `yaml:"HashPartition"` }
type VerityPartition ¶
func (*VerityPartition) IsValid ¶
func (v *VerityPartition) IsValid() error
Source Files ¶
- boottype.go
- config.go
- disk.go
- fileconfig.go
- filepermissions.go
- filesystemtype.go
- idtype.go
- kernelcommandline.go
- module.go
- mountidentifier.go
- packagelist.go
- partition.go
- partitionflag.go
- partitionsetting.go
- partitiontabletype.go
- script.go
- service.go
- systemconfig.go
- user.go
- utils.go
- verity.go
- verity_partition.go