package
2.3.0-dev
Repository: https://github.com/rancher/elemental-toolkit.git
Documentation: pkg.go.dev

# Functions

BootedFrom will check if we are booting from the given label.
CalcFileChecksum opens the given file and returns the sha256 checksum of it.
ChrootedCallback runs the given callback in a chroot environment.
ConcatFiles Copies source files to target file using Fs interface.
CopyFile Copies source file to target file using Fs interface.
CosignVerify runs a cosign validation for the give image and given public key.
CreateDirStructure creates essentials directories under the root tree that might not be present within a container image (/dev, /run, etc.).
CreateRAWFile creates raw file of the given size in MB.
CreateSquashFS creates a squash file at destination from a source, with options TODO: Check validity of source maybe?.
DirSize returns the accumulated size of all files in folder.
DirSizeMB returns the accumulated size of all files in folder.
Check if a file or directory exists.
FindFile attempts to find a file from a list of patterns on top of a given root path.
FindFiles attempts to find files from a given pattern on top of a root path.
FindInitrd finds for initrd files inside a given root tree path.
FindKernel finds for kernel files inside a given root tree path.
FindKernelInitrd finds for kernel and intird files inside a given root tree path.
GetAllPartitions returns all partitions in the system for all disks.
GetDeviceByLabel will try to return the device that matches the given label.
GetFullDeviceByLabel works like GetDeviceByLabel, but it will try to get as much info as possible from the existing partition and return a types.Partition object.
GetPartitionFS gets the FS of a partition given.
GetSource copies given source to destination, if source is a local path it simply copies files, if source is a remote URL it tries to download URL to destination.
IsDir check if the path is a dir.
IsHTTPURI returns true if the uri has "http" or "https" scheme, returns false otherwise.
IsLocalURI returns true if the uri has "file" scheme or no scheme and URI is not prefixed with a domain (container registry style).
LoadEnvFile will try to parse the file given and return a map with the key/values.
MirrorData rsync's source folder contents to a target folder content, in contrast, to SyncData this method includes the --delete flag which forces the deletion of files in target that are missing in source.
MkdirAll directory and all parents if not existing.
No description provided by the author
NewCleanStack returns a new stack.
PreAppendRoot simply adds the given root as a prefix to the given paths.
RawDiskToFixedVhd will write the proper header to a given os.File to convert it from a simple raw disk to a Fixed VHD RawDiskToFixedVhd makes no effort into opening/closing/checking if the file exists.
Reboot reboots the system after the given delay (in seconds) time passed.
RemoveAll removes the specified path.
ResolveLink attempts to resolve a symlink, if any.
RunStage will run yip.
Shutdown halts the system after the given delay (in seconds) time passed.
SyncData rsync's source folder contents to a target folder content, both are expected to exist before hand.
TempDir creates a temp file in the virtual fs Took from afero.FS code and adapted.
TempFile creates a temp file in the virtual fs Took from afero.FS code and adapted.
ValidContainerReferece returns true if the given string matches a container registry reference, false otherwise.
ValidTaggedContainerReferece returns true if the given string matches a container registry reference including a tag, false otherwise.
WalkDirFs is the same as filepath.WalkDir but accepts a types.Fs so it can be run on any types.Fs type.
WriteEnvFile will write the given environment file with the given key/values.

# Structs

Chroot represents the struct that will allow us to run commands inside a given chroot.
CleanJob represents a clean task.
Stack is a basic LIFO stack that resizes as needed.
No description provided by the author

# Type aliases

No description provided by the author