elemental

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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 *v1.RunConfig) *Elemental

func (*Elemental) CheckNoFormat

func (c *Elemental) CheckNoFormat() error

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

func (c *Elemental) CopyCloudConfig() (err error)

CopyCloudConfig will check if there is a cloud init in the config and store it on the target

func (*Elemental) CopyImage

func (c *Elemental) CopyImage(img *v1.Image) error

CopyImage sets the image data according to the image source type

func (Elemental) CreateFileSystemImage

func (c Elemental) CreateFileSystemImage(img *v1.Image) error

CreateFileSystemImage creates the image file for config.target

func (*Elemental) DeployImage

func (c *Elemental) DeployImage(img *v1.Image, leaveMounted bool) error

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

func (c *Elemental) FormatPartition(part *v1.Partition, opts ...string) error

FormatPartition will format an already existing partition

func (*Elemental) GetIso

func (c *Elemental) GetIso() (tmpDir string, err error)

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

func (c Elemental) MountImage(img *v1.Image, opts ...string) error

MountImage mounts an image with the given mount options

func (Elemental) MountPartition

func (c Elemental) MountPartition(part *v1.Partition, opts ...string) error

MountPartition mounts a partition with the given mount options

func (Elemental) MountPartitions

func (c Elemental) MountPartitions() error

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

func (c Elemental) Rebrand() error

Runs rebranding procedure. Note this assumes all required partitions and images to be mounted in advance.

func (*Elemental) SelinuxRelabel

func (c *Elemental) SelinuxRelabel(rootDir string, raiseError bool) error

SelinuxRelabel will relabel the system if it finds the binary and the context

func (Elemental) SetDefaultGrubEntry

func (c Elemental) SetDefaultGrubEntry() error

Sets the default_meny_entry value in RunConfig.GrubOEMEnv file at in State partition mountpoint.

func (Elemental) UnmountImage

func (c Elemental) UnmountImage(img *v1.Image) error

UnmountImage unmounts the given image or does nothing if not mounted

func (Elemental) UnmountPartition

func (c Elemental) UnmountPartition(part *v1.Partition) error

UnmountPartition unmounts the given partition or does nothing if not mounted

func (Elemental) UnmountPartitions

func (c Elemental) UnmountPartitions() error

UnmountPartitions unmounts configured partitiosn. Partitions with an unset mountpoint are not unmounted.

Jump to

Keyboard shortcuts

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