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

1678 Commits

Author SHA1 Message Date
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
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
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
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
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
leopardracer
458e1f049e Update deploy.rs 2025-06-19 22:27:08 +03:00
gursewak1997
389f6f305d Create /run/reboot-required by default
When staging a new deployment, create /run/reboot-required to signal that
a reboot is needed. This file is monitored by kured (Kubernetes Reboot
Daemon) and other tools to detect when a system needs to be rebooted.

This makes it easier to integrate bootc with kured and similar tools
without requiring manual configuration or bridging.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-06-18 10:47:48 -04:00
John Eckersberg
37f0b6ea8d Release 1.4.0
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-06-16 11:31:52 -04:00
John Eckersberg
b06d75fed7 Merge pull request #1340 from cgwalters/release
Release 1.3.0
2025-05-29 12:14:34 -04:00
Colin Walters
85e2585ca3 Release 1.3.0
Mostly bugfixes here, but a few smaller features.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-05-29 11:10:54 -04:00
Etienne Champetier
9698500302 Move try_deserialize_timestamp to bootc_utils
Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
2025-05-29 08:06:58 -04:00
Colin Walters
31b4ff695e spec: Don't canonicalize containers-storage
Our parser here doesn't handle complex cases that may specify
c/storage options, as used by bootc-image-builder for example.

Closes: https://github.com/bootc-dev/bootc/issues/1308
2025-05-28 08:42:27 -04:00
Colin Walters
51123abdf0 Merge pull request #1324 from cgwalters/lint-truncate
lints: Add --no-truncate flag to bootc container lint
2025-05-27 13:30:52 -04:00
Colin Walters
69d570231e Merge pull request #1328 from cgwalters/silence-selinux
main: Silence SELinux
2025-05-27 11:32:30 -04:00
Colin Walters
7f0e3a56d4 main: Silence SELinux
Like https://github.com/coreos/rpm-ostree/pull/5352

Signed-off-by: Colin Walters <walters@verbum.org>
2025-05-22 19:40:55 -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
Colin Walters
840a2350f6 lints: Add --no-truncate flag to bootc container lint
Useful when running automatic reports and analyses
where all issues need to be visible at once without truncation.

To do this we needed to add a LintExecutionConfig to
propagate configuration through the lint system.

Also, refactor how we print things so there's a
shared helper functions for consistent formatting with and without truncation.

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

Signed-off-by: Colin Walters <walters@verbum.org>
2025-05-17 17:23:07 -04:00
Colin Walters
ee78dbc553 Tweak iterator filtering
Prep for lint truncation improvement.

- Kill the handling of the "max 0" case, it's pathological; this
  requires passing NonZeroUsize
- Drop the requirement for the iterator to be clonable as it
  improves ergonomics, and return a vector of the collected elements
  instead

Signed-off-by: Colin Walters <walters@verbum.org>
2025-05-17 14:26:02 -04:00
Colin Walters
635af16a27 Merge pull request #1322 from cgwalters/sepolicy-filter
Dedup sepolicy handling
2025-05-15 15:46:03 -04:00
Colin Walters
c53f7bfb85 Dedup sepolicy handling
For historical reasons the ostree sepolicy API can exist as a
no-op even if it didn't find a policy, one has to query `.csum()`
or `.name()` to verify it's present.

In our code just map that case to None.

Followup to 99d30dfd55
to ensure we consistently handle this case.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-05-15 14:49:35 -04:00
Robert Sturla
5358fda895 feat(status): display pinned deployments
Part of #904

Displays pinned deployments as part of "bootc status".
Includes unit tests to ensure correct parsing of the
pinned deployments, and that they are displayed in
human readable formats correctly.

Signed-off-by: Robert Sturla <robertsturla@outlook.com>
2025-05-15 18:44:02 +01:00
Colin Walters
5c1cb06408 Merge pull request #1321 from ckyrouac/selinux-storage-fix
install: Fallback to no sepolicy when init imgstore
2025-05-15 12:54:44 -04:00
ckyrouac
99d30dfd55 install: Fallback to no sepolicy when init imgstore
Check for the policy csum to make sure there is actually a policy
available to lookup when trying to label the bootc container storage.

Fixes #1303

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-05-15 12:01:54 -04:00
Colin Walters
d71855d516 spec: Add stateroot
As we head towards factory reset work, this will be of critical
importance.

For now this only shows up in the API, not in human readable
status.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-05-14 21:28:21 -04:00
Colin Walters
3ea65580b8 Release 1.2.0
Signed-off-by: Colin Walters <walters@verbum.org>
2025-05-14 14:08:26 -04:00
Colin Walters
de0eb232b0 spec: Note we don't canonicalize oci
The previous code in trying to parse `oci` was wrong; the syntax
for an `oci` transport is the same as oci-archive, which
includes a file path (and there's no mechanism to quote `:` note).

The canonical logic for all of this stuff is in Go, there's
no canonical Rust library (yet, though I did think about putting
this in oci-spec).

Previous to this attempt to handle tagged+digested, we weren't
parsing image references at all.

First, factor out a `canonicalize_reference` helper since that's
what we're really doing here, it's independent of the *transport*.

Fix the canonicalize function to drop out trying to parse `oci`.

Add a separate test case that incorrectly passes just so it's
a bit more obvious to fix this later.

Note that today at least `skopeo` rejects trying to fetch
via tagged+digested form from an `oci:` so it's fine if
we don't canonicalize here yet, even though it could confuse
someone.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-05-12 07:58:01 -04:00
Robert Sturla
fcfee2ab0c fix(switch): don't attempt to parse non-oci image ref formats
Fixes #1308

Introduced in 10b66fb was a bug where oci-archive and dir image ref formats
were attempted to be parsed, to which an error was returned.  This changes
the behaviour to only attempt to parse image refs from an allowlisted
selection of transports.

Signed-off-by: Robert Sturla <robertsturla@outlook.com>
2025-05-12 11:38:19 +01:00
omahs
4e19c8e1ba docs: fix typos 2025-05-10 09:12:10 +02:00
Colin Walters
001106e8bc Merge pull request #1304 from jmarrero/release-118
Release 1.1.8
2025-05-09 16:10:42 -04:00
Robert Sturla
10b66fbc6c feat(switch): support tag + digest image reference
Closes #1165

Performs tag-stripping when the image reference contains both
a tag and digest. This allows Skopeo to pull the image
successfully, while still displaying both the tag + digest inside
bootc status.

Signed-off-by: Robert Sturla <robertsturla@outlook.com>
2025-05-09 19:06:32 +01:00
Joseph Marrero Corchado
67f8f9c9c5 Release 1.1.8
Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com>
2025-05-09 11:30:05 -04:00
Colin Walters
1c30403e96 install: Do a dynamic mount for /var/tmp
Closes: https://github.com/bootc-dev/bootc/issues/1292

Basically we were doing the `/proc/1/root/var/tmp` trick for
`/var/tmp` because we didn't have the dynamic bind mount infrastructure
before. Now we do, so use it instead.

The specific motivation is that Go in some cases uses `EvalSymlinks`
which gets confused by the `/proc/<pid>/root` magic links.

Also, this deletes a lot of code.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-05-02 08:38:26 -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
Colin Walters
b1fb35c0f4 Merge pull request #1291 from cgwalters/status-bootentry
status: Prep work for https://github.com/bootc-dev/bootc/pull/1285
2025-04-29 10:57:10 -04:00
Colin Walters
44eb304e23 Merge pull request #1288 from cgwalters/mount-crate
Split mount code into separate helper crate
2025-04-29 09:44:59 -04:00
Colin Walters
5a00f3a082 status: Pass entry to render functions
Prep for displaying more information, like pinned state.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-04-28 22:31:55 +00:00
Colin Walters
8c005f5f37 status: Rename human status writer functions
For increased clarity, prep for further changes.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-04-28 22:31:55 +00:00
Colin Walters
50f088bf52 Merge pull request #1287 from cgwalters/drop-ostree-fsck
fsck: Don't run ostree fsck
2025-04-28 13:56:02 -04:00
John Eckersberg
51744584c7 lints: move misplaced docstring for LINT_VAR_RUN
I guess this got misplaced somewhere along the way while reorganizing
the lint code, but I just now noticed it while browsing the code.

Also removed bit about "if it does not exist error", because that's
not accurate with the present behavior of the lint.

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-04-28 12:10:23 -04:00
Colin Walters
5a9b8d69c7 fsck: Don't run ostree fsck
ref https://github.com/bootc-dev/bootc/issues/1216

Signed-off-by: Colin Walters <walters@verbum.org>
2025-04-28 08:54:26 -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
John Eckersberg
596b7409a0 Release 1.1.7
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-04-14 15:42:00 -04:00
Allison Karlitskaya
7eadcb6ed1 various: adapt to new composefs-rs fsverity API
Bump our composefs-rs version and adjust to the API changes there.

Also, add "BSL-1.0" (Boost Software Licence, OSI/FSF approved) to our
allowed licence lists: it's used by xxhash-rust.

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
2025-04-12 11:29:48 +02:00
Colin Walters
0886b20cdc Merge pull request #1264 from ckyrouac/redeploy-bug-fix
Redeploy bug fix
2025-04-11 09:49:58 -04:00
ckyrouac
dbae495cde install: Allow install with existing non-booted stateroot dirs
This modifies the existing check for an extant stateroot dir to check if
the pending stateroot is the same as the booted deployment. Also only
run init_osname if there is not an existing stateroot dir.

fixes #1246

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-04-11 09:12:06 -04:00
Colin Walters
750515053a Merge pull request #1256 from ckyrouac/run-fetch-check
install: Deprecate skip-fetch-check, replace with run-fetch-check
2025-04-10 20:23:58 -04:00
ckyrouac
6648d6c7da imgstore: Fallback to container root sepolicy
Prior to this, get_ensure_imgstore would fail when run from a non-bootc
system. Instead, in an attempt to make this function idempotent, let's
fallback to the container root sepolicy instead of failing. This should
only happen when running cleanup() during a to-existing install (i.e.
there is not yet a bootc system).

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-04-10 13:08:25 -04:00
ckyrouac
44ce2cf2c2 install: Deprecate skip-fetch-check, replace with run-fetch-check
This deprecates skip-fetch-check in favor of the inverse,
run-fetch-check. Updates docs and tests to reflect the change.

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-04-08 14:51:58 -04:00
Colin Walters
67283ac868 lints: Add recursive lint traversal infrastructure
Right now the `utf8` lint does a tree walk. I want
to add more, but it'd be good to avoid walking
the whole filesystem multiple times.

In paticular I wanted to add a check for `ostree.usermeta`
should never be present.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-04-08 13:23:29 -04:00