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

3638 Commits

Author SHA1 Message Date
Colin Walters
d4c19f7d31 tests: Add a suite which runs tests under systemd
And add a single test which verifies that our internal `reboot`
code actually does what it should (via systemd-run etc.)

This took me way, way too long to do...there were so many missteps
and confusion. First of all, I kept trying to use `systemd.extra-unit`
from https://www.freedesktop.org/software/systemd/man/latest/systemd-debug-generator.html#
but that doesn't exist in stream9.

I spent way too long trying to debug the fact that switching from
`podman run <image> /sbin/init` to `podman run <image> /bin/sh -c '<stuff> && exec /sbin/init`
fails because in the latter case podman's auto-detection fails and
we need to explicitly say `--systemd=always`. In retrospect obvious...but oh well.

On the positive side, I think with some cleanup we could extend this model
and generalize it for "test running in a container with systemd" (with
a lot of cleanup really)

Signed-off-by: Colin Walters <walters@verbum.org>
2025-07-18 07:42:05 -04:00
Colin Walters
4e433eddcb Merge pull request #1427 from cgwalters/drop-task
osbuild: Drop use of Task
2025-07-17 20:19:38 -04:00
Colin Walters
b696395744 internals: Add a helper verb to initiate a reboot
This is intended to aid unit testing outside of `upgrade --apply`.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-07-17 19:35:29 -04:00
Colin Walters
dd54f4b7aa osbuild: Drop use of Task
I've come to the conclusion that Task isn't buying us much value
over Command.

I'd like to eventually drop it. This is just getting the ball
rolling.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-07-17 19:20:14 -04:00
Colin Walters
778ec6a095 Merge pull request #1415 from jeckersb/decompressor_finish_on_inner
unencapsulate: use "inner" stream when finishing Decompressor
2025-07-17 19:08:14 -04:00
John Eckersberg
75d5e7106e ostree-ext: Refactor decompression
This moves all of the code related to handling decompression out of
container/unencapsulate.rs and into a new module `generic_decompress`.
The only exposed API is via the existing (relocated) `Decompressor`
type.

Internal to `generic_decompress` this adds a new trait
`ReadWithGetInnerMut`, which allows access to the original, inner,
un-decompressed stream.  This is used when finishing the decompressor,
whether explicitly through calling its `finish()` method, or
implicitly by dropping it.

For things like GzDecoder, we don't want to read via the actual
decompression reader because we don't care about decompressing at this
point.  Plus, the inner reader may have encountered an error partway
through, and trying to decode via decompression will error with
UnexpectedEof.

Instead, wrap a reader for each content type which implements
`ReadWithGetInnerMut`.  When we finish decompressing, use the trait
method `get_inner_mut()` to read directly from inner stream to flush
any data.

Resolves: #1407
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-07-17 18:13:11 -04:00
Colin Walters
0f3d02e240 Merge pull request #1413 from cgwalters/crates-refactor
Move all crates under `crates/`
2025-07-17 17:06:48 -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
883690598e crates: Drop readme =
We don't actually publish any of these so there's no need
for this.
2025-07-17 16:27:39 -04:00
Colin Walters
c2dc021781 Merge pull request #1421 from jlebon/pr/reproducible-pull
Make `ostree container image pull` merge commit reproducible
2025-07-17 16:06:49 -04:00
Colin Walters
3a0c6abd9b Merge pull request #1422 from cgwalters/release
Release 1.5.1
v1.5.1
2025-07-17 14:37:28 -04:00
Colin Walters
00359bf1ca Release 1.5.1 2025-07-17 13:04:02 -04:00
Colin Walters
97e5ca25a9 Merge pull request #1417 from rsturla/systemd-run-message
lib/src/reboot: use valid systemd-run arguments
2025-07-17 13:01:54 -04:00
Jonathan Lebon
d47956a99e ostree-ext/cli: add --digestfile to ostree container image pull
This is something that I've wanted many times. There's no easy way from
e.g. bash to convert an image ref into the escaped OSTree ref and so
it's always awkward to be able to tell what ref/commit was pulled down.

Let's just match podman here and add a `--digestfile` switch for this.
2025-07-17 11:19:03 -04:00
Jonathan Lebon
bcd318f8ae ostree-ext/store: don't include filtered files in metadata
Filtered files are only determined at the time we import a layer.
So if that layer is already imported, we won't have that information
available. That in turn means that the metadata is state-dependent,
which in turn means that the commit digest is not reproducible.

We still want to provide the filtered files warning though. Just make
this information part of the LayeredImageState object instead. The
obvious downside of that is that now we only get that warning the first
time the layer is imported and it's no longer part of the commit object
itself.

One way to make this more sticky is to attach it to the individual
layers' commits instead, and then the merge commit can coalesce them.

Related: https://github.com/bootc-dev/bootc/issues/1346
2025-07-17 10:42:10 -04:00
Robert Sturla
bd6b372371 lib/src/reboot: use valid systemd-run arguments
Signed-off-by: Robert Sturla <robertsturla@outlook.com>
2025-07-17 15:04:00 +01:00
Jonathan Lebon
7bae37fd27 ostree-ext/store: use BTreeMap for merge commit metadata
`HashMap` is unordered which means that the conversion to GVariant
(and thus its serialization) is not reproducible since the conversion
basically just maps to an GVariant array. That in turns means the commit
hash itself is not reproducible.

All we really need to do is just swap it for a `BTreeMap` since all the
types involved here implement ordering.
2025-07-16 23:21:07 -04:00
ckyrouac
b290ad25c7 Release 1.5.0
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
v1.5.0
2025-07-16 13:56:23 -04:00
Colin Walters
f9cb9e4e41 Merge pull request #1409 from cgwalters/use-rustix-libc
Bump composefs-rs and use-libc for rustix
2025-07-15 19:10:16 -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
c8e7a68316 Merge pull request #1405 from rsturla/remove-alias-usage-in-systemd-units
systemd: switch bootc-fetch-apply-updates.service to non-aliased command
2025-07-13 08:24:56 -04:00
Robert Sturla
854a3f16ec chore: switch bootc-fetch-apply-updates.service to non-aliased command
Signed-off-by: Robert Sturla <robertsturla@outlook.com>
2025-07-12 19:27:58 +01:00
Colin Walters
83e93cd1cf Merge pull request #1403 from cgwalters/bump-composefs-rs
Bump composefs-rs
2025-07-11 20:40:53 -04:00
Colin Walters
d75d53934d Bump composefs-rs
Prep for work on the composefs-rs backend.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-07-11 17:17:50 -04:00
Colin Walters
0ac3ef1287 Merge pull request #1397 from ckyrouac/chunking-xattrs
chunking: Support exclusive chunks defined via xattrs
2025-07-11 10:06:50 -04:00
ckyrouac
81b3c270b0 chunking: Support exclusive chunks defined via xattrs
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-07-10 15:16:30 -04:00
Colin Walters
5ed53c30f0 Merge pull request #1399 from jmarrero/verbose-status
lib/src/status: add verbose human readable output
2025-07-09 17:04:47 -04:00
Joseph Marrero Corchado
29066f5cea lib/src/status: add verbose human readable output
Assisted-by: Claude Code
2025-07-09 16:22:59 -04:00
Colin Walters
e7d15d4283 Merge pull request #1398 from jmarrero/reboot
lib/src/reboot: use systemd-run to execute the reboot
2025-07-08 15:03:46 -04:00
Joseph Marrero Corchado
9f566a2e1f lib/src/reboot: use systemd-run to execute the reboot
When we do a reboot it is triggered inside the bootc namespace.
As we implement support for soft-reboots we need to make sure
that systemd has a view into the mounted /run/nextroot
to be able to act on doing a soft-reboot or a reboot.
By using systemd-run we avoid the limited view in the current
namespace.

Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com>
2025-07-08 14:24:28 -04:00
Colin Walters
bb5171b685 Merge pull request #1394 from cgwalters/publish-internals
Rework utils and blockdev crates as -internals in prep for publishing
2025-07-08 11:37:46 -04:00
Joseph Marrero Corchado
a9312153c9 Merge pull request #1393 from cgwalters/auth-expand
secrets: Expand on authfile
2025-07-01 13:47:23 -04:00
Colin Walters
f6a4bada34 Rework utils and blockdev crates as -internals in prep for publishing
See https://github.com/coreos/bootupd/pull/963

Basically I just want a way to keep these in sync with bootupd;
we're not attempting to make a truly public library.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-07-01 08:25:26 -04:00
Colin Walters
204ed0e2f4 Merge pull request #1368 from jeckersb/upstream-meeting-details
README.md: Add details for Friday Zoom meeting
2025-06-30 18:25:58 -04:00
Colin Walters
fe962b983f Merge pull request #1391 from cgwalters/dep-chcon
packaging/rpm: Be sure we pull in chcon (and util-linux)
2025-06-30 17:52:06 -04:00
Colin Walters
86b45a592e secrets: Expand on authfile
- Note the existence of `/run` here
- Describe how to use `podman login --authfile` to write it
- Also describe the pattern of symlinking to keep things in sync
  where desired

Signed-off-by: Colin Walters <walters@verbum.org>
2025-06-30 17:50:56 -04:00
John Eckersberg
2e2c0846cb README.md: Add details for Friday Zoom meeting
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-06-30 16:38:19 -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
0da9609bd0 cli: Drop version to zero; canonical is in lib/
This version is unused. At one time I accidentally bumped it
and then kept doing so occasionally. Fixate it so that doesn't
happen again.

The canonical version is in lib/Cargo.toml.
2025-06-30 13:39:21 -04:00
Colin Walters
79cc6b4c47 Merge pull request #1385 from jeckersb/update-generated
docs: Update generated
2025-06-27 18:18:53 -04:00
John Eckersberg
1b3f1411c3 docs: Update generated
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-06-27 17:35:36 -04:00
John Eckersberg
3c8a681537 xtask: post-process manpages to fix broken apostrophes
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-06-27 17:35:36 -04:00
Colin Walters
3c083cfb85 Merge pull request #1386 from miabbott/update_generated_workflow
ci: periodically run update-generated
2025-06-27 14:24:57 -04:00
Micah Abbott
9e0a0f887b ci: periodically run update-generated
This introduces a GitHub workflow to periodically run `cargo xtask
update-generated` in order to keep the docs up-to-date with the
latest changes. It will create a PR if changes are detected.

Signed-off-by: Micah Abbott <miabbott@redhat.com>
2025-06-26 15:43:53 -04:00
Pragyan Poudyal
b46b1f781e Move state to /state/deploy
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-06-25 14:03:32 +02:00
Sanne Raymaekers
f06a96c00a composefs-boot: support writing insecure composefs cmdline
Supports writing `composefs=?<root-id>`.

Signed-off-by: Sanne Raymaekers <sanne.raymaekers@gmail.com>
2025-06-24 15:13:09 +02:00
Sanne Raymaekers
ae3b538c93 cfsctl: add insecure option
Allows cfsctl operations with fs-verity disabled.

Signed-off-by: Sanne Raymaekers <sanne.raymaekers@gmail.com>
2025-06-24 15:13:09 +02:00
Allison Karlitskaya
3e08695cf8 mount: clean up mount APIs
Change the Repository::mount() API to return the mounted filesystem as
an fd rather than taking the mountpoint as an argument.  Create a new
mount_at() API to replace the old one, replacing the canicalize() and
mount_at() calls that used to be in mount_composefs_at(), which we
remove.

Update the various users.

Making this change lets us simplify the logic in composefs-setup-root:
it no longer has to manually open the image in order to perform the
fsmount operation: it can use the new API on the repository.

This allows us to make Repository::open_image() private, so do that too.

Co-authored-by: Sanne Raymaekers <sanne.raymaekers@gmail.com>
Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
2025-06-24 15:13:09 +02:00
Colin Walters
5c948a5c0a Merge pull request #1347 from champtar/repro2
More reproducibility fixes / switch to canon-json
2025-06-24 08:45:39 -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