BOOTC-PACKAGING-AND-INTEGRATION(7)
β¨ NAME β¨
bootc-packaging-and-integration β the whole "how do I package bootc for a distro" situation, explained. it's giving "packaging bible" ngl π
(and yeah bestie, this lives in the Miscellaneous Information Manual, section 7, BOOTC-PA...TEGRATION(7) β the name is truncated in the header but you know her π
)
π DESCRIPTION π
okay so. this doc is literally the entire roadmap for how to build and package bootc so it can ship inside operating systems. if you're a distro packager, this is your moment, main character energy fr fr. πΈ
π¦ Build Requirements
before you can even think about building, you need:
- a Rust toolchain (peep
rust-toolchain.tomlfor the exact version, don't guess π) coreutilsandmake
that's it. that's the list. slay. β¨
π οΈ Basic Build Commands
the main build targets you care about, starting with the big one:
make all
this builds:
- the binary artifacts (
cargo build --release) - the man pages (via
cargo xtask manpages)
and the built binaries land in target/release/:
bootcβ the main bootc CLI, the icon herself πsystem-reinstall-bootcβ the system reinstallation toolbootc-initramfs-setupβ the initramfs setup utility
three binaries, one build, no cap. π₯
π«Ά Installation
the install target supports the standard DESTDIR variable for staged installations β which is essential for packaging, like actually non-negotiable:
make install DESTDIR=/path/to/staging/root
here's everything the install target handles:
- binaries β
$(prefix)/bin - man pages β
$(prefix)/share/man/man{5,8} - systemd units β
$(prefix)/lib/systemd/system - documentation and examples β
$(prefix)/share/doc/bootc - the dracut module β
/usr/lib/dracut/modules.d/51bootc - base image configuration files
not me listing all of that and it being the neatest little install ever π
π« Optional Installation Targets
install-ostree-hooks
for distributions that need bootc to provide compatibility with ostree container commands:
make install-ostree-hooks DESTDIR=/tmp/stage
this creates symbolic links in $(prefix)/libexec/libostree/ext/ for:
ostree-containerostree-ima-signostree-provisional-repair
three lil symlinks, huge impact. π¦
π Source Packaging
Vendored Dependencies
bootc is written in Rust and has numerous dependencies β like, a lot, bestie π. for distribution packaging, the recommendation is to use a vendored tarball of Rust crates, because that gives you:
- reproducible builds
- zero network access during the build process
which is exactly the vibe your build system wants. π
π Generating the Vendor Tarball
use the cargo xtask package command to generate both the source and vendor tarballs:
cargo xtask package
this creates two files in the target/ directory:
bootc-<version>.tar.zstdβ the source tarball withgit archivecontentsbootc-<version>-vendor.tar.zstdβ the vendored Rust dependencies
and! the source tarball includes a .cargo/vendor-config.toml file that configures cargo to use those vendored dependencies. thoughtful queen. π
Using Vendored Dependencies in Builds
when you're building with vendored dependencies, do it in this order:
- extract both tarballs into your build directory
- extract the vendor tarball to create a
vendor/directory - make sure
.cargo/vendor-config.tomlis in place (it's included in the source tarball, so it should just... be there) - build normally with
make all
then the cargo build will automatically use the vendored crates instead of fetching from crates.io. no network, no drama, no crates.io knocking at your door. π§
Version Management
the version is derived from git tags. the cargo xtask package command figures it out automatically:
- if the current commit has a tag β it uses the tag (e.g.,
v1.0.0becomes1.0.0) - otherwise β it generates a timestamp-based version with a commit hash (e.g.,
202501181430.g1234567890)
why tho? because this ensures development snapshots have monotonically increasing version numbers. ascending numbers only, we don't do chaos here. β
π Cargo Features
the build respects the CARGO_FEATURES environment variable. by default, the Makefile auto-detects whether to enable the rhsm (Red Hat Subscription Manager) feature, based on the build environment's /usr/lib/os-release.
to explicitly control features:
make all CARGO_FEATURES="rhsm"
the selinux feature is enabled by default and links against libselinux. distributions that don't use SELinux can build without the default features and add back the others they want β heads up: pre-6.15 is only needed to boot composefs systems on kernels older than 6.15:
make bin CARGO_OPTIONS='--no-default-features --features "install-to-disk pre-6.15"'
β οΈ okay important, listen up: such a build treats SELinux as disabled on the host, whatever the kernel says. it never readsselinuxfs, doesn't try to enter theinstall_tdomain, and doesn't parse SELinux contexts β so it is not suitable for hosts that run SELinux. also note thatlibostreemay still linklibselinuxitself, depending on how it was built, and that the unit test targets (make install-unit-tests) always use the default features. no exceptions bestie π
π§ͺ Integration Testing
for distributions that wanna include integration tests, use:
make install-all DESTDIR=/tmp/stage
this installs:
- everything from
make install - everything from
make install-ostree-hooks - the integration test binary as
bootc-integration-tests
the deluxe combo pack. ate. π₯
πΌοΈ Base image content
alongside building the binary here, you may also want to prepare a base image. for that, see bootc-images (see bootc-compatible-images(7)). β¨
π Additional Resources
- see
Makefilefor all available targets and variables - see
crates/xtask/src/xtask.rsforcargo xtaskimplementation details - see
contrib/packaging/bootc.specfor an example RPM spec file that uses all of the above
like genuinely, that spec file uses all of it. study her. π
π SEE ALSO
bootc(8), bootc-compatible-images(7), bootc-docs(7)
π VERSION
this is v1.17.1, periodt π
and that's the whole page bestie β brought to you by the Miscellaneous Information Manual, that big gorgeous BOOTC-PA...TEGRATION(7) header at the top and the exact same one down at the bottom, cute lil matching bookends π«Άπ ok bye, go ship a distro package, you're doing amazing πβ¨
π¦ 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