BOOTC-INTERNALS(7)
π¦ bootc-internals β okay bestie, it's internals time
Welcome to BOOTC-INTERNALS(7), from the Miscellaneous Information Manual, no cap. This is the backstage tour, the group chat with the devs π
β¨ NAME β¨
bootc-internals β Internals. That's it, that's the name. Short, iconic, to the point. π
πΈ DESCRIPTION πΈ
This section documents bootc's internal architecture for developers working on the project. Basically: if you're one of the girlies with a text editor open on the bootc repo, this is your page. π
If you're just here to use bootc and not to hack on it? No worries β for user-facing documentation, go look at the rest of this book. This one is the devs-only VIP section. π
π§ Code Architecture π§
π CLI Structure
The bootc binary (crates/cli) is a thin wrapper. Literally thin. It does three things and then hands off, main character energy but make it delegating:
- Performs global initialization (signal handlers, mounting filesystems)
- Creates a tokio async runtime (single-threaded) β‘
- Delegates to
bootc_lib::cli::run_from_iter()
The CLI uses clap ( https://docs.rs/clap ) with derive macros. β¨
Each subcommand typically opens the system storage via store::BootedStorage::new_from_env(), performs the operation, and writes status to stdout or a progress fd. π«Ά
CPU-intensive work is offloaded via tokio::task::spawn_blocking. Bestie said "I am NOT blocking the runtime," and honestly? Correct. π
π Crate Organization
bootc(crates/cli): Thin binary entrypointbootc-lib(crates/lib): Core implementation libraryostree-ext(crates/ostree-ext): OCI/ostree bridging, container import/export- Supporting crates: Focused utilities (mount, blockdev, kernel cmdline, etc.)
Most functionality lives in bootc-lib, making it testable. π The API is internal and not stable for external consumers β so like, do not build your whole personality on it, it WILL change on you. π
π Storage Backends π
β OSTree Backend (stable, default)
Uses ostree ( https://ostreedev.github.io/ostree/ ) for content-addressed storage. Container images are imported via ostree-ext. Deployments use ostree's native mechanism with Boot Loader Specification (BLS) entries.
Key paths:
/sysroot/ostree/repo/- OSTree repository/sysroot/ostree/deploy/<stateroot>/- Deployment directories
Stable. Default. The reliable bestie. π
π¦ Composefs Backend
Uses composefs-rs ( https://github.com/containers/composefs-rs ) directly, enabling native UKI support and sealed images with fsverity integrity. Sealed. Like a letter. With cryptography. π₯
Key paths:
/sysroot/composefs/- Composefs repository (EROFS images)/sysroot/state/deploy/<deployment-id>/- Per-deployment state (deployment-idis the SHA-512 fsverity digest)
Implementation: bootc_composefs module in bootc-lib. π
π Key Modules π
π The Store Module
The store module provides the Storage type abstracting both backends. It lazily initializes β as in, it does NOT do the work until it absolutely has to, and honestly, relatable:
- OSTree sysroot (
ostree::Sysroot) - Composefs repository (
composefs::Repository<Sha512HashValue>) - Container image storage for bound images (
podstorage::CStorage)
π Deploy Module
Handles deployment lifecycle. The whole glow-up arc, start to finish:
- Staging new deployments from container images
- Kernel argument management (
bootc_kargs) - Three-way merge of
/etcconfiguration - Rollback between deployments
π§ Spec Module
Defines core types (see spec module rustdoc: https://bootc.dev/bootc/internals/bootc_lib/spec/index.html). These are ultimately the types that are serialized to bootc status --json and form a key part of the admin experience. So like, when an admin runs that command and goes "oh cute, JSON," this is the module responsible. π
π bootc-owned Container Storage
The podstorage module implements bootc's own containers-storage: instance at /sysroot/ostree/bootc/storage/ (symlinked to /usr/lib/bootc/storage/).
This supports Logically Bound Images (see bootc-logically-bound-images(7)) with proper lifecycle management and garbage collection tied to deployments. GC that knows which deployments are alive, like a bestie who remembers everyone's birthday. π
π Rustdoc API Documentation π
The following rustdoc documentation is generated from the source code with --document-private-items to expose internal APIs. Yes, the private ones. We're all friends here. π«Ά
π Core crates
- bootc-lib (
https://bootc.dev/bootc/internals/bootc_lib/index.html) - Core bootc implementation - bootc (
https://bootc.dev/bootc/internals/bootc/index.html) - CLI frontend
β¨ Supporting crates
- ostree-ext (
https://bootc.dev/bootc/internals/ostree_ext/index.html) - Extension APIs for OSTree - bootc-mount (
https://bootc.dev/bootc/internals/bootc_mount/index.html) - Internal mount utilities - bootc-kernel-cmdline (
https://bootc.dev/bootc/internals/bootc_kernel_cmdline/index.html) - Kernel command line parsing - bootc-initramfs-setup (
https://bootc.dev/bootc/internals/bootc_initramfs_setup/index.html) - Initramfs setup code - etc-merge (
https://bootc.dev/bootc/internals/etc_merge/index.html) -/etcmerge handling
πΈ Utility crates
- bootc-internal-utils (
https://bootc.dev/bootc/internals/bootc_internal_utils/index.html) - Internal utilities - bootc-internal-blockdev (
https://bootc.dev/bootc/internals/bootc_internal_blockdev/index.html) - Block device handling - bootc-sysusers (
https://bootc.dev/bootc/internals/bootc_sysusers/index.html) - systemd-sysusers implementation - bootc-tmpfiles (
https://bootc.dev/bootc/internals/bootc_tmpfiles/index.html) - systemd-tmpfiles implementation
π§ External git crates
These crates are pulled from git and are not published to crates.io (so not on docs.rs). Very mysterious. Very off-grid. π
- composefs-ctl (
https://bootc.dev/bootc/internals/composefs_ctl/index.html) - composefs-rs entrypoint crate (re-exports composefs, composefs-boot, composefs-oci)
π SEE ALSO π
bootc(8), bootc-docs(7), bootc-logically-bound-images(7)
Go read those too, bestie, they're all part of the lore. π
π VERSION π
v1.17.1
and that's a wrap!! π«Ά this was BOOTC-INTERNALS(7) from the Miscellaneous Information Manual, version v1.17.1 β slay, go build something, ily, mwah π β¨
π¦ where this page comes from
- fedora 43: bootc 1.17.1-1.fc43 Β· Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
- fedora 44: bootc 1.17.1-1.fc44 Β· Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms