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

168 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
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
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
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
207b7f0abf Bump to newer ocidir and containers-image-proxy
Mostly just keeping up with things, but this is also prep
for us using `GetRawBlob`.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-06-17 10:27:42 -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
ckyrouac
72c3c74c9e reinstall: Initial set of system-reinstall-bootc integration tests
This adds a few basic integration tests for system-reinstall-bootc, adds
a system-reinstall option to tests-integration to run them, and executes
them as part of the github action.

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-06-05 10:27:48 -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
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
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
Colin Walters
3d93701f5a Merge pull request #1299 from ckyrouac/reinstall-mount-warning
Reinstall mount warning
2025-05-14 17:47:25 -04:00
ckyrouac
118dcedf22 reinstall: Add warnings about mounts
This uses findmnt to locate filesystem mounts that are on the same
source as the root mount. If any are found, the user is warned these
filesystems will persist unmounted in the bootc system. The user must
hit <enter> to proceed.

This does the same for logical volumes in the same group as root.

It also adds a generic warning to help the user understand what will
happen after rebooting into the bootc system.

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-05-14 14:25:06 -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
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
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
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
Colin Walters
3cb7e09200 Port from once_cell to std
No major reason, just a drive by thing after discussion of
once_cell in composefs-rs.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-04-24 12:00:08 -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
Colin Walters
f465f1c678 Merge pull request #1268 from ckyrouac/reinstall-prompt-tweaks
Reinstall prompt tweaks
2025-04-12 10:17:34 -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
ckyrouac
1137169190 reinstall: Print reboot message after install completes
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-04-11 15:28:20 -04:00
Joseph Marrero Corchado
e7402abe21 build(deps): bump openssl to 0.10.72 2025-04-07 15:49:34 -04:00
Colin Walters
efb64612d0 Update to use walk from cap-std-ext
We have a few code paths which are doing a recursive filesystem
walk and it's much easier with an API like this, especially
when one wants to keep track of the full relative path.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-04-01 18:57:42 +00: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
ff952c3c3d install: Honor composefs.enabled=verity
Key off the ostree prepare-root config to require fsverity
on all objects.

As part of this:

- Add a dependency on composefs-rs just for the fsverity querying
  APIs, and as prep for further integration.
- Add `bootc internals fsck`, which verifies the expected
  fsverity state.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-03-16 10:25:16 -04:00
Colin Walters
6f1bb750e6 Release 1.1.6
A fair numebr of fixes and smaller features here.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-03-03 08:27:10 -05:00
Platform Engineering Bot
89c89d61c7 fix(deps): update auto merged updates (#1161)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-03-03 08:19:50 -05:00
ckyrouac
8a5f5e24a1 reinstall: Use indoc to format prompts
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-02-27 14:21:53 -05:00
ckyrouac
865cc8468a reinstall: Use openssh-keys crate to parse authorized_keys
This provides stricter parsing (e.g. fails when the authorized_keys file
contains invalid content), and is groundwork for removing the command
field from keys.

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-02-27 13:12:43 -05:00
ckyrouac
870da95782 reinstall: Enable ssh keys for all users
Prior to this, the prompt to select users other that root would result
in an error. Now, all ssh keys will be gathered into a single file
and passed to bootc install to-existing-root --root-ssh-authorized-keys.

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-02-27 10:54:18 -05:00
Platform Engineering Bot
b088833e7f fix(deps): update auto merged updates (#1118)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-02-25 01:24:02 +00:00
Colin Walters
41546ab808 lint: Add a sysusers lint
This is not exhaustive yet, but catches things that invoke
`useradd` (whether a dpkg/rpm `%post` or just a plain `RUN useradd` in a container)
that don't have a sysusers.d entry.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-14 10:49:23 -05:00
Colin Walters
7bb408dc95 sysusers: Import nameservice code from rpm-ostree
This imports the code from
https://github.com/coreos/rpm-ostree/tree/main/rust/src/nameservice
as of commit
e1d43ae9e8

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-14 10:49:23 -05: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
47abf414bf utils: Add PathQuotedDisplay
There's probably an equivalent of this somewhere in a crate, but
basically dealing with `&Path` and printing it is annoying because
we always end up with quotes around a path, even if it's UTF-8
without any spaces.

This takes a Path and displays it in a way that will be parsable
by a shell, and takes care not to emit quotes in the simple case
where a path has no shell metacharacters, just `/`, `.` and
alphanumerics.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-14 10:49:23 -05:00
Colin Walters
ae6b39f38d lints: Add var-tmpfiles
This checks for content in `/var` that is missing systemd tmpfiles.d
entries.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-12 18:56:27 -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
Colin Walters
c34b5e5e83 Merge pull request #1108 from cgwalters/misc-prep
A few misc prep patches
2025-02-12 15:01:18 -05:00
Colin Walters
0205e928b8 Update cap-std-ext, use new open_dir_noxdev API
I moved the code there; I plan to use open_dir_noxdev in
the tmpfiles code too which can't depend on lib/util.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-12 11:16:06 -05:00
Omer Tuchfeld
d707b57119 reinstall: Ensure podman is installed
Fixes #1104

Make the podman dependency of system-reinstall-bootc optional

* Change the spec file to recommend podman instead of requiring it (this
  will make it more palatable to have this package included in distros
  by default)

* Now that podman is only recommended, the system-reinstall-bootc binary
  must check whether podman is installed and try to install it. This is
  done by launching the install-podman script that is included with the
  system-reinstall-bootc RPM. The exact location where
  system-reinstall-bootc will look for this script is defined in the
  build environment variable `SYSTEM_REINSTALL_BOOTC_INSTALL_PODMAN_PATH`

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2025-02-12 13:50:55 +01:00
Colin Walters
ba1c218a23 Release 1.1.5
Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-10 11:22:23 -05:00
Platform Engineering Bot
c065104db8 fix(deps): update auto merged updates (#1097)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-02-10 11:19:08 -05:00
Colin Walters
3db492fa25 lints: Rework to use linkme
Two goals:

- The global static LINTS array is a conflict point
- It's easier to lay out the lint info when it's next to each
  function; prep for extending the lint data more.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-07 09:18:37 -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
Omer Tuchfeld
104f919792 cli: remove clap dependency
The CLI crate does not use clap directly, so it does not need to
depend on it.

It does use it indirectly, through the our lib crate

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2025-02-06 01:49:29 +01:00
Omer Tuchfeld
3425e9bdb2 cli: add a utility function for initializing tracing
Refactor the tracing initialization code into a utility function, so
that it can be shared with future CLIs that we'll add.

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2025-02-06 01:49:09 +01:00
Colin Walters
ffc48c6a8f Update to ostree-rs 0.20
Notably this drops out several duplicate crates.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 12:37:37 -05:00
Colin Walters
63f49d325c Merge pull request #1068 from cgwalters/install-config-verity-prep
Install config verity prep
2025-02-03 10:29:40 -05:00