package
0.6.0
Repository: https://github.com/kairos-io/immucore.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
AppendSlash it's in the name.
BootStateToLabelDevice lets us know the device we need to mount sysroot on based on labels.
CleanSysrootForFstab will clean up the pesky sysroot dir from entries to make them suitable to be written in the fstab As we mount on /sysroot during initramfs but the fstab file is for the real init process, we need to remove Any mentions to /sysroot from the fstab lines, otherwise they won't work Special care for the root (/sysroot) path as we can't just simple remove that path and call it a day as that will return an empty mountpoint which will break fstab mounting.
CleanupSlice will clean a slice of strings of empty items Typos can be made on writing the cos-layout.env file and that could introduce empty items In the lists that we need to go over, which causes bad stuff.
No description provided by the author
CommandWithPath runs a command adding the usual PATH to environment Useful under UKI as there is nothing setting the PATH.
Copy copies src to dst like the cp command.
CreateIfNotExists will check if a path exists and create it if needed.
DisableImmucore identifies if we need to be disabled We disable if we boot from CD, netboot, squashfs recovery or have the rd.cos.disable stanza in cmdline.
DiskFSType will return the FS type for a given disk Does NOT need to be mounted Needs full path so either /dev/sda1 or /dev/disk/by-{label,uuid}/{label,uuid} .
No description provided by the author
Fsck will run fsck over the device options are set on cmdline, but they are for systemd-fsck, so we need to interpret ourselves.
GetHostProcCmdline returns the path to /proc/cmdline Mainly used to override the cmdline during testing.
GetOemLabel will ge the oem label to mount, first from the cmdline and if that fails, from the runtime This way users can override the oem label.
GetOemTimeout parses the cmdline to get the oem timeout to use.
GetOverlayBase parses the cdmline and gets the overlay config Format is rd.cos.overlay=tmpfs:20% or rd.cos.overlay=LABEL=$LABEL or rd.cos.overlay=UUID=$UUID Notice that this can be later override by the config coming from cos-layout.env .
GetRootDir returns the proper dir to mount all the stuff Useful if we want to move to a no-pivot boot.
GetState returns the disk-by-label of the state partition to mount This is only valid for either active/passive or normal recovery.
GetTarget gets the target image and device to mount in /sysroot.
IsMounted lets us know if the given device is currently mounted.
No description provided by the author
Mount will mount the given source to the target with the given fstype and flags.
MountBasic will mount /proc and /run For now proc is needed to read the cmdline fully in uki mode in normal modes this should already be done by the initramfs process, so we can skip this.
MountToFstab transforms a mount.Mount into a fstab.Mount so we can transform existing mounts into the fstab format.
No description provided by the author
No description provided by the author
ParseMount will return a proper full disk path based on UUID or LABEL given input: LABEL=FOO:/mount output: /dev/disk...:/mount .
PCRExtend extends the given pcr with the give data.
PrepareCommandWithPath prepares a cmd with the proper env For running under yip.
ReadCMDLineArg will return the pair of arg=value for a given arg if it was passed on the cmdline TODO: Split this into GetBool and GetValue to return decent defaults.
ReadEnv will read an env file (key=value) and return a nice map.
RebootOrWait will reboot the system or wait forever.
RootRW tells us if the mode to mount root.
No description provided by the author
No description provided by the author
Force flushing the data to disk.
SyncState will rsync source into destination.
UniqueSlice removes duplicated entries from a slice.So dumb.
UpgradeKcryptPartitions will try check for the uuid of the persistent partition and upgrade its uuid.

# Variables

No description provided by the author

# Structs

Chroot represents the struct that will allow us to run commands inside a given chroot.
ImmucoreConsole is the console for yip.
MiddleLog implements the bridge between zerolog and the logger.Interface that yip needs.