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

3024 Commits

Author SHA1 Message Date
Colin Walters
155c5e2d86 Merge pull request #1102 from cgwalters/release
Release 1.1.5
v1.1.5
2025-02-10 12:51:52 -05: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
Omer Tuchfeld
f082d868f9 Merge pull request #1094 from omertuc/setusers
reinstall: avoid duplicate users in `loginctl_users`
2025-02-10 17:18:10 +01:00
Omer Tuchfeld
961c0bf3a3 reinstall: avoid duplicate users in loginctl_users
See https://github.com/containers/bootc/issues/1093

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2025-02-10 13:57:22 +01:00
John Eckersberg
c681850686 Merge pull request #1096 from cgwalters/drop-hostname-resolvconf
store: Clean up broken /etc/hostname and /etc/resolv.conf
2025-02-07 13:47:31 -05:00
Colin Walters
e7736bf111 Merge pull request #1095 from cgwalters/lint-prep4
lints: More cleanup && lints: Check for invalid /etc/hostname and /etc/resolv.conf
2025-02-07 13:14:41 -05:00
Colin Walters
57bd0dc983 store: Clean up broken /etc/hostname and /etc/resolv.conf
We can pretty safely work around this here; zero sized
files for both are useless.

Closes: https://github.com/containers/bootc/issues/1064
Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-07 11:33:12 -05:00
Colin Walters
2ed97d4cf1 lints: Check for invalid /etc/hostname and /etc/resolv.conf
Detect problems from https://github.com/containers/buildah/issues/4242
or similar.

As part of this, add new infrastructure logic for lints that only operate on
non-running roots (we expect these are mounted/written at runtime).

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-07 10:49:27 -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
Colin Walters
c23212ab43 lints: Use enum instead of bool
This is always clearer. Prep for adding another argument to this function
that's an effective bool.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-07 09:17:45 -05:00
Colin Walters
3cadf4a9a3 Merge pull request #1091 from omertuc/loginctl
reinstall: handle loginctl compatibility issues
2025-02-07 07:59:12 -05:00
Omer Tuchfeld
e6a370e506 Merge pull request #1088 from omertuc/name
spec: rename the bootc-reinstall subpackage
2025-02-07 13:52:25 +01:00
Omer Tuchfeld
ac07fb67de reinstall: handle loginctl compatibility issues
Solves https://github.com/containers/bootc/issues/1089

See diff for details.

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2025-02-07 12:52:30 +01:00
Omer Tuchfeld
cec66bfe25 spec: rename the bootc-reinstall subpackage
The subpackage name was left to be bootc-reinstall even though we
decided on a name change.

This commit changes the package name to match the binary name which is `system-reinstall-bootc`

# Implementation

By default .spec files will prepend the main package name to the
subpackage name, the `-n` flag of the `%package` directive prevents that
(this is also needed in the %files and %description directives)

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2025-02-07 11:12:15 +01:00
Colin Walters
69264e0836 Merge pull request #1086 from cgwalters/blockdev-pttype
blockdev: Extend lsblk output with parttype and partuuid
2025-02-06 13:29:05 -05:00
Colin Walters
85f33a98e2 blockdev: Extend lsblk output with parttype and partuuid
We want parttype in general, for the same reason we wanted
it from `sfdisk`. Prep for maybe using this in bootupd
for https://github.com/coreos/bootupd/issues/837

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-06 11:24:38 -05:00
Colin Walters
c8e1fb83fe Merge pull request #1063 from omertuc/reinstallcli
cli: add `system-reinstall-bootc` binary
2025-02-05 21:05:35 -05:00
Omer Tuchfeld
e589fe15d7 cli: add RPM package for system-reinstall-bootc
Modified the bootc.spec file to generate a new subpackage which includes
the new system-reinstall-bootc binary.

# Try

Try out instructions:

```bash
# Make srpm
cargo xtask package-srpm

# Mock group
sudo usermod -a -G mock $(whoami)
newgrp mock

# Build RPM for RHEL
mock --rebuild -r rhel+epel-9-x86_64 --rebuild target/bootc-*.src.rpm
```

Then install the RPM (`/var/lib/mock/rhel+epel-9-x86_64/result/bootc-reinstall-2*.el9.x86_64.rpm`) on [a rhel9 gcp vm](https://console.cloud.google.com/compute/instanceTemplates/details/rhel9-dev-1?project=bifrost-devel&authuser=1&inv=1&invt=Abn-jg) instance template

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2025-02-06 01:50:08 +01: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
2fd0458bb6 cli: align package.metadata.vendor-filter
No reason for it to be different than what we have in the root
Cargo.toml

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2025-02-06 01:49:36 +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
d45864d0a4 Merge pull request #1079 from cgwalters/drop-lint-restriction
lint: Drop ostree-container restriction
2025-02-05 16:46:21 -05:00
Colin Walters
6663e6fe5e Merge pull request #1078 from cgwalters/export-tar-hardlink-fix
tar/export: Fix error with zero-sized hardlinked files
2025-02-05 15:23:09 -05:00
Colin Walters
2bf14d93d5 lint: Drop ostree-container restriction
We now support deploying containers without `sysroot/ostree`, so
drop the requirement for the linter to find that.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-05 09:11:04 -05:00
Colin Walters
0b04cc488c tar/export: Fix error with zero-sized hardlinked files
In the case where we already emitted an object into the tar stream,
we wouldn't previously set the file type and size into the tar
header structure that we passed into the hardlink emission function.
This would cause an error when accessing the (logically) uninitialized `size()`.

Fix the writer function to always set the file type and size unconditionally,
and also rework the consumer side to make the logic even clearer.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-05 09:04:33 -05:00
Colin Walters
4c523b47b4 tar/export: Add error context
Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-05 08:51:14 -05:00
Colin Walters
5e0df36305 Merge pull request #1075 from cgwalters/lint-more3
lint: Check for /boot
2025-02-04 17:44:59 -05:00
Colin Walters
1a8652c28d lint: Check for /boot
This should just be an empty mount point.
Prep for custom base images, where it's quite likely
that some tools stick kernel content in there, when we
actually expect it in `/usr/lib/modules`.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-04 19:05:13 +00:00
Colin Walters
0487bb9543 Merge pull request #1073 from cgwalters/etc-more
docs/filesystem: Flesh out `etc` a bit more
2025-02-04 11:32:07 -05:00
Colin Walters
752de7fb43 docs/filesystem: Flesh out etc a bit more
- Mention `ostree admin config-diff`
- Note that metadata also counts as a modification

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-04 16:07:00 +00:00
Colin Walters
5433b30305 Merge pull request #1072 from cgwalters/fix-compilation
store: Fix semantic merge conflict
2025-02-04 09:28:02 -05:00
Colin Walters
a4e78a45b2 store: Fix semantic merge conflict
Not totally sure how this got through CI, but the most recent
two PRs semantically conflicted. Update the new code
to use the new glib prelude import.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 17:14:23 -05:00
Colin Walters
57829806de Merge pull request #1069 from cgwalters/update-ostree-rs
Update to ostree-rs 0.20
2025-02-03 13:35:10 -05:00
Colin Walters
02d5cd3c8d Merge pull request #1071 from cgwalters/uncache-pending
ostree-ext: Add `image clear-cached-update`
2025-02-03 13:27:46 -05:00
Colin Walters
cb99cf5c95 ci: Bump Fedora to 41
For newer ostree

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 12:37:38 -05: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
71f83465ce ostree-ext: Add image clear-cached-update
This is effectively an internals command for us to aid
debugging.

At some point it may make sense to expose this
at the bootc level too.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 11:05:01 -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
Platform Engineering Bot
c54fefab85 fix(deps): update auto merged updates (#1070)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-02-03 09:43:51 -05:00
Colin Walters
cca41fb7c4 lib: Depend on composefs-rs
And expose some fsverity helpers. This is just to get the
ball rolling on integration.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 09:10:37 -05:00
Colin Walters
c947f0a58d tree: Cleanup and bump rust-version to 1.82
To match composefs-rs.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 09:10:37 -05:00
Colin Walters
1208f4df59 packit: Disable rhel-9 until 9.6
We require a newer Rust. TODO re-enable post 9.6

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 09:10:37 -05:00
Colin Walters
58fa21e54f build-sys: Rework vendoring for source archive
In preparation for vendoring composefs-rs from git.
Basically before, things work fine when we're just vendoring
from crates.io, but fall over when we add a git dependency.
The Fedora `cargo_prep` macro writes a hardcoded `.cargo/config.toml`
which only has a replacement for `crates.io`, but we need
the generated replacement for git too which is output by
`cargo vendor-filterer` - which previously we were
discarding.

This was surprisingly difficult!

- Capture the output of `vendor-filterer`
- Work around a bug where it puts a broken `directory` path in
  the generated TOML
- Insert that as a new `vendor-config.toml` in our source
- Do use `cargo_prep` to init the RPM config in the spec,
  but re-inject our vendor config appended to that one.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 09:10:37 -05:00
Colin Walters
a2a5a7c231 install: Parse and load the prepare-root config
Prep for using this to determine fsverity.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 09:10:37 -05:00
Colin Walters
2b175add56 Improve parsing of ostree prepare-root config
Prep for further work.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 09:10:37 -05:00
Colin Walters
292d9e165c build: Handle dnf5 in Fedora
Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 09:10:37 -05:00
Joseph Marrero Corchado
455e16852c Merge pull request #1067 from cgwalters/lint-list
lints: Add description and `--list`
2025-01-31 16:44:21 -05:00
Colin Walters
1433aa4ef8 man: Update generated manpages
Signed-off-by: Colin Walters <walters@verbum.org>
2025-01-31 14:14:11 -05:00