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>
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>
This makes it easier to copy/paste (and read) the `podman ... bootc
install ...` command from the CLI output.
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
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>
This used to work and I'm not exactly sure what changed. For some reason
`with_env_filter` needs to be at the end of the chain for the RUST_LOG
env var parsing to work.
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
The formatting directives are shown to the user:
```
Error: unknown flag: --user root:root
See 'podman run --help'
ERROR running reinstall command: Failed to run command: {self:#?}
```
This is due to a lack of `format!` directive
Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
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>
`run` hides stderr until the command fails, which is not what we want
for all current users of `run_with_cmd_context` - it's currently used
by long running processes where we want the users to see all the output
live.
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>
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>
The install code and the blockdev code call each other.
Clean up blockdev to only use `bootc-utils`.
Prep for splitting out the blockdev stuff into at least a
separate internal crate; ref
https://github.com/coreos/bootupd/pull/820
Signed-off-by: Colin Walters <walters@verbum.org>
Followup to 40af5a67b1
now that some other PRs have merged this one would be less
conflict-fest.
This is a general best practice; specifically motivated by
handling test-specific imports.
Signed-off-by: Colin Walters <walters@verbum.org>
In almost all children we fork, we want the child to reliably
exit if we do (e.g. especially if we panic). The Linux
PR_SET_PDEATHSIG is just great for this.
Signed-off-by: Colin Walters <walters@verbum.org>
Factor out a helper that runs and captures output *and*
checks exit status out of what we have existing in `run_and_parse_json`,
so we can use it for things that output not-JSON.
Signed-off-by: Colin Walters <walters@verbum.org>
Add `dead_code = "deny"` to our default lints; we had
a compiler warning for this in main.
Fix the warning by moving the human readable test code into
`#[cfg(test)]`.
While we're here, move the other lib.rs lints into the crate;
enforcing docs for *everything* at first I thought might be heavy
handed but actually is fine as it only applies to things that
are `pub`, of which we don't actually have that much so it
mainly forced me to add some stub docs for the modules, which
is probably a good idea.
Signed-off-by: Colin Walters <walters@verbum.org>
In general the codebase is starting to get to the size
where some internal crates make sense. Let's start
with the inevitable catchall "utils" crate which
starts off just holding our helper traits for
subprocesses.
Signed-off-by: Colin Walters <walters@verbum.org>