This enables using a local image with system-reinstall-bootc. A couple
drive by cleanups to the integration tests are included.
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
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>
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>
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>
This enables `RUST_LOG=trace system-reinstall-bootc <image>` to print
trace messages for the bootc install invocation.
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
The image is always pulled first, so let's avoid requiring the credentials to be baked
in the image for this check.
fixes #1205
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>
Since podman needs to be installed at the start of the flow, let's add a
prompt so the user doesn't get surprised by the podman install
automatically running when simply testing the command.
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
This splits the `podman pull <image>` and the
`podman ... bootc install to-existing` command to prepare for
future features that will require inspecting the image before
constructing the bootc install command.
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
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>
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>
Add the "legacy" paramaters to the podman run invocation because there
are existing bootc images that need these parameters when running
install to-existing-root.
fixes #1090
Signed-off-by: ckyrouac <chriskyrouac@gmail.com>
I've reworded the multi-user message in the past but the single-user
message still had the older wording. This commit updates the single-user
message to match the multi-user message.
Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
This warning message is shown when Podman is not found on the system. It
is not clear that the script will attempt to install Podman
automatically if it is not found. This commit changes the message to
make it clear that Podman will be installed automatically.
Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
The prompt will now only be shown if there were truly no users found,
and not when the user simply explicitly opted out of including them.
Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
The --user option in podman command was not correctly split into two
arguments. This caused the command to fail with the following error:
```
Error: unknown flag: --user root:root
```
Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
If the Containerfile has a USER directive, podman-run will execute the
bootc command as that user, making the installation to fail. So, let's
force the root as user/group to overwrite any possible USER directive.
Signed-off-by: German Maglione <gmaglione@redhat.com>
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>
# 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>