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

61 Commits

Author SHA1 Message Date
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
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
Colin Walters
2c32a334bb build-sys: Add BOOTC_extra_src for local dependency development
Add support for bind-mounting an extra source directory into container
builds, primarily for developing against a local composefs-rs checkout.

Usage:
  BOOTC_extra_src=$HOME/src/composefs-rs just build

The directory is mounted at /run/extra-src inside the container. When
using this, also patch Cargo.toml to use path dependencies pointing to
/run/extra-src/crates/....

Signed-off-by: Colin Walters <walters@verbum.org>

Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-21 19:15:05 -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
Colin Walters
760bfcaf7d Cargo.toml: Cross-reference composefs-rs crates with docs
Add a comment noting that changes to the composefs-rs crate list should
also update the documentation files that reference them.

Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-08 22:44:10 +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
5daa432cc5 Bump composefs-rs
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-10-28 13:37:27 -04: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
Pragyan Poudyal
45b06687f2 Bump composefs-rs
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-09-09 10:44:39 +05:30
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
gursewak1997
bf74ecbcc3 Add systemd structured logging for bootc state changes 2025-08-29 12:33:18 -07:00
Johan-Liebert1
fbf25c4dad Bump composefs-rs 2025-08-28 15:11:31 +05:30
Johan-Liebert1
1d194cd67e Bump composefs-fs
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
2025-08-13 11:48:49 +02:00
Colin Walters
87e8ac64b9 build-sys: Reorganize crate listings
Split `dependencies` into three sections:
- Internal deps (crates in the same workspace)
- Workspace deps
- Deps only used by that sub-crate

Also make everything alphabetical.

Assisted-by: Claude Code
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-08 10:16:51 -04:00
Colin Walters
2a4bfc8e7f build-sys: Move all common deps to workspace
General cleanup.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-08 10:16:51 -04:00
Robert Sturla
a64ba5a574 chore(deps): upgrade incompatible versions, resolve breaking changes
Signed-off-by: Robert Sturla <robertsturla@outlook.com>
2025-08-08 14:01:57 +01:00
Colin Walters
88dd96379f build-sys: Move composefs imports to workspace
Signed-off-by: Colin Walters <walters@verbum.org>
2025-07-31 16:09:17 -04:00
Colin Walters
2f69a16074 Move all crates under crates/
Just organizational cleanup, a number of Rust projects
do this:
https://github.com/search?q=+%22crates%2F*%22+path%3ACargo.toml+-is%3Afork&type=code&p=5

Signed-off-by: Colin Walters <walters@verbum.org>
2025-07-17 16:27:39 -04:00
Colin Walters
ae86fbdc81 Bump composefs-rs and use-libc for rustix
- Bump composefs so we build on s390x and ppc64le
- use-libc for rustix so we will always work the same across
  every platform
2025-07-15 15:35:56 -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
Etienne Champetier
80deb0e48c lib,ostree-ext: use canon-json
Replace all serde_json::to_{string,vec,writer} with
equivalent canon_json::CanonJsonSerialize to make the
output stable / reproducible.

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
2025-06-24 08:04:56 -04:00
Colin Walters
856e480cb7 cli: Don't emit ANSI codes to stderr
It seems the tracing crate is broken in this respect. Digging
through best practices, `anstream` is used by clap and looks sane.
We're basically just following their example.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-05-29 14:54:13 -04:00
Colin Walters
0b8fad6464 Split mount code into separate helper crate
Prep for using this elsewhere via git dependency, like we're
doing now with bootupd for example.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-04-27 13:31:33 -04:00
Joseph Marrero Corchado
e7402abe21 build(deps): bump openssl to 0.10.72 2025-04-07 15:49:34 -04:00
Colin Walters
8d97dddb14 Update to rustix 1.0
No major changes required; we get to drop one `unsafe` call
which is nice!

Looks like the ecosystem overall will need a fair bit of porting
before we can drop the 0.38 version though.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-03-30 16:57:50 +00:00
Colin Walters
120db64abc sysusers: New stub crate
Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-14 10:49:23 -05:00
Colin Walters
3f48f548d9 tmpfiles: New crate
This adapts code rewritten from rpm-ostree to synthesize
tmpfiles.d entries.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-12 18:56:27 -05:00
Omer Tuchfeld
0460c4df1d cli: add system-reinstall-bootc binary
# Background

The current usage instructions for bootc involve a long podman
invocation.

# Issue

It's hard to remember and type the long podman invocation, making the
usage of bootc difficult for users.

See https://issues.redhat.com/browse/BIFROST-610 and https://issues.redhat.com/browse/BIFROST-611

(Epic https://issues.redhat.com/browse/BIFROST-594)

# Solution

We want to make the usage of bootc easier by providing a new Fedora/RHEL
subpackage that includes a new binary `system-reinstall-bootc`. This binary
will simplify the usage of bootc by providing a simple command line
interface (configured either through CLI flags or a configuration file)
with an interactive prompt that allows users to reinstall the current
system using bootc.

The commandline will handle helping the user choose SSH keys / users,
warn the user about the destructive nature of the operation, and
eventually report issues they might run into in the various clouds (e.g.
missing cloud agent on the target image)

# Implementation

Added new system-reinstall-bootc crate that outputs the new
system-reinstall-bootc binary. This new crate depends on the existing utils crate.

Refactored the tracing initialization from the bootc binary into the
utils crate so that it can be reused by the new crate.

The new CLI can either be configured through commandline flags or
through a configuration file in a path set by the environment variable
`BOOTC_REINSTALL_CONFIG`.

The configuration file is a YAML file.

# Limitations

Only root SSH keys are supported. The multi user selection TUI is
implemented, but if you choose anything other than root you will get an
error.

# TODO

Missing docs, missing functionality. Everything is in alpha stage. User
choice / SSH keys / prompt disabling should also eventually be supported
to be configured through commandline arguments or the configuration
file.

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2025-02-06 01:50:04 +01:00
Colin Walters
fa4c2b50dd Rename internal blockdev crate to bootc-blockdev
To make a bit clearer this is an internal-to-bootc thing; but also
because other projects like bootupd may start referencing it.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-01-24 13:14:53 -05:00
Colin Walters
61153715a1 build-sys: Split workspace members to multiple lines
To lessen the chance of future conflicts when changing things here.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-01-24 13:14:53 -05:00
Colin Walters
4f3e556070 Split off a blockdev internal crate
This code has been forked between bootupd and coreos-installer
and here. This is prep for having bootupd pull it from bootc's
git so we can deduplicate.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-01-22 08:21:00 -05:00
Colin Walters
44b8d25d2a build-sys: Add made up binary-dependencies key
This would be a nice thing to try to standardize, but let's just
keep track of this and use it in our CI install flow too. This
helps us be cross distribution a bit more.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-01-03 14:44:52 -05:00
Antheas Kapenekakis
cad773d072 feat: add thin build profile
Signed-off-by: Antheas Kapenekakis <git@antheas.dev>
2024-12-02 17:48:40 -05:00
Colin Walters
dfa2c796d7 clippy: Deny str::len
When I was working on some column printing code
with Unicode I got bit by using `str::len`...and
digging in I found that clippy actually just
merged a lint to go the *other* way; more in
the link in the code.

Turning on a lint showed one place that should
have been using `chars().count()` and one that
should have been validating ASCII. Fix those.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-11-19 21:31:30 +00:00
Colin Walters
b32fdf564f Add support for --replace-mode=alongside for ostree target
Ironically our support for `--replace-mode=alongside` breaks
when we're targeting an already extant ostree host, because when
we first blow away the `/boot` directory, this means the ostree
stack loses its knowledge that we're in a booted deployment,
and will attempt to GC it...

8fa019bfa8
is a key part of the fix for that.

However, a notable improvement we can do here is to grow this
whole thing into a real "factory reset" mode, and this will
be a compelling answer to
https://github.com/coreos/fedora-coreos-tracker/issues/399

To implement this though we need to support configuring the
stateroot and not just hardcode `default`.

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-11-18 03:37:32 +01:00
Colin Walters
7359e6975e Move more dependencies to workspace
There's a lot shared between bootc and ostree-rs-ext.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-11-07 13:55:38 -05:00
Colin Walters
23a54d9668 Merge remote-tracking branch 'ostree-rs-ext/main' into merge-ostree-rs-ext
Signed-off-by: Colin Walters <walters@verbum.org>
2024-11-06 18:26:35 -05:00
Colin Walters
97692bd1c2 Make lints stricter, apply crate wide
Add `dead_code = "deny"` to our default lints; we had
a compiler warning for this in main.

Fix the warning by moving the human readable test code into
`#[cfg(test)]`.

While we're here, move the other lib.rs lints into the crate;
enforcing docs for *everything* at first I thought might be heavy
handed but actually is fine as it only applies to things that
are `pub`, of which we don't actually have that much so it
mainly forced me to add some stub docs for the modules, which
is probably a good idea.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-09-18 13:10:49 -04:00
Colin Walters
f8f434a864 build-sys: Add rustix to workspace deps
Just sharing more.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-08-15 14:46:55 -04:00
Colin Walters
c3bff5ee9f build-sys: Move a few dev-deps to workspace deps
Just to increase sharing.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-08-15 14:46:55 -04:00
John Eckersberg
f1e6abfb32 build: move needless_borrow lint allows to be global
A new instance of this snuck in under xtask, this will make sure it's
covered everywhere going forward.

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2024-07-24 12:18:56 -04:00
Colin Walters
63bcf63868 build: Use workspace global lints
In relatively recent rust there's a nice way to globally
configure clippy lints for the whole workspace. We can
kill the `custom-lints` target because relatively
recently clippy has a lint for `todo!` and `dbg!` itself.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-07-17 13:48:12 -04:00
Colin Walters
c67b9acb2f build-sys: Switch to workspace dependencies
Prep for addding another crate, where I want to avoid
duplicating all the versions again.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-07-16 13:41:03 -04:00
Colin Walters
65136e03e5 Move install tests shell script into Rust
A few things going on here:

- Rewrite logic from shell script into Rust (using xshell, so
  it's still convenient to fork commands)
- Make the test logic take an externally-built container image
  instead of using a `-v bootc:/usr/bin/bootc` bind mount
- Build the container image using our stock hack/Containerfile
  in Github Actions instead of building for c9s in GHA
- This all hence starts to make the logic reusable outside
  of Github Actions too; the container build is a known standard thing.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-05-19 17:58:17 -04:00
Colin Walters
95eadab138 Deps: Bump to latest kube/k8s-openapi
On general principle; they trimmed their supported version set
which reduces dep size.  But it also drops out some old things like
`base64@0.13.1` (how many times does a base64 library really need
to break semver?).

Signed-off-by: Colin Walters <walters@verbum.org>
2023-09-29 17:09:39 -04:00
Colin Walters
b5e642e904 build-sys: Trim k8s-openapi some
This drops ~40M uncompressed from the vendor set.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-09-26 10:31:27 -04:00
Colin Walters
267c8ecc19 build-sys: Opt in to resolver = 2
This silences a warning from newer Rust.

Signed-off-by: Colin Walters <walters@verbum.org>
2023-08-29 18:02:17 -04:00
Colin Walters
a3e32ab232 build-sys: Set resolver = 2, ci: passthrough internal-testing-api
There's a warning in newer Rust 1.72 about this, we do want the v2
resolver.

And adjust our build/CI configuration to explicitly enable
`internal-testing-api` when building our binary in CI.
2023-08-28 15:26:59 -04:00
Colin Walters
2f8c2b1152 Cargo.toml: Update release profile, add releaselto
- `release` should use `panic=abort` by default because we make
  heavy use of FFI and this is safest, and I don't think we need
  unwinding anyways
- The `releaselto` produces smallest binaries

Signed-off-by: Colin Walters <walters@verbum.org>
2023-08-22 21:21:35 -04:00