1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-05 06:45:13 +01:00

50 Commits

Author SHA1 Message Date
John Eckersberg
534fb40b00 seal-uki: break apart args for comment clarity
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2026-02-03 16:28:53 -05:00
John Eckersberg
5d6dd67276 feat: Add bootc container ukify command
Add a new subcommand that builds a Unified Kernel Image (UKI) by
computing the necessary arguments from a container image and invoking
ukify. This simplifies the sealed image build workflow by having bootc
internally compute:

- The composefs digest (via existing compute-composefs-digest logic)
- Kernel arguments from /usr/lib/bootc/kargs.d/*.toml files
- Paths to kernel, initrd, and os-release

Any additional arguments are passed through to ukify unchanged, allowing
full control over signing, output paths, and other ukify options.

The seal-uki script is updated to use this new command instead of
manually computing these values and invoking ukify directly.

Also adds kargs.d configuration files for the sealed UKI workflow:
- 10-rootfs-rw.toml: Mount root filesystem read-write
- 21-console-hvc0.toml: Console configuration for QEMU/virtio

Closes: #1955

Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2026-01-30 08:49:07 -05:00
renner
f0ef9c52a1 Fix review nits
Signed-off-by: renner <renner0@posteo.de>
2026-01-23 20:48:21 -05:00
renner
601ea642cf Makefile: add elvish and powershell completion
Not packaging those due to the lack of documentation on this.

Signed-off-by: renner <renner0@posteo.de>
2026-01-23 20:48:21 -05:00
renner
5d89520d21 fix: old versions don't have these macros
Signed-off-by: renner <renner0@posteo.de>
2026-01-23 20:48:21 -05:00
renner
1f5813f13c Makefile/rpm: Add shell completions
Signed-off-by: renner <renner0@posteo.de>
2026-01-23 20:48:21 -05:00
Colin Walters
c68e2b4987 packaging: Use bootc container inspect
This is a nicer way to check for the kernel version.

Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-21 19:15:05 -05:00
Colin Walters
4301c89784 build-sys: Rework sealing to be one build step
Now that we're doing a "from scratch" build we don't
have the mtime issue, and so we can change our build system
to do everything in a single step.

Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-21 19:15:05 -05:00
Xiaofeng Wang
f567f7eb8b Fix destructive-cleanup failure when no old packages exist
When rpm -qa returns no packages, xargs would still invoke
rpm -e with no arguments, causing failure with "no packages
given for erase" (exit code 123).

Add -r flag to xargs to skip execution when input is empty.

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2026-01-21 07:15:28 -05:00
Colin Walters
c2de54e3b9 build-sys: Handle aarch64 for systemd-boot
Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-20 19:36:58 -05:00
Colin Walters
204d729682 build-sys: Enable CentOS Stream compose repos to avoid version skew
The base image may be built from a compose that has newer packages
than what's available on the public mirrors. This causes version skew
where packages like bootupd have different versions between the base
image and our built image.

For example, bootupd 0.2.32 changed the EFI file layout from
/usr/lib/bootupd/updates/EFI/ to /usr/lib/efi/, and if we build
with an older bootupd from mirrors while the target image has
the newer layout, bootloader installation fails.

Enable the CentOS Stream compose repos with higher priority to ensure
we get matching versions.

xref https://gitlab.com/redhat/centos-stream/containers/bootc/-/issues/1174

Signed-off-by: Colin Walters <walters@verbum.org>
Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-20 19:36:58 -05:00
Colin Walters
81f0d5a78d build-sys: Various improvements
Pass SOURCE_DATE_EPOCH from git commit timestamp through to rpmbuild,
enabling bit-for-bit reproducible RPM builds. This is useful for
verification and caching.

Then fix the idempotency of the default `just build` to ensure
we're not incorrectly invalidating caches.

Add `just check-buildsys` command that builds packages twice and
verifies checksums match, confirming reproducibility. The CI package
job now uses this to catch regressions.

Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-12-17 10:25:30 -05:00
Colin Walters
6f69534f9b Rework sealed build process
Main goal is to reduce signing logic duplication between the systemd-boot
and UKI generation.

However, this quickly snowballed into wanting to actually verify
by providing a custom secure boot keys to bcvk that things worked.
This depends on https://github.com/bootc-dev/bcvk/pull/170

Now as part of that, I ran into what I think are bugs in pesign;
this cuts things back over to using sbsign. I'll file a tracker for that
separately.

Finally as part of this, just remove the TMT example that builds
a sealed image but doesn't actually verify it works - it's already
drifted from what we do outside here. Ultimately what we need
is to shift some of this into the Fedora examples and we just
fetch it here anyways.

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-12-11 14:43:26 -05:00
Colin Walters
54284f841a ci: Split RPM building into separate job
This splits the RPM package building into a separate CI job that runs
before the integration tests. The built packages are then downloaded
and used by the integration test jobs, avoiding redundant builds.

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-12-08 09:25:29 -05:00
Colin Walters
e747216980 cli: Fix rhsm feature propagation and manpage build order
The rhsm feature was not being propagated from the CLI crate to the
lib crate, causing `bootc internals publish-rhsm-facts` to never be
compiled in even when building with CARGO_FEATURES=rhsm.

I think this was broken when I refactored the build recently.

Change things so we build the manpages before the production
binary, ensuring the production binary always ends up with
the right feature flags.

Fixes: https://issues.redhat.com/browse/RHEL-130799
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-25 16:50:20 -05:00
Colin Walters
e99410d9a4 build-sys: Inject hvc0 by default
In order to debug failures more reliably we really always want a virtual
console.

It turns out the Fedora kernel configs for a while have done
9a0d7ce2af
which means hvc0 is available from very early boot.

I am probably going to argue to do this in all Fedora derivatives by
default soon but let's start here.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-19 15:12:43 -05:00
Colin Walters
fc09d06e73 build-sys: Always install initramfs module
Now that we've cut over to always building + installing via
an (RPM) package in our build system, we need to always install
the dracut module.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-19 09:41:55 -05:00
Colin Walters
d68245d319 Dockerfile: Use rpmbuild
We were bit before by just doing a `COPY` of our binaries overtop of
the base image because that doens't remove old files.

Replace the pre-build approach with rpmbuild, and then change to
do an rpm-based upgrade so that we fix that problem.

Note that we still preserve incremental rebuilds by overriding
some of the RPM build process.

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-19 09:41:55 -05:00
Colin Walters
b8485775d8 build-sys/rpm: Disable unit tests if we detect we're in seccomp
Workaround for https://github.com/rpm-software-management/mock/pull/1613#issuecomment-3421908652

Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-22 09:17:33 -04:00
Colin Walters
c88d87cd35 docs: Add a man page for system-reinstall-bootc
This is an important gap.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-29 09:15:09 -04:00
Colin Walters
443011e129 spec: Provide ostree-ext on rhel9
This landed downstream in 3d4f302c50
but some CI flows build from this spec, so do the change
here too.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-25 15:32:24 -04:00
John Eckersberg
78f3439667 specfile: Handle updated macros in c9s rust-toolset
Closes: #1640
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-09-24 08:19:59 -04:00
Colin Walters
69395c3076 Updates to build sys and CONTRIBUTING.md
The emphasis here is on trying to have
the `Justfile` be the default entrypoint,
wrapping other tools.

- Replace mentions of podman-bootc with bcvk
  since I hope the latter supercedes the former
- Unify the unit test entrypoint
- Set up /var/tmp as a tmpdir to fix the etc merge
  test (otherwise, selinux failures w/tmp)
- Run the unit+container tests in integration.yml
- Have `just validate` run in a container

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-24 07:03:18 -04:00
Colin Walters
d438aaf9ec Switch to hand-written man pages with auto option sync
See the updates to `Justfile` for how to use this.

Closes: #1428

Assisted-By: Claude Code (opus + sonnet)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-12 16:13:49 -04:00
Colin Walters
b86be3df18 packaging/rpm: Be sure we pull in chcon (and util-linux)
We execute it, and Anaconda was somehow omitting this.

Also pull in util-linux-core because we also depend on that.

https://github.com/bootc-dev/bootc/discussions/1383#discussioncomment-13585806
Signed-off-by: Colin Walters <walters@verbum.org>
2025-06-30 13:42:02 -04:00
Colin Walters
7658653aee build-sys: Add a link to rpm-ostree issue
Just to meke it easier to find.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-06-12 06:50:48 +02:00
Etienne Champetier
256361956e specfile: exclude doc directories from package
When we don't install the documentation, rpm still install
empty directories, leading to lint failures.
2025-06-04 09:53:53 -04:00
John Eckersberg
ca7b38f699 Rewrite containers org links to bootc-dev org
Literally just find and replace github.com/containers/bootc with
github.com/bootc-dev/bootc

We have the redirect in place so none of this is really important, but
I figure removing as many instances of the old repo and replacing them
with the current can't hurt for things like search engine
optimization.  Plus some non-zero number of people might assume one is
a fork of the other or something.

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-05-22 09:07:36 -04:00
ckyrouac
85b2419f09 install: Add cleanup option to install to-existing-root
When set, the bootc-destructive-cleanup flag is added to /sysroot/etc
which enables the bootc-destructive-cleanup systemd service to remove
the previous installation's rpm packages and podman containers/images.

The service is only installed on fedora based systems.

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-05-01 18:28:27 -04:00
John Eckersberg
19604b43fc specfile: fix system-reinstall-bootc cargo build invocation
Previously this was just running a "normal" `cargo build` a second
time, and overwriting the rhsm feature flags in the main bootc binary

Resolves: BIFROST-658

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-02-18 18:34:28 -05:00
John Eckersberg
01ce67cf66 specfile: bump version to 1.1.5
TODO: fix packit config to figure this out automatically from git tags

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-02-18 16:38:26 -05:00
Omer Tuchfeld
d707b57119 reinstall: Ensure podman is installed
Fixes #1104

Make the podman dependency of system-reinstall-bootc optional

* Change the spec file to recommend podman instead of requiring it (this
  will make it more palatable to have this package included in distros
  by default)

* Now that podman is only recommended, the system-reinstall-bootc binary
  must check whether podman is installed and try to install it. This is
  done by launching the install-podman script that is included with the
  system-reinstall-bootc RPM. The exact location where
  system-reinstall-bootc will look for this script is defined in the
  build environment variable `SYSTEM_REINSTALL_BOOTC_INSTALL_PODMAN_PATH`

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2025-02-12 13:50:55 +01:00
Omer Tuchfeld
cec66bfe25 spec: rename the bootc-reinstall subpackage
The subpackage name was left to be bootc-reinstall even though we
decided on a name change.

This commit changes the package name to match the binary name which is `system-reinstall-bootc`

# Implementation

By default .spec files will prepend the main package name to the
subpackage name, the `-n` flag of the `%package` directive prevents that
(this is also needed in the %files and %description directives)

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2025-02-07 11:12:15 +01:00
Omer Tuchfeld
e589fe15d7 cli: add RPM package for system-reinstall-bootc
Modified the bootc.spec file to generate a new subpackage which includes
the new system-reinstall-bootc binary.

# Try

Try out instructions:

```bash
# Make srpm
cargo xtask package-srpm

# Mock group
sudo usermod -a -G mock $(whoami)
newgrp mock

# Build RPM for RHEL
mock --rebuild -r rhel+epel-9-x86_64 --rebuild target/bootc-*.src.rpm
```

Then install the RPM (`/var/lib/mock/rhel+epel-9-x86_64/result/bootc-reinstall-2*.el9.x86_64.rpm`) on [a rhel9 gcp vm](https://console.cloud.google.com/compute/instanceTemplates/details/rhel9-dev-1?project=bifrost-devel&authuser=1&inv=1&invt=Abn-jg) instance template

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2025-02-06 01:50:08 +01:00
Colin Walters
58fa21e54f build-sys: Rework vendoring for source archive
In preparation for vendoring composefs-rs from git.
Basically before, things work fine when we're just vendoring
from crates.io, but fall over when we add a git dependency.
The Fedora `cargo_prep` macro writes a hardcoded `.cargo/config.toml`
which only has a replacement for `crates.io`, but we need
the generated replacement for git too which is output by
`cargo vendor-filterer` - which previously we were
discarding.

This was surprisingly difficult!

- Capture the output of `vendor-filterer`
- Work around a bug where it puts a broken `directory` path in
  the generated TOML
- Insert that as a new `vendor-config.toml` in our source
- Do use `cargo_prep` to init the RPM config in the spec,
  but re-inject our vendor config appended to that one.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 09:10:37 -05:00
Yaakov Selkowitz
a115560dcd spec: fix build with rhsm
The Go macros for Fedora, RHEL 10, and ELN (the future RHEL 11) are all in
sync; only RHEL 9 and earlier need the old syntax.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2025-01-16 12:23:02 -05:00
Joseph Marrero Corchado
211598a017 contrib/packaging/bootc.spec: sync with current Fedora rawhide
Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com>
2025-01-14 17:08:46 -05:00
Colin Walters
1ba69d1a2e install: Add /usr/share/doc/bootc/baseimage
This directory will contain expected files in the base image.

That said, I may change the container import path to auto-create
at least the sysroot dir and symlink at some point and these
can just be dropped.

And for that matter after
9a0acd7249
"libostree/deploy: enable composefs by default"
we can likely just drop the prepare-root bit too.

But for now this is needed.

Motivated by improving base image generation from
https://gitlab.com/fedora/bootc/tracker/-/issues/32

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-20 11:13:40 -05:00
Chris Kyrouac
9fa341eb27 boundimages: Switch from bootc-experimental to bootc
This is a stable enough feature to be included in the
primary bootc directory.

Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
2024-07-22 11:08:40 -04:00
Colin Walters
fdf660f48f spec: Add the new bootc-experimental dir
Sadly RPM requires that we explicitly enumerate all the files
we ship.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-07-18 11:05:58 -04:00
John Eckersberg
df9c842bd2 contrib: Add libzstd-devel to specfile
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2024-06-05 13:19:02 -04:00
Colin Walters
d46b072cd2 Add a systemd generator to fixup Anaconda's /etc/fstab
This is a giant and hacky workaround for
https://github.com/ostreedev/ostree/issues/3193

The better real fix is probably in either systemd or anaconda
(more realistically both) but let's paper over things here for now.

Having code to run as a generator will likely be useful in the
future anyways.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-03-22 13:57:27 -04:00
Xiaofeng Wang
3909def9a7 spec: %autorelease can't be resolved by COPR
Fix bootc RPM pakcage name issue like
"bootc-202403011229.g5dde9d8842-%autorelease.x86_64"

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-03-05 22:47:21 +08:00
Colin Walters
169dc549a4 xtask: Fixes for cargo xtask package
The release process has drifted with xtask; I forget exactly
why but I ended up with `.zstd`, not `.zst` in the tarballs
and I've been hand-hacking that manually.

Fix things up so that `cargo xtask package` generates the source
snapshot and the vendor tarball named exactly how we release
them now.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-02-15 10:58:42 -05:00
Colin Walters
55befb8845 Update to ostree-ext 0.13.2
I decided to just do a release anyways, so we don't need to track
git.

This (effectively) reverts commit 79295cedaf.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-02-12 17:57:59 -05:00
Colin Walters
79295cedaf Track ostree-ext git
This way we'll get the updated `/var` handling in our -dev
images for ease of testing.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-02-11 14:23:13 -05:00
Colin Walters
c60a6cc0a9 contrib/packaging: Updates for manpages and systemd unit
The COPR build is failing due to this.
While we're here, also switch to autochangelog/autorelease.

Personally I think spec files upstream makes little sense, but
COPR wants it.  Also for the files section,
it is tempting to copy/paste https://src.fedoraproject.org/rpms/rpm-ostree/blob/rawhide/f/rpm-ostree.spec#_191
here too.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-01-18 10:56:49 -05:00
Colin Walters
7d621270c9 Rework build infra, add manpages into tarball
- Inject pre-generated manpages into the source tarball we make
- Ensure we use the git tag for version if there is one

Immediate motivation is making sure man pages end up in e.g.
RPM builds.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-10-12 15:55:36 -04:00
Colin Walters
3167d6e2e9 spec: Add /usr/lib/bootc to installed files
Sigh, so annoying that RPM makes one allowlist installed files.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-02-28 14:18:13 -05:00
Colin Walters
b274b315c2 Add cargo xtask and packaging infrastructure
First, this adds `cargo xtask` following
https://github.com/matklad/cargo-xtask/

We use this to write "external glue scripts" in Rust, not bash.
Specifically we now have e.g. `cargo xtask vendor` which just
wraps running `cargo vendor-filterer`.

Then build on that and add `cargo xtask package-srpm` which generates
a `.src.rpm`.

And build on that by adding the requisite glue to have Fedora's COPR
be able to understand it, so that we can get auto-built and shipped
packages there.

This will make trying out bootc a bit easier.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-01-19 19:52:55 -05:00