elemental

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckActiveDeployment added in v1.2.0

func CheckActiveDeployment(c v1.Config, labels []string) bool

CheckActiveDeployment returns true if at least one of the provided filesystem labels is found within the system

func CopyCloudConfig added in v1.2.0

func CopyCloudConfig(c v1.Config, path string, cloudInit []string) (err error)

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

func CopyFileImg added in v1.2.0

func CopyFileImg(c v1.Config, img *v1.Image) error

CopyFileImg copies the files target as the source of this image. It also applies the img label over the copied image.

func CreateFileSystemImage added in v1.2.0

func CreateFileSystemImage(c v1.Config, img *v1.Image, rootDir string, preload bool) error

CreateFileSystemImage creates the image file for the given image. An root tree path can be used to determine the image size and the preload flag can be used to create an image including the root tree data.

func CreateImageFromTree added in v1.2.0

func CreateImageFromTree(c v1.Config, img *v1.Image, rootDir string, preload bool, cleaners ...func() error) (err error)

CreateImageFromTree creates the given image including the given root tree. If preload flag is true it attempts to preload the root tree at filesystem format time. This allows creating images with the given root tree without the need of mounting them.

func DeactivateDevices added in v1.2.0

func DeactivateDevices(c v1.Config) error

DeactivateDevice deactivates unmounted the block devices present within the system. Useful to deactivate LVM volumes, if any, related to the target device.

func DeployImage added in v1.2.0

func DeployImage(c v1.Config, img *v1.Image) (interface{}, error)

DeployImage will deploy the given image into the target. This method creates the filesystem image file and fills it with the correspondant data

func DeployImgTree added in v1.2.0

func DeployImgTree(c v1.Config, img *v1.Image, root string) (info interface{}, cleaner func() error, err error)

DeployImgTree will deploy the given image into the given root tree. Returns source metadata in info, a tree cleaner function and error. The given root will be a bind mount of a temporary directory into the same filesystem of img.File, this is helpful to make the deployment easily accessible in after-* hooks.

func DumpSource added in v1.2.0

func DumpSource(c v1.Config, target string, imgSrc *v1.ImageSource) (info interface{}, err error)

DumpSource sets the image data according to the image source type

func FormatPartition added in v1.2.0

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

FormatPartition will format an already existing partition

func GetTempDir added in v1.2.0

func GetTempDir(c v1.Config, suffix string) string

GetTempDir returns the dir for storing related temporal files It will respect TMPDIR and use that if exists, fallback to try the persistent partition if its mounted and finally the default /tmp/ dir suffix is what is appended to the dir name elemental-suffix. If empty it will randomly generate a number

func IsMounted added in v1.2.0

func IsMounted(c v1.Config, part *v1.Partition) (bool, error)

Is Mounted checks if the given partition is mounted or not

func MountFileSystemImage added in v1.2.0

func MountFileSystemImage(c v1.Config, img *v1.Image, opts ...string) error

MountFileSystemImage mounts an image with the given mount options

func MountPartition added in v1.2.0

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

MountPartition mounts a partition with the given mount options

func MountPartitions added in v1.2.0

func MountPartitions(c v1.Config, parts v1.PartitionList) error

MountPartitions mounts configured partitions. Partitions with an unset mountpoint are not mounted. Note umounts must be handled by caller logic.

func MountRWPartition added in v1.2.0

func MountRWPartition(c v1.Config, part *v1.Partition) (umount func() error, err error)

MountRWPartition mounts, or remounts if needed, a partition with RW permissions

func PartitionAndFormatDevice added in v1.2.0

func PartitionAndFormatDevice(c v1.Config, i *v1.InstallSpec) 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 SelinuxRelabel added in v1.2.0

func SelinuxRelabel(c v1.Config, rootDir string, raiseError bool) error

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

func SourceFormISO added in v1.2.0

func SourceFormISO(c v1.Config, iso string) (*v1.ImageSource, func() error, error)

SourceISO downloads an ISO in a temporary folder, mounts it and returns the image source to be used Returns a source and cleaner method to unmount and remove the temporary folder afterwards.

func UnmountFileSystemImage added in v1.2.0

func UnmountFileSystemImage(c v1.Config, img *v1.Image) error

UnmountFilesystemImage unmounts the given image or does nothing if not mounted

func UnmountPartition added in v1.2.0

func UnmountPartition(c v1.Config, part *v1.Partition) error

UnmountPartition unmounts the given partition or does nothing if not mounted

func UnmountPartitions added in v1.2.0

func UnmountPartitions(c v1.Config, parts v1.PartitionList) error

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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