There really isn't any kind of single default way to run a subprocess,
that's why it's tricky. Sometimes one wants to have them be async,
sometimes synchronous. Sometimes one wants to capture stdout,
other times not etc.
The `run()` name implies it's a default but it can't really be
because some use cases we really do want to directly copy
stderr instead of capturing it.
It happens that *most* cases here inside bootc we're fine
to only show stderr on error I think; I only changed the editor
case to use the new `run_inherited()`.
But in contrast many use cases in e.g.
https://github.com/coreos/rpm-ostree/pull/5439
wanted `run_inherited()`.
Unit tests: Assisted-by: Claude Code
Signed-off-by: Colin Walters <walters@verbum.org>
Tell bootupctl to load components from the deployed image rather than
expecting we are running in the container (or assume that the buildroot
is the container.)
As the image content is already deployed at this stage, pointing to
it makes it work in both scenarios (different buildroot or running from
the container.)
Fixes https://github.com/bootc-dev/bootc/issues/1455
Notably, we skip generating an fstab entry for boot, even if it's on a
separate partition. this requires the image initramfs have some
knowledge to find the rootfs and bootfs (labels or DPS).
See https://github.com/bootc-dev/bootc/issues/1441
- Add robust binary path resolution with multiple fallback strategies
- Use /proc/self/exe, argv[0], common paths, and PATH search
- Add graceful fallback when cleanup helper can't be spawned
- Improve error handling and logging
- Add comprehensive tests for binary finding logic
This fixes the 'Failed to spawn loopback cleanup helper' error that
was causing issues in packaged distributions where the binary path
was not easily discoverable.
Add fork+exec based cleanup helper to prevent loopback device leaks when
bootc install --via-loopback is interrupted by signals like SIGINT.
- Add loopback-cleanup-helper CLI subcommand
- Implement run_loopback_cleanup_helper() with PR_SET_PDEATHSIG
- Update LoopbackDevice to spawn cleanup helper process
- Add tests for spawn mechanism
This is soon to go EOL and I don't think we need
to keep testing it upstream.
In particular the integration tests are super expensive
and slow and this should cut down our usage of them.
These are failing due to infra issues apparently, and
we have coverage at release time, we really don't
need to build every single PR by default.
Signed-off-by: Colin Walters <walters@verbum.org>
This fixes the bug where the specific layers were looking at the wrong
meta object to allocate files to the layer.
Assisted-by: Claude code
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
This adds two github actions, "Create Release PR" and "release". The
first is scheduled to run every 3 weeks to automatically create a
release PR that bumps the versions. The "release" action is triggered
when the release PR is merged. It will create a draft release with the
tars attached.
Assited-by: Claude Code
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
Add fork+exec based cleanup helper to prevent loopback device leaks when
bootc install --via-loopback is interrupted by signals like SIGINT.
- Add loopback-cleanup-helper CLI subcommand
- Implement run_loopback_cleanup_helper() with PR_SET_PDEATHSIG
- Update LoopbackDevice to spawn cleanup helper process
- Add tests for spawn mechanism
And add a single test which verifies that our internal `reboot`
code actually does what it should (via systemd-run etc.)
This took me way, way too long to do...there were so many missteps
and confusion. First of all, I kept trying to use `systemd.extra-unit`
from https://www.freedesktop.org/software/systemd/man/latest/systemd-debug-generator.html#
but that doesn't exist in stream9.
I spent way too long trying to debug the fact that switching from
`podman run <image> /sbin/init` to `podman run <image> /bin/sh -c '<stuff> && exec /sbin/init`
fails because in the latter case podman's auto-detection fails and
we need to explicitly say `--systemd=always`. In retrospect obvious...but oh well.
On the positive side, I think with some cleanup we could extend this model
and generalize it for "test running in a container with systemd" (with
a lot of cleanup really)
Signed-off-by: Colin Walters <walters@verbum.org>
I've come to the conclusion that Task isn't buying us much value
over Command.
I'd like to eventually drop it. This is just getting the ball
rolling.
Signed-off-by: Colin Walters <walters@verbum.org>
This moves all of the code related to handling decompression out of
container/unencapsulate.rs and into a new module `generic_decompress`.
The only exposed API is via the existing (relocated) `Decompressor`
type.
Internal to `generic_decompress` this adds a new trait
`ReadWithGetInnerMut`, which allows access to the original, inner,
un-decompressed stream. This is used when finishing the decompressor,
whether explicitly through calling its `finish()` method, or
implicitly by dropping it.
For things like GzDecoder, we don't want to read via the actual
decompression reader because we don't care about decompressing at this
point. Plus, the inner reader may have encountered an error partway
through, and trying to decode via decompression will error with
UnexpectedEof.
Instead, wrap a reader for each content type which implements
`ReadWithGetInnerMut`. When we finish decompressing, use the trait
method `get_inner_mut()` to read directly from inner stream to flush
any data.
Resolves: #1407
Signed-off-by: John Eckersberg <jeckersb@redhat.com>