feat(installation): allow to abort installation if sentinel file is present

Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
mudler
2024-08-21 09:25:10 +02:00
parent f3601ef61d
commit 75ff3cbdd4
4 changed files with 87 additions and 64 deletions

View File

@@ -23,70 +23,71 @@ import (
)
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
ActiveImgName = "active"
PassiveImgName = "passive"
RecoveryImgName = "recovery"
StateResetImgName = "statereset"
GPT = "gpt"
UsrLocalPath = "/usr/local"
OEMPath = "/oem"
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"
// SELinux targeted policy paths
SELinuxTargetedPath = "/etc/selinux/targeted"