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>
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>
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>
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>
# 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>
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>
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>
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>
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>
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>
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>
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>
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>