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

240 Commits

Author SHA1 Message Date
jbtrystram
0a757685ee install/bootupd: chroot to deployment
When `--src-imgref` is passed, the deployed systemd does not match the
running environnement. In this case, let's run bootupd from inside
the deployment. This makes sure we are using the binaries
shipped in the image (and relevant config files such as grub fragements).

We use bwrap to set up the chroot for a easier handling of the API
filesystems.

We could do that in all cases but i kept it behind the `--src-imgref`
option since when using the target container as the buildroot it will
have no impact, and we expect this scenario to be the most common.

In CoreOS we have a specific test that checks if the bootloader was
installed with the `grub2-install` of the image.

Fixes https://github.com/bootc-dev/bootc/issues/1559
Also see https://github.com/bootc-dev/bootc/issues/1455

Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: jbtrystram <jbtrystram@redhat.com>
2026-02-03 11:07:15 -05:00
Colin Walters
4f51a5fbcb Update to latest composefs-rs
To unblock reverse dependency testing.

(We still have the forked cfsctl, that's the only thing)

Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-29 11:37:42 -05:00
bootc-bot[bot]
e499b7700e fix(deps): update rust crate cargo_metadata to 0.23
Signed-off-by: bootc-bot[bot] <225049296+bootc-bot[bot]@users.noreply.github.com>
2026-01-23 22:18:33 -05:00
Colin Walters
1d8cf090f9 lib: Set user agent header for container image pulls
This allows registries to distinguish "image pulls for bootc client
runs" from other skopeo/containers-image users. The user agent will
be in the format "bootc/<version> skopeo/<version>".

All places in bootc that create ImageProxyConfig now use a new helper
function that sets the user_agent_prefix field.

Closes: https://github.com/bootc-dev/bootc/issues/1686
Assisted-by: OpenCode (Sonnet 4)
Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-23 17:44:44 -05:00
Colin Walters
21babe7616 xtask: Add local-rust-deps command for auto-detecting path dependencies
Add `cargo xtask local-rust-deps` which uses `cargo metadata` to find
local path dependencies outside the workspace (e.g., from [patch] sections)
and outputs podman bind mount arguments.

This enables a cleaner workflow for local development against modified
dependencies like composefs-rs:

1. Add a [patch] section to Cargo.toml with real local paths
2. Run `just build` - the Justfile auto-detects and bind-mounts them

Benefits over the previous BOOTC_extra_src approach:
- No manual env var needed
- Paths work for both local `cargo build` and container builds
- No /run/extra-src indirection or Cargo.toml path munging required
- Auto-detection means it Just Works™

The Justfile's build target now calls `cargo xtask local-rust-deps` to
get bind mount args, falling back gracefully if there are no external deps.
The old BOOTC_extra_src mechanism is still supported for backwards compat.

Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-23 14:51:37 -05:00
Colin Walters
efa510a90e Update composefs-rs to merged PR #209
The composefs-rs PR 209 has been merged to main. This updates
bootc to use the containers/composefs-rs repository at the
merge commit.

Key API changes:
- Directory::default() -> Directory::new(Stat::uninitialized())
- read_filesystem() no longer takes stat_root parameter
- New read_container_root() for OCI containers (propagates /usr metadata to root)
- stat_root CLI flag renamed to no_propagate_usr_to_root with inverted logic

See https://github.com/containers/composefs-rs/pull/209

Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-21 19:15:05 -05:00
bootc-bot[bot]
9bb976d540 Release 1.12.1
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-15 19:53:46 -05:00
Colin Walters
49d753f996 various: Update to latest composefs-rs API
Update composefs-rs from rev b636e0e9 to e9008489, adapting to API changes:

- merge_splitstream now takes 4 arguments instead of 3
- import_layer takes digest as string directly
- pull/seal return (digest, verity) as (String, ObjectID)
- SplitStreamWriter::new and write_stream have new signatures
- initialize_composefs_repository returns String instead of Sha256Digest

Co-authored-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
Assisted-by: OpenCode (Claude claude-sonnet-4-20250514)
Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-12 19:52:34 +01:00
Daniele Guarascio
13d5db68aa Update workspace to Rust edition 2024
Migrate all crates from edition 2021 to 2024. This includes
updating Cargo.toml files and fixing code compatibility issues.

The MSRV is bumped to 1.85.0 to support edition 2024.

Note: global_init() requires #[allow(unsafe_code)] for
std::env::set_var which is now unsafe in edition 2024.
This is safe because the function is called early in main()
before any threads are spawned.

Closes: #1414

Signed-off-by: Daniele Guarascio <guarascio.daniele@gmail.com>
2026-01-12 17:38:26 +01:00
Shion Tanaka
d2eb1b69e2 cli: Add shell completion generation command
- Add completion subcommand supporting bash, zsh, and fish

Assisted-by: Cursor (Auto)
Signed-off-by: Shion Tanaka <shtanaka@redhat.com>
2026-01-09 00:11:15 +01:00
Pragyan Poudyal
9f5c491a24 composefs/export: Use ocidir for creating OCI compliant directory
Instead of handling the history,metadata,annotations ourselves, delegate
them to `ocidir` crate. Also take into account the source and target
image references

Finally call `skopeo::copy` to copy to containers-storage

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2026-01-08 14:38:18 +01:00
Pragyan Poudyal
64a82e5794 composefs: Implement bootc image copy-to-storage
Export a composefs repository as an OCI image. In this iteration the
outputted files are in OCI Directory format and are plain TARs, i.e. not
compressed

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2026-01-08 14:38:18 +01:00
bootc-bot[bot]
0ee9b2276d Release 1.12.0
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-06 20:19:44 +01:00
Pragyan Poudyal
bc3d6ec1c9 Bump composefs-rs
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-12-22 16:06:52 +05:30
Pragyan Poudyal
387e9d3114 initramfs: Allow passing target for mounting
`target` field in Args was not being used. Use it if it is passed in the
args. Also helps us mount the new root at `/run/nextroot`

Also, use Cmdline struct instead of String to represent the kernel
command line

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-12-22 16:06:52 +05:30
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
Huijing Hei
64eef42d92 crates/utils: update version to 0.1.0
Signed-off-by: Huijing Hei <hhei@redhat.com>
2025-12-09 08:35:47 -05:00
Huijing Hei
5df230ae6a crates/blockdev: publish new version 0.1.0
Signed-off-by: Huijing Hei <hhei@redhat.com>
2025-12-09 08:35:47 -05:00
bootc-bot[bot]
3f5a3c7291 Release 1.11.0
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-05 13:12:05 -05:00
Michael Vogt
136593a39d tests: add test_bootc_install_config_all integration test
This adds a simple integration test for
```
$ bootc install print-configuration --all
```
in the container tests.

Thanks to Colin for suggesting this.

Signed-off-by: Michael Vogt <michael.vogt@gmail.com>
2025-12-04 20:58:14 -05:00
Colin Walters
de0a9f78c2 tmt: Generate integration.fmf from test code
We need to run most of our tests in a separate provisioned machine,
which means it needs an individual plan. And then we need a test
for that plan. And then we need the *actual test code*.

This "triplication" is a huge annoying pain.

TMT is soooo complicated, yet as far as I can tell it doesn't offer
us any tools to solve this. So we'll do it here, cut over to
generating the TMT stuff from metadata defined in the test file.

Hence adding a test is just:

- Write a new tests/booted/foo.nu
- `cargo xtask update-generated`

Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-25 22:48:37 -05:00
Colin Walters
e0475cd60e initramfs: Mount /sysroot readonly for composefs by default
This implements readonly mounting of /sysroot for composefs systems,
matching the behavior that ostree systems already have. Previously,
composefs left /sysroot mounted read-write, which was inconsistent
and meant the readonly tests had to be skipped for composefs.

The implementation uses a direct `libc::syscall` wrapper for
`mount_setattr` since rustix doesn't yet provide this API. The
`MOUNT_ATTR_RDONLY` flag is applied to three mount
points during initramfs setup:
- The composefs rootfs image mount (becomes `/` after switch-root)
- The test root filesystem mount (used in testing scenarios)
- The sysroot clone mount (becomes `/sysroot` in the booted system)

With this change, the readonly /sysroot tests in test-status.nu
now run for both ostree and composefs systems without conditional
checks.

Assisted-by: Claude Code (Sonnet 4.5)
Co-authored-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-18 23:51:36 -05:00
John Eckersberg
71dc8e52d3 xtask: Fix deprecation warnings with rand 0.9
The rand crate was bumped from 0.8 -> 0.9 in 7804be96

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-11-14 10:42:26 -05:00
John Eckersberg
b01ffa82e0 kernel_cmdline: Add some more derives for Cmdline
Prep so we can parse these directly via clap

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-11-13 15:46:24 -05:00
Colin Walters
d596a3246d rust: cargo update
Renovate is currently failing because of the composefs-rs git
submodule (trying to debug that) so we're behind. At least this
one gets rid of multiple copies of rustix and an old toml version.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-07 15:52:47 -05:00
Colin Walters
f8ce015254 Rework GHA testing: Use bcvk, cover composefs with tmt
Part 1: Use bcvk

For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203

This is a blocker for us doing more testing with UKIs.

In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.

In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.

Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.

Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.

Part 2: Rework the Justfile and Dockerfile

This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.

The readonly tests now pass with composefs.

Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-06 19:32:42 -05:00
Pragyan Poudyal
69b12fa54f tests/integration: Update composefs booted status test
Check for verity inside the json returned by `bootc status --json`
and compare it with the compsefs digest from kernel cmdline

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-06 07:35:34 -05:00
Pragyan Poudyal
5daa432cc5 Bump composefs-rs
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-10-28 13:37:27 -04:00
bootc-bot[bot]
8eae370b03 Release 1.10.0 (#1704)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bootc-bot[bot] <225049296+bootc-bot[bot]@users.noreply.github.com>
2025-10-27 10:32:28 -07:00
Colin Walters
4e04eb95da crates: Add discoverable partition module and parttype APIs
This fleshes out what we had with a more rigorous
binding to the spec.

As part of this though, the ESP constant we had here was uppercase,
but the spec version uses lowercase. Add APIs to find a partition
by type, comparing case insensitively.

Assisted-by: Claude Code
Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-22 16:02:02 -04:00
Colin Walters
f4c678eb88 Various composefs enhancements
- Change the install logic to detect UKIs and automatically
  enable composefs
- Change the install logic to detect absence of bootupd
  and default to installing systemd-boot
- Move sealing bits to the toplevel
- Add Justfile entrypoints
- Add basic end-to-end CI coverage (install + run) using
  our integration tests
- Change lints to ignore `/boot/EFI`

Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-16 14:48:21 -04:00
bootc-bot[bot]
7ad66dbfe3 Release 1.9.0 (#1671)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bootc-bot[bot] <225049296+bootc-bot[bot]@users.noreply.github.com>
2025-10-08 21:29:42 +08:00
John Eckersberg
82ff6770f2 system-reinstall-bootc: Add context annotations to Result-returning functions
Add #[context()] attribute macro to all functions that return Result
to improve error reporting. This includes adding the fn-error-context
dependency and importing the context macro in all relevant modules.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-10-07 18:18:31 -04:00
Alexander Larsson
40ebdd5829 Update ostree binding to 0.20.5
This will be needed by https://github.com/coreos/rpm-ostree/pull/5497
as it picks up ostree-rs via ostree-ext.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2025-10-02 08:34:42 -04:00
Colin Walters
5090f1ddf9 xtask: Add more error context
Since debugging the last failure was painful with just "No such file or directory"

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-18 21:26:00 +02:00
Pragyan Poudyal
8ac9eae698 Add a composefs backend
This adds a new off-by default feature to enable
a new composefs-native backend for bootc. This
is all still a live work in progress, but
we're landing this first tranche of work to help
avoid continual issues with rebasing.

Thanks to everyone who worked on it!

xref https://github.com/bootc-dev/bootc/issues/1190

Co-authored-by: John Eckersberg <jeckersb@redhat.com>
Co-authored-by: Robert Sturla <robertsturla@outlook.com>
Co-authored-by: Colin Walters <walters@verbum.org>
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-09-15 18:19:46 +05:30
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
Pragyan Poudyal
45b06687f2 Bump composefs-rs
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-09-09 10:44:39 +05:30
bootc-bot[bot]
d0a318ccb1 fix(deps): update rust crate dialoguer to 0.12.0
Signed-off-by: bootc-bot[bot] <225049296+bootc-bot[bot]@users.noreply.github.com>
2025-09-08 12:15:34 +00:00
bootc-bot[bot]
e04d5c41af Release 1.8.0
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-09-04 21:31:00 +00:00
Colin Walters
064acf2141 Bump containers-image-proxy, ocidir, oci-spec and composefs-rs
The first three are all entangled because of a messy oci-spec
semver incompatibility
https://github.com/youki-dev/oci-spec-rs/pull/288

Bumping composefs-rs is just to avoid having two versions
of the proxy in the lockfile.

Closes: https://github.com/bootc-dev/bootc/issues/1567

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-04 16:33:01 -04:00
Colin Walters
11f2d30a9e Merge pull request #1485 from Johan-Liebert1/etc-merge
Implementation for /etc merge
2025-09-04 08:35:12 -04:00
Colin Walters
4fb177c33e Deduplicate main error printing
As part of the tracing-subscriber CVE I did a quick audit
for usages of `tracing::error!` and I noticed when
we updated the `main()` function in the primary
crate we missed also doing the same for system-reinstall-bootc.

Move the handling of that to utils.

xref: https://bugzilla.redhat.com/show_bug.cgi?id=2392017
Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-02 18:37:43 -04:00
bootc-actions-token[bot]
df2da1adaf fix(deps): update auto merged updates (#1566)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
Co-authored-by: bootc-actions-token[bot] <225049296+bootc-actions-token[bot]@users.noreply.github.com>
2025-08-30 18:00:50 +00:00
gursewak1997
bf74ecbcc3 Add systemd structured logging for bootc state changes 2025-08-29 12:33:18 -07:00
Pragyan Poudyal
7434b0fb0c Merge pull request #1556 from Johan-Liebert1/composefs-initramfs-error-handling
initramfs: Better error handling
2025-08-29 11:13:51 +05:30
Johan-Liebert1
ccc558c776 etc-merge: Refactor and fix dir perms while merging
While merging, existing directory in new_etc was being recursively
deleted which is not correct as any new files might also be deleted.

Instead, we simply create a directory if it doesn't exists, or if it
does exists, we update its metadata accordingly.

Add some test cases for the above.

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>

cli: Add internal opt for printing etc-diff

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>

etc-merge: Add license to Cargo.toml

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>

etc-merge: More refactoring

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-28 19:01:28 +05:30
Johan-Liebert1
50722fa3d3 initramfs: Better error handling
Add error contexts to functions. Create wrappers around intrenal
functions with error context added

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-28 17:53:31 +05:30
Johan-Liebert1
fbf25c4dad Bump composefs-rs 2025-08-28 15:11:31 +05:30
Johan-Liebert1
dff69a996b etc-merge: Implement merge
Merge added, modified, removed files from the current etc into the new
etc directory, following the rules

1. If file is removed from current_etc, it will be removed from new_etc
2. If file is modified in current_etc, it will be copied to the new_etc
   overwriting any existing files
3. If a file is added in current_etc, then the above modification rule
   applies

Modification includes change in content/permissions. Changed in Xattrs
and/or ownership is not handled yet.

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>

etc-merge: Handle ownership changes

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>

etc-merge: Handle xattrs

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>

etc-merge: Ignore mtime while comparing stat

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>

Remove chown test

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>

etc-merge: Use `llistxattr` and `lgetxattr`

Use the non symlink following counterparts for getting xattrs. Document
public functions and structures

Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-28 09:45:36 +05:30