Skip to main content

bootc_lib/
composefs_consts.rs

1/// Directory to store transient state, such as staged deployemnts etc
2pub(crate) const COMPOSEFS_TRANSIENT_STATE_DIR: &str = "/run/composefs";
3/// File created in /run/composefs to record a staged-deployment
4pub(crate) const COMPOSEFS_STAGED_DEPLOYMENT_FNAME: &str = "staged-deployment";
5
6/// Absolute path to composefs-backend state directory
7pub(crate) const STATE_DIR_ABS: &str = "/sysroot/state/deploy";
8/// Relative path to composefs-backend state directory. Relative to /sysroot
9pub(crate) const STATE_DIR_RELATIVE: &str = "state/deploy";
10pub(crate) const ABOOT_STATE_DIR: &str = "state/boot/aboot";
11pub(crate) const ABOOT_PENDING_FNAME: &str = "pending";
12pub(crate) const ABOOT_ATTEMPTED_FNAME: &str = "attempted";
13pub(crate) const ABOOT_ROLLBACK_FNAME: &str = "rollback";
14pub(crate) const ABOOT_ARTIFACT_DIR: &str = "aboot";
15pub(crate) const ABOOT_IMAGE_FNAME: &str = "aboot.img";
16pub(crate) const ABOOT_VBMETA_FNAME: &str = "vbmeta.img";
17pub(crate) const ABOOT_RECONCILE_SERVICE: &str = "bootc-aboot-reconcile.service";
18/// Relative path to the shared 'var' directory. Relative to /sysroot
19pub(crate) const SHARED_VAR_PATH: &str = "state/os/default/var";
20
21/// Section in .origin file to store boot related metadata
22pub(crate) const ORIGIN_KEY_BOOT: &str = "boot";
23/// Whether the deployment was booted with BLS or UKI
24pub(crate) const ORIGIN_KEY_BOOT_TYPE: &str = "boot_type";
25/// Key to store the SHA256 sum of vmlinuz + initrd for a deployment
26pub(crate) const ORIGIN_KEY_BOOT_DIGEST: &str = "digest";
27
28/// Section in .origin file to store OCI image metadata
29pub(crate) const ORIGIN_KEY_IMAGE: &str = "image";
30/// Key to store the OCI manifest digest (e.g. "sha256:abc...")
31pub(crate) const ORIGIN_KEY_MANIFEST_DIGEST: &str = "manifest_digest";
32
33/// Filename for `loader/entries`
34pub(crate) const BOOT_LOADER_ENTRIES: &str = "entries";
35/// Filename for staged boot loader entries
36pub(crate) const STAGED_BOOT_LOADER_ENTRIES: &str = "entries.staged";
37
38/// Filename for grub user config
39pub(crate) const USER_CFG: &str = "user.cfg";
40/// Filename for staged grub user config
41pub(crate) const USER_CFG_STAGED: &str = "user.cfg.staged";
42
43/// Path to the config files directory for Type1 boot entries
44/// This is relative to the boot/efi directory
45pub(crate) const TYPE1_ENT_PATH: &str = "loader/entries";
46pub(crate) const TYPE1_ENT_PATH_STAGED: &str = "loader/entries.staged";
47
48pub(crate) const BOOTC_FINALIZE_STAGED_SERVICE: &str = "bootc-finalize-staged.service";
49
50/// The prefix for the directories containing kernel + initrd
51pub(crate) const TYPE1_BOOT_DIR_PREFIX: &str = "bootc_composefs-";
52
53/// The prefix for BLS entry config files
54pub(crate) const BLS_ENTRY_FILE_PREFIX: &str = "bootc_";
55
56/// The prefix for names of UKI and UKI Addons
57///
58/// The actual name of a scoped UKI Addon is NOT prefixed,
59/// only its directory name is prefixed
60///
61/// The actual name of a global UKI Addon IS prefixed, since
62/// they all live in ESP/loader/addons
63pub(crate) const UKI_NAME_PREFIX: &str = TYPE1_BOOT_DIR_PREFIX;
64
65/// Prefix for OCI tags owned by bootc in the composefs repository.
66///
67/// Tags are created as `localhost/bootc-<manifest_digest>` to act as GC roots
68/// that keep the manifest, config, and layer splitstreams alive. This is
69/// analogous to how ostree uses `ostree/` refs.
70pub(crate) const BOOTC_TAG_PREFIX: &str = "localhost/bootc-";