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

48 Commits

Author SHA1 Message Date
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
Colin Walters
6792973b6c 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
2023-08-22 09:24:27 -04:00
Colin Walters
49fbb936a0 build: use new tier = 2 from cargo-vendor-filterer
This is nicer than having a hardcoded list.
2023-05-23 16:05:55 -04: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
Colin Walters
3ab28788ce Initial code split from https://github.com/ostreedev/ostree-rs-ext/pull/412
Prep for potentially moving to github.com/containers/bootc
2022-11-30 15:14:04 -05:00
Colin Walters
49b51fc6e3 Cargo.toml: Add build tweaks from rpm-ostree
For the same reasons.
2021-11-09 14:45:58 -05:00
Colin Walters
9d953ec62e container: Use skopeo to fetch images
Closes: https://github.com/ostreedev/ostree-rs-ext/issues/6

We want to honor things like mirroring set up in `/etc/containers` and ideally
things like signature verification too.  Plus we need to support the Docker
registry API, not pure OCI.

So depending on `oci-distribution` isn't a viable plan from that perspective.

We're not a Go project, so depending on github.com/containers/image directly
is out, plus even if we were vendoring all that is just a bad idea.  So
let's use skopeo as a subprocess.

I originally wrote this to use skopeo via a pipe like:
`skopeo copy docker://quay.io/exampleos/exampleos oci-archive:///proc/self/fd/5`
where fd `5` is a pipe, but the first blocker is that containers/image barfs
if the destination is a pipe.

But even more importantly, the `oci-archive://` backend just
spools everything to a temporary directory and then tars it
back up, entirely obviating the point of streaming.

So here we do the tempdir dance ourself for now.
2021-04-26 11:42:09 -04:00
Colin Walters
553408d141 Update to ostree v2021.2/0.11, use new writing APIs
This is a lot more efficient; before we were creating a thread
per object, etc.
2021-04-15 16:44:01 -04:00
Colin Walters
e011ce2920 Re-merge https://github.com/cgwalters/ostree-container
I just split them out, but I think there's a decent argument
for keeping them together.  We'd likely just want the container
bits under a feature flag.

TODO:

 - feature flag
 - CLI `ostree-ext-cli container import|export`
2021-04-06 14:55:59 +00:00
Colin Walters
ad2f5c69a8 Update to merged ostree-rs git 2021-04-04 13:38:15 +00:00
Colin Walters
d0289847a0 Fix tests, clean up imports 2021-04-03 21:03:28 +00:00
Colin Walters
66f6298d52 Initial code split from https://github.com/cgwalters/ostree-container
The core tar import/export is independent of OCI bits.
2021-04-03 20:48:33 +00:00