constants

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BiosPartName       = "bios"
	EfiLabel           = "COS_GRUB"
	EfiPartName        = "efi"
	SystemLabel        = "COS_SYSTEM"
	RecoveryLabel      = "COS_RECOVERY"
	RecoveryPartName   = "recovery"
	StateLabel         = "COS_STATE"
	StatePartName      = "state"
	InstallStateFile   = "state.yaml"
	PersistentLabel    = "COS_PERSISTENT"
	PersistentPartName = "persistent"
	OEMLabel           = "COS_OEM"
	OEMPartName        = "oem"
	MountBinary        = "/usr/bin/mount"
	EfiDevice          = "/sys/firmware/efi"
	LinuxFs            = "ext4"
	LinuxImgFs         = "ext2"
	SquashFs           = "squashfs"
	EfiFs              = "vfat"
	Btrfs              = "btrfs"
	BiosFs             = ""
	MinPartSize        = uint(64)
	EfiSize            = MinPartSize
	OEMSize            = MinPartSize
	StateSize          = uint(8192)
	RecoverySize       = uint(4096)
	PersistentSize     = uint(0)
	BiosSize           = uint(1)
	ImgSize            = uint(0)
	ImgOverhead        = uint(256)
	HTTPTimeout        = 60
	GPT                = "gpt"
	BuildImgName       = "elemental"
	OEMPath            = "/oem"
	PersistentPath     = PersistentDir
	ConfigDir          = "/etc/elemental"
	OverlayMode        = "overlay"
	BindMode           = "bind"
	Tmpfs              = "tmpfs"
	Autofs             = "auto"
	Block              = "block"

	// Maxium number of nested symlinks to resolve
	MaxLinkDepth = 4

	// Kernel and initrd paths
	KernelModulesDir = "/lib/modules"
	KernelPath       = "/boot/vmlinuz"
	InitrdPath       = "/boot/initrd"
	ElementalInitrd  = "/boot/elemental.initrd"

	// Bootloader constants
	EntryEFIPath           = "/EFI/ELEMENTAL"
	FallbackEFIPath        = "/EFI/BOOT"
	BootEntryName          = "elemental-shim"
	EfiImgX86              = "bootx64.efi"
	EfiImgArm64            = "bootaa64.efi"
	EfiImgRiscv64          = "bootriscv64.efi"
	GrubCfg                = "grub.cfg"
	BootargsCfg            = "bootargs.cfg"
	GrubCfgPath            = "/etc/elemental"
	GrubOEMEnv             = "grub_oem_env"
	GrubEnv                = "grubenv"
	GrubDefEntry           = "Elemental"
	GrubFallback           = "default_fallback"
	GrubPassiveSnapshots   = "passive_snaps"
	ElementalBootloaderBin = "/usr/lib/elemental/bootloader"

	// Mountpoints of images and partitions
	RunElementalDir    = "/run/elemental"
	RecoveryDir        = "/run/elemental/recovery"
	StateDir           = "/run/elemental/state"
	OEMDir             = "/run/elemental/oem"
	PersistentDir      = "/run/elemental/persistent"
	TransitionDir      = "/run/elemental/transition"
	EfiDir             = "/run/elemental/efi"
	ImgSrcDir          = "/run/elemental/imgsrc"
	WorkingImgDir      = "/run/elemental/workingtree"
	OverlayDir         = "/run/elemental/overlay"
	PersistentStateDir = ".state"
	RunningStateDir    = "/run/initramfs/elemental-state" // TODO: converge this constant with StateDir/RecoveryDir when moving to elemental-rootfs as default rootfs feature.

	// Running mode sentinel files
	ActiveMode   = "/run/elemental/active_mode"
	PassiveMode  = "/run/elemental/passive_mode"
	RecoveryMode = "/run/elemental/recovery_mode"

	// Live image mountpoints
	ISOBaseTree = "/run/rootfsbase"
	LiveDir     = "/run/initramfs/live"

	// Image constants
	ActiveImgName     = "active"
	PassiveImgName    = "passive"
	RecoveryImgName   = "recovery"
	RecoveryImgFile   = "recovery.img"
	BootTransitionDir = "boot-transition"
	BootDir           = "boot"
	OldBootDir        = "boot-old"

	// Yip stages evaluated on reset/upgrade/install/build-disk actions
	AfterInstallChrootHook = "after-install-chroot"
	AfterInstallHook       = "after-install"
	PostInstallHook        = "post-install"
	BeforeInstallHook      = "before-install"
	AfterResetChrootHook   = "after-reset-chroot"
	AfterResetHook         = "after-reset"
	PostResetHook          = "post-reset"
	BeforeResetHook        = "before-reset"
	AfterUpgradeChrootHook = "after-upgrade-chroot"
	AfterUpgradeHook       = "after-upgrade"
	PostUpgradeHook        = "post-upgrade"
	BeforeUpgradeHook      = "before-upgrade"
	AfterDiskChrootHook    = "after-disk-chroot"
	AfterDiskHook          = "after-disk"
	PostDiskHook           = "post-disk"
	BeforeDiskHook         = "before-disk"

	// SELinux targeted policy paths
	SELinuxTargetedPath        = "/etc/selinux/targeted"
	SELinuxTargetedContextFile = SELinuxTargetedPath + "/contexts/files/file_contexts"
	SELinuxTargetedPolicyPath  = SELinuxTargetedPath + "/policy"

	ISORootFile      = "rootfs.squashfs"
	ISOEFIImg        = "uefi.img"
	ISOLabel         = "COS_LIVE"
	ISOCloudInitPath = LiveDir + "/iso-config"

	// Constants related to disk builds
	DiskWorkDir = "build"
	RawType     = "raw"
	AzureType   = "azure"
	GCEType     = "gce"

	// Default directory and file fileModes
	DirPerm        = os.ModeDir | os.ModePerm
	FilePerm       = 0666
	NoWriteDirPerm = 0555 | os.ModeDir
	TempDirPerm    = os.ModePerm | os.ModeSticky | os.ModeDir

	// Eject script
	EjectScript = "#!/bin/sh\n/usr/bin/eject -rmF"

	ArchAmd64   = "amd64"
	Archx86     = "x86_64"
	ArchArm64   = "arm64"
	ArchAarch64 = "aarch64"
	ArchRiscV64 = "riscv64"

	Rsync = "rsync"

	// Snapshotters
	LoopDeviceMaxSnaps        = 2
	BtrfsMaxSnaps             = 4
	LoopDeviceSnapshotterType = "loopdevice"
	BtrfsSnapshotterType      = "btrfs"
	ActiveSnapshot            = "active"

	// Legacy paths
	LegacyImagesPath  = "cOS"
	LegacyPassivePath = LegacyImagesPath + "/passive.img"
	LegacyActivePath  = LegacyImagesPath + "/active.img"
	LegacyStateDir    = "/run/initramfs/cos-state"
	LegacyGrubCfgPath = "/etc/cos"
)

Variables

This section is empty.

Functions

func GetBuildKeyEnvMap

func GetBuildKeyEnvMap() map[string]string

GetBuildKeyEnvMap returns environment variable bindings to BuildConfig data

func GetCloudInitPaths

func GetCloudInitPaths() []string

func GetDefaultGrubModules

func GetDefaultGrubModules() []string

func GetDefaultGrubModulesPatterns

func GetDefaultGrubModulesPatterns() []string

func GetDefaultSquashfsCompressionOptions

func GetDefaultSquashfsCompressionOptions() []string

func GetDefaultSquashfsOptions

func GetDefaultSquashfsOptions() []string

GetDefaultSquashfsOptions returns the default options to use when creating a squashfs

func GetDefaultSystemExcludes

func GetDefaultSystemExcludes(rootDir string) []string

GetDefaultSystemEcludes returns a list of transient paths that are commonly present in an Elemental based running system. Those paths are not needed or wanted in order to replicate the root-tree as they are generated at runtime.

func GetDiskKeyEnvMap

func GetDiskKeyEnvMap() map[string]string

GetDiskKeyEnvMap returns environment variable bindings to RawDisk data

func GetGrubEFIFilePatterns

func GetGrubEFIFilePatterns() []string

func GetISOKeyEnvMap

func GetISOKeyEnvMap() map[string]string

GetISOKeyEnvMap returns environment variable bindings to LiveISO data

func GetInitKeyEnvMap

func GetInitKeyEnvMap() map[string]string

GetInitKeyEnvMap returns environment variable bindings to InitSpec data

func GetInitrdPatterns

func GetInitrdPatterns() []string

func GetInstallKeyEnvMap

func GetInstallKeyEnvMap() map[string]string

GetInstallKeyEnvMap returns environment variable bindings to InstallSpec data

func GetKernelPatterns

func GetKernelPatterns() []string

func GetMokMngrFilePatterns

func GetMokMngrFilePatterns() []string

func GetMountKeyEnvMap

func GetMountKeyEnvMap() map[string]string

GetMountKeyEnvMap returns environment variable bindings to MountSpec data

func GetResetKeyEnvMap

func GetResetKeyEnvMap() map[string]string

GetResetKeyEnvMap returns environment variable bindings to ResetSpec data

func GetRunKeyEnvMap

func GetRunKeyEnvMap() map[string]string

GetRunKeyEnvMap returns environment variable bindings to RunConfig data

func GetShimFilePatterns

func GetShimFilePatterns() []string

func GetUpgradeKeyEnvMap

func GetUpgradeKeyEnvMap() map[string]string

GetUpgradeKeyEnvMap returns environment variable bindings to UpgradeSpec data

func ISOInitrdPath

func ISOInitrdPath(arch string) string

ISOInitrdPath returns path use to store the initramfs

func ISOKernelPath

func ISOKernelPath(arch string) string

ISOKernelPath returns path use to store the kernel

func ISOLoaderPath

func ISOLoaderPath(arch string) string

ISOLoaderPath returns path use to store the boot files

Types

This section is empty.

Jump to

Keyboard shortcuts

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