Documentation ¶
Index ¶
- type Elemental
- func (e *Elemental) CheckActiveDeployment(labels []string) bool
- func (e *Elemental) CopyCloudConfig(cloudInit []string) (err error)
- func (e Elemental) CreateFileSystemImage(img *v1.Image) error
- func (e Elemental) DeactivateDevices() error
- func (e *Elemental) DeployImage(img *v1.Image, leaveMounted bool) (info interface{}, err error)
- func (e *Elemental) DumpSource(target string, imgSrc *v1.ImageSource) (info interface{}, err error)
- func (e Elemental) FindKernelInitrd(rootDir string) (kernel string, initrd string, err error)
- func (e *Elemental) FormatPartition(part *types.Partition, opts ...string) error
- func (e *Elemental) GetIso(iso string) (tmpDir string, err error)
- func (e Elemental) MountImage(img *v1.Image, opts ...string) error
- func (e Elemental) MountPartition(part *types.Partition, opts ...string) error
- func (e Elemental) MountPartitions(parts types.PartitionList) error
- func (e Elemental) MountRWPartition(part *types.Partition) (umount func() error, err error)
- func (e *Elemental) PartitionAndFormatDevice(i v1.SharedInstallSpec) error
- func (e *Elemental) SelinuxRelabel(rootDir string, raiseError bool) error
- func (e Elemental) SetDefaultGrubEntry(partMountPoint string, imgMountPoint string, defaultEntry string) error
- func (e Elemental) UnmountImage(img *v1.Image) error
- func (e Elemental) UnmountPartition(part *types.Partition) error
- func (e Elemental) UnmountPartitions(parts types.PartitionList) error
- func (e Elemental) UpdateSourcesFormDownloadedISO(workDir string, activeImg *v1.Image, recoveryImg *v1.Image) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Elemental ¶
type Elemental struct {
// contains filtered or unexported fields
}
Elemental is the struct meant to self-contain most utils and actions related to Elemental, like installing or applying selinux
func NewElemental ¶
func NewElemental(config *agentConfig.Config) *Elemental
func (*Elemental) CheckActiveDeployment ¶
CheckActiveDeployment returns true if at least one of the provided filesystem labels is found within the system
func (*Elemental) CopyCloudConfig ¶
CopyCloudConfig will check if there is a cloud init in the config and store it on the target
func (Elemental) CreateFileSystemImage ¶
CreateFileSystemImage creates the image file for config.target
func (Elemental) DeactivateDevices ¶
DeactivateDevice deactivates unmounted the block devices present within the system. Useful to deactivate LVM volumes, if any, related to the target device.
func (*Elemental) DeployImage ¶
DeployImage will deploy the given image into the target. This method creates the filesystem image file, mounts it and unmounts it as needed.
func (*Elemental) DumpSource ¶
func (e *Elemental) DumpSource(target string, imgSrc *v1.ImageSource) (info interface{}, err error)
DumpSource sets the image data according to the image source type
func (Elemental) FindKernelInitrd ¶
FindKernelInitrd finds for kernel and intird files inside the /boot directory of a given root tree path. It assumes kernel and initrd files match certain file name prefixes.
func (*Elemental) FormatPartition ¶
FormatPartition will format an already existing partition
func (*Elemental) GetIso ¶
GetIso will try to: download the iso into a temporary folder and mount the iso file as loop in cnst.DownloadedIsoMnt
func (Elemental) MountImage ¶
MountImage mounts an image with the given mount options
func (Elemental) MountPartition ¶
MountPartition mounts a partition with the given mount options
func (Elemental) MountPartitions ¶
func (e Elemental) MountPartitions(parts types.PartitionList) error
MountPartitions mounts configured partitions. Partitions with an unset mountpoint are not mounted. Note umounts must be handled by caller logic.
func (Elemental) MountRWPartition ¶
MountRWPartition mounts, or remounts if needed, a partition with RW permissions
func (*Elemental) PartitionAndFormatDevice ¶
func (e *Elemental) PartitionAndFormatDevice(i v1.SharedInstallSpec) error
PartitionAndFormatDevice creates a new empty partition table on target disk and applies the configured disk layout by creating and formatting all required partitions
func (*Elemental) SelinuxRelabel ¶
SelinuxRelabel will relabel the system if it finds the binary and the context
func (Elemental) SetDefaultGrubEntry ¶
func (e Elemental) SetDefaultGrubEntry(partMountPoint string, imgMountPoint string, defaultEntry string) error
SetDefaultGrubEntry Sets the default_menu_entry value in Config.GrubOEMEnv file at in State partition mountpoint. If there is not a custom value in the kairos-release file, we do nothing As the grub config already has a sane default
func (Elemental) UnmountImage ¶
UnmountImage unmounts the given image or does nothing if not mounted
func (Elemental) UnmountPartition ¶
UnmountPartition unmounts the given partition or does nothing if not mounted
func (Elemental) UnmountPartitions ¶
func (e Elemental) UnmountPartitions(parts types.PartitionList) error
UnmountPartitions unmounts configured partitiosn. Partitions with an unset mountpoint are not unmounted.
func (Elemental) UpdateSourcesFormDownloadedISO ¶
func (e Elemental) UpdateSourcesFormDownloadedISO(workDir string, activeImg *v1.Image, recoveryImg *v1.Image) error
UpdateSourcesFormDownloadedISO checks a downaloaded and mounted ISO in workDir and updates the active and recovery image descriptions to use the squashed rootfs from the downloaded ISO.