Documentation ¶
Index ¶
- type Elemental
- func (c *Elemental) CheckNoFormat() error
- func (c *Elemental) CopyCloudConfig() (err error)
- func (c *Elemental) CopyImage(img *v1.Image) error
- func (c Elemental) CreateFileSystemImage(img *v1.Image) error
- func (c *Elemental) DeployImage(img *v1.Image, leaveMounted bool) error
- func (c *Elemental) FormatPartition(part *v1.Partition, opts ...string) error
- func (c *Elemental) GetIso() (tmpDir string, err error)
- func (c Elemental) MountImage(img *v1.Image, opts ...string) error
- func (c Elemental) MountPartition(part *v1.Partition, opts ...string) error
- func (c Elemental) MountPartitions() error
- func (c *Elemental) PartitionAndFormatDevice(disk *partitioner.Disk) error
- func (c Elemental) Rebrand() error
- func (c *Elemental) SelinuxRelabel(rootDir string, raiseError bool) error
- func (c Elemental) SetDefaultGrubEntry() error
- func (c Elemental) UnmountImage(img *v1.Image) error
- func (c Elemental) UnmountPartition(part *v1.Partition) error
- func (c Elemental) UnmountPartitions() 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 (*Elemental) CheckNoFormat ¶
CheckNoFormat will make sure that if we set the no format option, the system doesnt already contain a cos system by checking the active/passive labels. If they are set then we check if we have the force flag, which means that we don't care and proceed to overwrite
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) DeployImage ¶
DeployImage will deploay the given image into the target. This method creates the filesystem image file, mounts it and unmounts it as needed.
func (*Elemental) FormatPartition ¶
FormatPartition will format an already existing partition
func (*Elemental) GetIso ¶
GetIso will try to: download the iso into a temporary folder, mount the iso file as loop in cnst.DownloadedIsoMnt and update recovery and active image sources if they are already configured.
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 ¶
MountPartitions mounts configured partitions. Partitions with an unset mountpoint are not mounted. Note umounts must be handled by caller logic.
func (*Elemental) PartitionAndFormatDevice ¶
func (c *Elemental) PartitionAndFormatDevice(disk *partitioner.Disk) 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) Rebrand ¶
Runs rebranding procedure. Note this assumes all required partitions and images to be mounted in advance.
func (*Elemental) SelinuxRelabel ¶
SelinuxRelabel will relabel the system if it finds the binary and the context
func (Elemental) SetDefaultGrubEntry ¶
Sets the default_meny_entry value in RunConfig.GrubOEMEnv file at in State partition mountpoint.
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 ¶
UnmountPartitions unmounts configured partitiosn. Partitions with an unset mountpoint are not unmounted.