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

18 Commits

Author SHA1 Message Date
Daniele Guarascio
13d5db68aa Update workspace to Rust edition 2024
Migrate all crates from edition 2021 to 2024. This includes
updating Cargo.toml files and fixing code compatibility issues.

The MSRV is bumped to 1.85.0 to support edition 2024.

Note: global_init() requires #[allow(unsafe_code)] for
std::env::set_var which is now unsafe in edition 2024.
This is safe because the function is called early in main()
before any threads are spawned.

Closes: #1414

Signed-off-by: Daniele Guarascio <guarascio.daniele@gmail.com>
2026-01-12 17:38:26 +01:00
Huijing Hei
64eef42d92 crates/utils: update version to 0.1.0
Signed-off-by: Huijing Hei <hhei@redhat.com>
2025-12-09 08:35:47 -05:00
Huijing Hei
5df230ae6a crates/blockdev: publish new version 0.1.0
Signed-off-by: Huijing Hei <hhei@redhat.com>
2025-12-09 08:35:47 -05:00
Huijing Hei
e24660f65e blockdev: find esp based on MBR or GPT
See https://github.com/bootc-dev/bootc/pull/1736#issuecomment-3497579510

Signed-off-by: Huijing Hei <hhei@redhat.com>
2025-11-18 21:29:17 -05:00
Colin Walters
a998bfc3f1 install: Fix DPS support
This fixes bootc's use of the Discoverable Partition Specification (DPS)
to properly support systemd-gpt-auto-generator. Previously, bootc was
incorrectly setting filesystem UUIDs to the DPS partition type UUID value,
which caused UUID collisions and prevented proper DPS functionality.

It's still a TODO on our side to support systemd-repart in this flow.

Note we go back to using random filesystem UUIDs with this, but
per above we should likely reinitialize them on boot via repart.

Note we remove root= parameter from kernel cmdline for composefs sealed images,
allowing systemd-gpt-auto-generator to auto-discover the root partition
and we test this.

Fixes: #1771

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-18 11:02:22 -05:00
Huijing Hei
4b83fa38ac blockdev: add bootable property to find ESP partition
As Fedora IoT on the Raspberry Pi 3 is using `MBR` by default, we
need to find ESP partition via `bootable`.
See https://github.com/coreos/bootupd/issues/1019

Signed-off-by: Huijing Hei <hhei@redhat.com>
2025-11-06 08:33:33 -05:00
Colin Walters
4e04eb95da crates: Add discoverable partition module and parttype APIs
This fleshes out what we had with a more rigorous
binding to the spec.

As part of this though, the ESP constant we had here was uppercase,
but the spec version uses lowercase. Add APIs to find a partition
by type, comparing case insensitively.

Assisted-by: Claude Code
Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-22 16:02:02 -04:00
Colin Walters
a3fe7b2abc crates/blockdev: Fix various clippy lints
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-26 08:24:06 -04:00
Sam Dasilva
2e81362e5c fix(blockdev): include "internals" when spawning loopback-cleanup-helper
Without the "internals" prefix, bootc fails to spawn the
loopback-cleanup-helper because the helper is only available
under the `bootc internals` subcommand.
This patch updates the spawned command to include "internals" before
the helper name so it runs as intended.

Signed-off-by: Sam Dasilva <samuelramos852@gmail.com>
2025-08-13 23:59:05 -04:00
Colin Walters
87e8ac64b9 build-sys: Reorganize crate listings
Split `dependencies` into three sections:
- Internal deps (crates in the same workspace)
- Workspace deps
- Deps only used by that sub-crate

Also make everything alphabetical.

Assisted-by: Claude Code
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-08 10:16:51 -04:00
Colin Walters
2a4bfc8e7f build-sys: Move all common deps to workspace
General cleanup.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-08 10:16:51 -04:00
Colin Walters
d71ec1c5f3 tree-wide: Clean up our re-exec path
Prep for fixing https://github.com/bootc-dev/bootc/issues/1434

Basically in the selinux path we copy our binary to a tempfile,
which breaks `/proc/self/exe`.

Fix this by setting an environment variable when we do that re-exec
and ensuring that *everything* references an internal API (now
moved to utils/ so it can be shared) that looks for the env
var first.
2025-07-30 13:42:42 -04:00
Colin Walters
634e038a95 command: Split up run() method
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>
2025-07-29 18:14:23 -04:00
gursewak1997
ff004c907d blockdev: fix loopback cleanup helper path resolution
- 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.
2025-07-25 10:37:39 -07:00
gursewak1997
a81de6dcad blockdev: implement signal-safe loopback device cleanup helper
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
2025-07-24 12:15:46 -07:00
Joseph Marrero Corchado
fe364208ec Revert "blockdev: implement signal-safe loopback device cleanup helper"
This reverts commit c2c918cc80.

As it makes install to-disk fail:
https://github.com/bootc-dev/bootc/issues/1439
2025-07-23 09:40:34 -04:00
gursewak1997
c2c918cc80 blockdev: implement signal-safe loopback device cleanup helper
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
2025-07-22 12:04:27 -07:00
Colin Walters
2f69a16074 Move all crates under crates/
Just organizational cleanup, a number of Rust projects
do this:
https://github.com/search?q=+%22crates%2F*%22+path%3ACargo.toml+-is%3Afork&type=code&p=5

Signed-off-by: Colin Walters <walters@verbum.org>
2025-07-17 16:27:39 -04:00