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

390 Commits

Author SHA1 Message Date
Colin Walters
96494beaa5 ostree-ext: Add .context for some more errors
This suddenly started in our RPM (COPR/mock) builds, my suspicion
is that seccomp got turned on inadvertently, but let's
add some error context here on general principle.

```
thread 'boundimage::tests::test_parse_spec_dir' panicked at crates/lib/src/boundimage.rs:290:49:
called `Result::unwrap()` on an `Err` value: Querying bound images

Caused by:
    Function not implemented (os error 38)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-22 09:17:33 -04:00
John Eckersberg
84c7a19d25 Fix a few instances of oddball baud rate
Claude pointed this out while I was working on something else
completely unrelated.  But it looks like somewhere along the way
114800 snuck its way in and probably got copy/pasted into a few
places.  The maximum baud rate is 115200[1], and that is the more
typical usage.

[1] https://www.kernel.org/doc/html/latest/admin-guide/serial-console.html

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-10-21 18:37:48 -04:00
Colin Walters
a79ab005e8 bootloader: Mount the ESP with restricted fmask+dmask
This avoids warnings from `bootctl install` for good reasons.
Visible from `bootc install` using systemd-boot.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-21 14:42:49 -04:00
bootc-bot[bot]
02ecf37181 chore(deps): update github actions
Signed-off-by: bootc-bot[bot] <225049296+bootc-bot[bot]@users.noreply.github.com>
2025-10-17 10:19:57 -04:00
Pragyan Poudyal
51d70f1a79 After rebase fixes
Gate some lines behind composefs-backend feature

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-10-17 07:05:42 -04:00
Pragyan Poudyal
26619ee4e3 composefs-backend: Add composefs opts to install-to-existing-root
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-17 07:05:42 -04:00
Pragyan Poudyal
a650e32716 composefs-backend: Start finalize-staged service on update/switch
Rename service to bootc-finalize-staged

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-17 07:05:42 -04:00
Pragyan Poudyal
c5971caf62 composefs-backend/state: Store target imgref
Instead of storing the source imgref in the .origin file, we store the
target imgref

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-17 07:05:42 -04:00
Pragyan Poudyal
a6d886170e composefs-backend: Rename 'composefs-native' to 'composefs-backend'
We were using composefs-native and composefs-backend interchangeably.
Replace all instances of `composefs-native` with `composefs-backend`

Move all composefs-backend options to a single struct so that we can
test for boolean instead of testing for Some/None for composefs-backend
options

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-17 07:05:42 -04:00
Pragyan Poudyal
1579c7d6fa composese-backend: Implement install to filesystem
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-17 07:05:42 -04:00
Colin Walters
f4c678eb88 Various composefs enhancements
- Change the install logic to detect UKIs and automatically
  enable composefs
- Change the install logic to detect absence of bootupd
  and default to installing systemd-boot
- Move sealing bits to the toplevel
- Add Justfile entrypoints
- Add basic end-to-end CI coverage (install + run) using
  our integration tests
- Change lints to ignore `/boot/EFI`

Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-16 14:48:21 -04:00
Colin Walters
02c57b3e30 Adjust all code to use ComposefsRepository alias
This ensures we're SHA-512 across the board.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-16 14:48:21 -04:00
Colin Walters
87d1d391ff Enable composefs by default
Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-16 14:48:21 -04:00
bootc-bot[bot]
7ad66dbfe3 Release 1.9.0 (#1671)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bootc-bot[bot] <225049296+bootc-bot[bot]@users.noreply.github.com>
2025-10-08 21:29:42 +08:00
Colin Walters
0b69f7d82d boot: Add some error context
Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-07 21:49:08 -04:00
Colin Walters
7dbb354fa5 build-sys: Use stream10 by default
The rationale for having c9s by default was that it's
a lower bound (which is still true). But our CI covers
that; I'd rather now have the default be c10s be the default
as it will be the focus of features going forward.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-07 21:49:08 -04:00
John Eckersberg
0f688f390e reinstall: Correctly check for lvs binary in parse_volumes
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-10-07 18:18:31 -04:00
John Eckersberg
82ff6770f2 system-reinstall-bootc: Add context annotations to Result-returning functions
Add #[context()] attribute macro to all functions that return Result
to improve error reporting. This includes adding the fn-error-context
dependency and importing the context macro in all relevant modules.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-10-07 18:18:31 -04:00
John Eckersberg
4d56384290 system-reinstall-bootc: Do not warn on unmounted LVM volumes
If the system has a swap partition (or any other volume which is not
currently mounted) the `findmnt` command will (expectedly) fail to
find it.  Don't early exit in this case, instead just ignore that
volume.  If it wasn't mounted in the first place, we don't need to
warn about it being unmounted after the reinstall operation is
complete.

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
Closes: #1659
2025-10-07 18:18:31 -04:00
Colin Walters
a507380672 system-reinstall-bootc: Handle --help
I wanted to add a CLI option here to avoid the reboot, and
ran into the fact that our option parsing was suboptimal to
start with.

We never documented `BOOTC_REINSTALL_CONFIG` at all...I'm
kind of tempted to deprecate it.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-02 08:35:05 -04:00
Alexander Larsson
40ebdd5829 Update ostree binding to 0.20.5
This will be needed by https://github.com/coreos/rpm-ostree/pull/5497
as it picks up ostree-rs via ostree-ext.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2025-10-02 08:34:42 -04:00
Pragyan Poudyal
c5131fe53d Minor fixes and refactoring
Use UTF8Path in BLSConfig
Use `ok_or_else` so error objects are lazily evaluated
Add tests for `get_imgref`
Update UKI path for systemd-boot to `EFI/Linux/bootc`

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-29 16:48:40 -04:00
Pragyan Poudyal
14dbf1b9e8 composefs-backend: Fix image pull from registry
skopeo (in composefs-rs) doesn't understand the transport "registry:",
so we convert it to "docker://" when passing it to skopeo

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-29 16:48:40 -04:00
Pragyan Poudyal
fdc68a66cd composefs-backend/boot: Allow passing UKI addons as cli options
Allows installing only some of the addons depending upon the list
of addons passed in as cli options.

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-29 16:48:40 -04:00
Pragyan Poudyal
10b4b820a9 composefs-backend/boot: Handle staged systemd-boot deployments
Add logic for upgrading/switching to a deployment with systemd-boot as
the bootloader. Also update finalize-staged service to handle
systemd-boot bootloader entries for UKIs

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-29 16:48:40 -04:00
Pragyan Poudyal
19801c3ddd composefs-backend: Fix bootc status for systemd-boot
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-29 16:48:40 -04:00
Pragyan Poudyal
4b9cffea7f composefs-backend: Add support for systemd-boot uki
We did not have config files for systemd-boot and were only using UKIs
which did not allow proper sorting of the UKIs. This adds .conf files
to `$ESP/loader/entries`

Also, preserves UKI addons' names so we don't overwrite previously added
addon

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-29 16:48:40 -04:00
Pragyan Poudyal
3af5a23d90 parsers/bls: BLS config for UKI
This is in prep for adding config files for BLS compliant bootloaders
booting via UKI.

Adds a field `cfg_type` to BLSConfig which will contain either of the
following sets of keys:

cfg_type - NonEFI

- linux
- initrd
- options

or

cfg_type - EFI

- efi

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-29 16:48:40 -04:00
Colin Walters
cd8fa591a9 generator: Conditinally enable bootc-status units
Right now this service fails in `bcvk run-ephemeral`, but
also likely fails in any non-bootc system that has `subscription-manager`
installed.

A problem is that dependencies of units are started even
if the dependee has a condition that disables it.

This basically the target and path depend on `/run/ostree-booted`
being present (which yes, won't work for composefs...)

Tests: Covered by extant `012-test-unit-status.nu`

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-25 16:38:55 -04:00
Pragyan Poudyal
c05588c5a4 composefs-backend: Implement bootc usr-overlay
Similar to ostree, mount a transient overlayfs on /usr

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-09-25 14:01:21 -04:00
Pragyan Poudyal
c5033911ab cli: Add option to current vs default /etc
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-09-25 11:57:01 -04:00
Pragyan Poudyal
0d199e6bbf etc-merge: Fix directory removal
We weren't checking if the deleted path is a file or a directory and
were calling `remove_file` unconditionally. Update to check for
file/directory first

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-09-25 11:57:01 -04:00
Colin Walters
69395c3076 Updates to build sys and CONTRIBUTING.md
The emphasis here is on trying to have
the `Justfile` be the default entrypoint,
wrapping other tools.

- Replace mentions of podman-bootc with bcvk
  since I hope the latter supercedes the former
- Unify the unit test entrypoint
- Set up /var/tmp as a tmpdir to fix the etc merge
  test (otherwise, selinux failures w/tmp)
- Run the unit+container tests in integration.yml
- Have `just validate` run in a container

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-24 07:03:18 -04:00
Colin Walters
25f9b81b15 etc-merge: Minor cleanups to lsetxattr
- Use &Path and not &PathBuf per general style
- Include info about which xattr failed
- Consistently use with_context + format!

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-24 07:03:18 -04:00
Pragyan Poudyal
b01098312a install-to-disk: Add DPS uuid for all supported architectures
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-09-23 09:29:33 -04:00
Pragyan Poudyal
0e4769cfb1 composefs-backend/bls: Get title, version from os-release
For Type1 boot entries, get the version and title from /usr/lib/os-release
only defaulting to "sort_key" and "verity hash" respectively if we fail
to find them in the file.

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-09-23 09:29:33 -04:00
Pragyan Poudyal
f74462eb7e composefs-backend: Fix bootc status for BLS complaint bootloader
For BLS complaint bootloaders, just systemd for now, we were still
looking for entries in `boot/loader/entries` which was failing as
entries for these bootloaders will be stored in the ESP.

Also, refactor to use `TempMount::mount_dev` for mounting ESP

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-09-23 09:29:33 -04:00
Pragyan Poudyal
2d877c7b41 efivars: Parse efivar as UTF-16 LE bytes
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-09-22 18:44:52 +05:30
Colin Walters
88364c02b3 Merge pull request #1607 from cgwalters/testing-cleanups-p1
ci: Unify more of hack/ and tests/
2025-09-19 14:54:42 -04:00
John Eckersberg
c1316df6cf rust-1.90: Update MSRV to 1.84.0
We already required at least 1.83.0 since we're using `Option::unwrap`
in const context in a few places, but rust-1.90 now correctly points
this out and emits an error.

RHEL 9.6 is on 1.84.0 so bump to match that.

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-09-18 16:17:15 -04:00
John Eckersberg
ff8b1b4112 rust-1.90: Remove newly-detected dead code
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-09-18 16:17:15 -04:00
John Eckersberg
59c3aac203 rust-1.90: Fix warnings on unnecessary parentheses
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-09-18 16:17:15 -04:00
Colin Walters
5090f1ddf9 xtask: Add more error context
Since debugging the last failure was painful with just "No such file or directory"

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-18 21:26:00 +02:00
Colin Walters
856a7fba7c build-sys: A lot more manpage followups
- Remove duplicated logic between xtask and makefile
  for converting markdown; it needs to be in xtask
  as we handle the version substitution there and
  some other tweaks
- Really just make the developer entrypoint `just update-generated`
  in general
- Fix the rendering of booleans
- Remove unnecessary emoji from prints

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-18 09:05:36 -04:00
Colin Walters
6c415c50ad tests: Bump timeout for expect
This should reduce the flake rate.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-18 08:06:14 -04:00
Colin Walters
d81c395fce ci: Unify more of hack/ and tests/
A key thing for me is that the `Justfile` should be a one-stop
shop for development of the project. It can't have everything but
it should answer the basic questions of "how do I build and test
this project".

This aligns the recently added tmt-on-GHA flow a *bit* more closely
with some of that. Biggest is to use the `just build-integration-test-image` as the canonical
way to build a container image with our testing stuff in it;
which uses our main Dockerfile

Other cleanups:
- Change test script to move into tests/tmt/ as a workaround for
  https://github.com/teemtee/tmt/pull/3037#issuecomment-3259585271
- Change the qemu logic to use SMBIOS credentials so we don't
  have to carry around both a disk image and a SSH key
- Change qemu to use `-snapshot` so we can reuse disks
- Change the scripts to accept data via argv[1] and not environment
- Drop the hardcoded testing directory and use `target/` as
  a generic build artifact dir

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-17 15:20:06 -04:00
Colin Walters
19e82be849 Merge pull request #1444 from bootc-dev/composefs-backend
Add a composefs backend
2025-09-15 15:44:48 -04:00
Pragyan Poudyal
6a73da7cea composefs-backend/uki: Handle UKI systemd-boot
We don't need to write Grub menuentries for systemd-boot. For now the
operation is a no-op, but later we would want to have .conf files in
`ESP/loader/entries` so we can control the order of entries.

Regarding that, we would also need to place the UKIs in a separate
directory and not inside `ESP/EFI/Linux`, if we don't want duplicate
entries, as systemd-boot will simply list all .efi files placed in
EFI/Linux unconditionally

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-09-15 14:57:31 -04:00
Pragyan Poudyal
147fcf3149 composefs-backend/uki: Handle UKI addons
If we find UKI addons in the boot entries list, write them to ESP along
with the UKI

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-09-15 14:57:31 -04:00
Colin Walters
088c60646d ci: Also validate the composefs-backend feature
I was hitting a compliation error which *looks*
like it was actaully an incremental compilation bug?
Or it might have been rust-analyzer and local builds
fighting over enabled features.

Anyways, this ensures that we're gating on the composefs
backend compiling.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-15 14:57:31 -04:00