constants

package
v2.15.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	GrubConf                     = "/etc/cos/grub.cfg"
	GrubOEMEnv                   = "grub_oem_env"
	GrubDefEntry                 = "Kairos"
	DefaultTty                   = "tty1"
	BiosPartName                 = "bios"
	EfiLabel                     = "COS_GRUB"
	EfiPartName                  = "efi"
	ActiveLabel                  = "COS_ACTIVE"
	PassiveLabel                 = "COS_PASSIVE"
	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"
	EfiSize                      = uint(64)
	OEMSize                      = uint(64)
	PersistentSize               = uint(0)
	BiosSize                     = uint(1)
	ImgSize                      = uint(3072)
	HTTPTimeout                  = 60
	LiveDir                      = "/run/initramfs/live"
	RecoveryDir                  = "/run/cos/recovery"
	StateDir                     = "/run/cos/state"
	OEMDir                       = "/run/cos/oem"
	PersistentDir                = "/run/cos/persistent"
	ActiveDir                    = "/run/cos/active"
	TransitionDir                = "/run/cos/transition"
	EfiDir                       = "/run/cos/efi"
	RecoverySquashFile           = "recovery.squashfs"
	IsoRootFile                  = "rootfs.squashfs"
	ActiveImgFile                = "active.img"
	PassiveImgFile               = "passive.img"
	RecoveryImgFile              = "recovery.img"
	IsoBaseTree                  = "/run/rootfsbase"
	AfterInstallChrootHook       = "after-install-chroot"
	AfterInstallHook             = "after-install"
	BeforeInstallHook            = "before-install"
	AfterResetChrootHook         = "after-reset-chroot"
	AfterResetHook               = "after-reset"
	BeforeResetHook              = "before-reset"
	AfterUpgradeChrootHook       = "after-upgrade-chroot"
	AfterUpgradeHook             = "after-upgrade"
	BeforeUpgradeHook            = "before-upgrade"
	TransitionImgFile            = "transition.img"
	RunningStateDir              = "/run/initramfs/cos-state" // TODO: converge this constant with StateDir/RecoveryDir in dracut module from cos-toolkit
	RunningRecoveryStateDir      = "/run/initramfs/isoscan"   // TODO: converge this constant with StateDir/RecoveryDir in dracut module from cos-toolkit
	FailInstallationFileSentinel = "/run/cos/fail_installation"
	ActiveImgName                = "active"
	PassiveImgName               = "passive"
	RecoveryImgName              = "recovery"
	StateResetImgName            = "statereset"
	GPT                          = "gpt"
	UsrLocalPath                 = "/usr/local"
	OEMPath                      = "/oem"
	BootEntryRecovery            = "recovery"

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

	// Default directory and file fileModes
	DirPerm        = os.ModeDir | os.ModePerm
	FilePerm       = 0666
	ConfigPerm     = 0640 // Used for config files that contain secrets or other sensitive data
	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"
	SignedShim = "shim.efi"
	SignedGrub = "grub.efi"
	Rsync      = "rsync"

	UkiSource         = "/run/install/uki"
	UkiCdromSource    = "/run/initramfs/live"
	UkiEfiDir         = "/efi"
	UkiEfiDiskByLabel = `/dev/disk/by-label/` + EfiLabel
	UkiMaxEntries     = 3

	// Boot labeling
	PassiveBootSuffix    = " (fallback)"
	RecoveryBootSuffix   = " recovery"
	StateResetBootSuffix = " state reset (auto)"

	// Error
	UpgradeNoSourceError = "" /* 174-byte string literal not displayed */
)

Variables

View Source
var DiskUUID = uuid.NewV5(uuid.NamespaceURL, "KAIROS_DISK").String()

DiskUUID is the static UUID for main disk identification

Functions

func BaseBootTitle added in v2.8.0

func BaseBootTitle(title string) string

func BootTitleForRole added in v2.8.0

func BootTitleForRole(role, title string) (string, error)

func GetCloudInitPaths

func GetCloudInitPaths() []string

func GetDefaultSquashfsCompressionOptions

func GetDefaultSquashfsCompressionOptions() []string

func GetDefaultSquashfsOptions

func GetDefaultSquashfsOptions() []string

GetDefaultSquashfsOptions returns the default options to use when creating a squashfs

func GetFallBackEfi

func GetFallBackEfi(arch string) string

func GetGrubFonts

func GetGrubFonts() []string

GetGrubFonts returns the default font files for grub

func GetGrubModules

func GetGrubModules() []string

GetGrubModules returns the default module files for grub

func GetUserConfigDirs added in v2.14.6

func GetUserConfigDirs() []string

GetUserConfigDirs returns all the directories that might have configuration supplied by the user. They are in an order which allows the users to override baked-in configuration (e.g. in livecd, under /run/initramfs/live) with configuration coming from datasource (e.g. a datasource cdrom, written under /oem). That's why writable paths are last.

func GetYipConfigDirs added in v2.14.6

func GetYipConfigDirs() []string

GetYipConfigDirs returns all the directories where "yip" configuration might live. These include the directories were we store our system overlay files: https://github.com/kairos-io/packages/tree/main/packages/static/kairos-overlay-files/files/system/oem

func UkiDefaultMenuEntries added in v2.8.7

func UkiDefaultMenuEntries() []string

func UkiDefaultSkipEntries added in v2.7.6

func UkiDefaultSkipEntries() []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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