1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-05 15:45:53 +01:00
Commit Graph

4010 Commits

Author SHA1 Message Date
Colin Walters
ea0df4fcf9 build-sys: Consistently use RUN --network=none and add check
Ensure all RUN instructions after the "external dependency cutoff point"
marker include `--network=none` right after `RUN`.
This enforces that external dependencies are clearly delineated in the early stages of the Dockerfile.

The check is part of `cargo xtask check-buildsys` and includes unit tests.

Assisted-by: OpenCode (Sonnet 4)
Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-08 14:34:23 +01:00
Colin Walters
fab93ac4e3 build-sys: Keep bootc-pkg image for layer caching
Removing localhost/bootc-pkg at the end of the package target
also deletes the build stage layers, causing subsequent builds
to miss the cache and rebuild the RPMs from scratch.

Keep the image around; use `just clean-local-images` to reclaim space.

Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-08 14:34:23 +01:00
Colin Walters
a6c87c6667 build-sys: Remove separate integration test image
The previous commit consolidated test content (nushell, cloud-init, etc.)
into the base image. This completes that work by removing the separate
`build-integration-test-image` target and updating all references.

Now `just build` produces the complete test-ready image directly,
simplifying the build pipeline and eliminating the intermediate
`localhost/bootc-integration` image.

Also adds SKIP_CONFIGS support for the coreos testing workflow, which
skips LBIs, test kargs, and install configs that would conflict with FCOS.

Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-08 14:34:23 +01:00
Colin Walters
f1a7624542 build-sys: Consolidate test image content into base
Move all content from the derived test image (hack/Containerfile) into
the main Dockerfile base image. This includes nushell, cloud-init, and
the other testing packages from packages.txt.

This simplifies the build by avoiding the need to juggle multiple images
during testing workflows - the base image now contains everything needed.

Assisted-by: OpenCode (Claude Sonnet 4)
Signed-off-by: Colin Walters <walters@verbum.org>

# Conflicts:
#	hack/Containerfile
2026-01-08 14:34:23 +01:00
Colin Walters
6edd1f5384 build-sys: Always build a "from scratch" image
This changes things so we always run through https://docs.fedoraproject.org/en-US/bootc/building-from-scratch/
in our default builds, which helps work around https://github.com/containers/composefs-rs/issues/132

But it will also help clean up our image building in general
a bit.

Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-08 14:34:23 +01:00
Colin Walters
9745361288 build-sys: Move build back to being the default target
Oops.

Signed-off-by: Colin Walters <walters@verbum.org>

# Conflicts:
#	Justfile
2026-01-08 14:34:23 +01:00
Colin Walters
d7a7c0c98f build-sys: Always build packages as separate stage
We were previously trying to support a direct `podman/docker build`
*and* injecting externally built packages (for CI).

Looking to rework for sealed images it was too hacky; let's
just accept that a raw `podman build` no longer works, the canonical
entry for local build is `just build` which builds both a package
and a container.

This way CI and local work exactly the same.

Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-08 14:34:23 +01:00
Colin Walters
52b432382a ostree: Handle images without final diffid
This will be tested by the following change to build flattened
images.

Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-08 14:34:23 +01:00
Colin Walters
881d2e4c94 ostree-ext: Fix /etc remapping for derived layers in container export
When exporting derived container images via store::export, content in
derived layers that was originally at /etc (stored in ostree as /usr/etc)
was incorrectly output as /usr/etc instead of being remapped back to /etc.

This was because the "remaining layers" (non-ostree derived layers) were
exported using the raw ostree CLI which doesn't perform the remapping.

Fix this by adding a "raw" export mode to the tar export machinery that
outputs plain filesystem content with proper /usr/etc -> /etc remapping
but without ostree repository structure (no hardlinks to object store,
no commit metadata). This mode also preserves xattrs via PAX extensions.

Assisted-by: OpenCode (Sonnet 4)
Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-08 14:34:23 +01:00
Colin Walters
b68100b20e docs: Publish rustdoc for internal crates alongside mdbook
The docs workflow now also generates rustdoc for all workspace crates
and publishes them as a subdirectory of the main documentation site.
This makes internal API documentation available at
bootc-dev.github.io/bootc/internals.html with links to each crate.

Note this required switching the docs container to CentOS Stream 10 for newer Rust (1.91).

Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-07 21:25:27 +01:00
Daniel Hast
2a4476c6a8 ostree-ext: Make new packing if using prior build fails
Under some circumstances--for example, if a new exclusive component has
been added since the prior build--packing with a prior build structure
can fail. When this happens, we can simply discard the prior build
data and make a new packing structure, rather than having chunking fail
entirely.

Signed-off-by: Daniel Hast <hast.daniel@protonmail.com>
2026-01-07 00:18:58 +01:00
bootc-bot[bot]
0ee9b2276d Release 1.12.0
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v1.12.0
2026-01-06 20:19:44 +01:00
Huijing Hei
c7e3d10658 tests/plan: add PubkeyAcceptedAlgorithms=+ssh-rsa to ssh-option
To workaround the issue that failed to ssh after reboot, can not
reproduce locally.

Signed-off-by: Huijing Hei <hhei@redhat.com>
2026-01-06 17:17:18 +01:00
Huijing Hei
44b1ccca57 tests: Add test test-tmt-on-coreos
To workaround https://github.com/bootc-dev/bcvk/issues/174, will
build `bootc-integration-coreos` container firstly and save it to
`bootc.tar`, then load it to install.

Signed-off-by: Huijing Hei <hhei@redhat.com>
2026-01-06 17:17:18 +01:00
Huijing Hei
1d7b73d24b install: mount esp in clean_boot_directories()
On FCOS, esp is not mounted after booted, need to find esp and
mount before cleaning, or `/boot/efi` will be removed.

Signed-off-by: Huijing Hei <hhei@redhat.com>
2026-01-06 17:17:18 +01:00
Huijing Hei
b9ac902709 install: should remove the empty dir under /boot
Fix what we did in
92d9d38494

Signed-off-by: Huijing Hei <hhei@redhat.com>
2026-01-06 17:17:18 +01:00
Huijing Hei
bf89a7dd11 install: add target_root_path for RootSetup
When running `install to-filesystem` on ostree OS, should use
`target_root_path` for bootupctl to install bootloader.

Signed-off-by: Huijing Hei <hhei@redhat.com>
2026-01-06 17:17:18 +01:00
Huijing Hei
19534d148e install: empty /boot & /boot/efi
Get pointer from Colin's comment
https://github.com/bootc-dev/bootc/pull/1752#issuecomment-3532953293
- Empty the complete ESP
- On ostree OS, empty `/boot` but preserve `/boot/loader`
- On none ostree OS, the loader is directory that needs to be
removed.

Signed-off-by: Huijing Hei <hhei@redhat.com>
2026-01-06 17:17:18 +01:00
bootc-bot[bot]
5ec2c5ce69 Sync common files from infra repository (#1875)
Synchronized from bootc-dev/infra@d5a5a62c98.

Signed-off-by: bootc-dev Bot <bot@bootc.dev>
Co-authored-by: bootc-dev Bot <bot@bootc.dev>
2025-12-29 13:31:32 +00:00
Colin Walters
d5dd1af815 container inspect: Add human-readable and yaml output formats
The container inspect command previously only supported JSON output.
This extends it to support human-readable output (now the default)
and YAML, matching the output format options available in other
bootc commands like status.

The --json flag provides backward compatibility for scripts that
expect JSON output, while --format allows explicit selection of
any supported format.

Assisted-by: OpenCode (Sonnet 4)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-12-29 12:40:36 +01:00
Colin Walters
fd83c659a8 cli: Extend bootc container inspect with kernel info
The container-inspect command previously only reported kernel arguments.
Extend it to also report kernel information, including whether the image
contains a traditional kernel or a Unified Kernel Image (UKI).

This consolidates UKI detection logic previously in bootc_composefs::boot
into a new kernel module that can find kernels via either the traditional
/usr/lib/modules/<version>/vmlinuz path or UKI files in /boot/EFI/Linux/.

The ContainerInspect output now includes a "kernel" field with version
and unified (boolean) properties, enabling tooling to determine the
boot method before installation.

Assisted-by: OpenCode (Claude Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-12-29 12:40:36 +01:00
Chaser Huang
bd9026997b composefs/state: Copy /var from image to fresh installations
Signed-off-by: Chaser Huang <huangkangjing@gmail.com>
2025-12-29 15:29:00 +05:30
Pragyan Poudyal
0e2ad92675 test/tmt: Use bootc usroverlay for /usr overlay mount (#1882)
Previously we were mounting a rw overlay on top of /usr using
`mount -t overlay -olowerdir=/usr,workdir=...,upperdir=... overlay /usr`
which caused the kernel to throw
`overlayfs: maximum fs stacking depth exceeded`
possibly because the mountpoint was the same as the lowerdir

Also, move the overlay mount BEFORE we mask off `/sysroot/ostree` else
bootc throws `error: Read only filesystem`

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-12-29 15:59:47 +08:00
Pragyan Poudyal
0aae35a434 composefs/state: Fix imgref format in origin file
On `UpdateAction::UpdateOrigin` the origin for the container image used
was not properly formatted. Fixed it

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-12-22 16:06:52 +05:30
Pragyan Poudyal
bc3d6ec1c9 Bump composefs-rs
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-12-22 16:06:52 +05:30
Pragyan Poudyal
d12d763de7 composefs/soft-reboot: Handle soft reboot for UKIs
Similar to soft reboots for Type1 entries, we compute the SHA256Sum of
.linux + .initrd sections in the UKI, and compare them to check for
kernel skew

Next, compare the .cmdline section skipping the `composefs=` parameter
as that will always be different

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-12-22 16:06:52 +05:30
Pragyan Poudyal
13113d8c8f composefs/uki: Save boot digest
Similar to what we do with Type1 entries, we save the SHA256Sum of
.linux + .initrd sections of the UKI under `boot_digest` key in the
origin file

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-12-22 16:06:52 +05:30
Pragyan Poudyal
969dfd438e composefs: Soft Reboot after update/switch if specified
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-12-22 16:06:52 +05:30
Pragyan Poudyal
33e3b745ad composefs: Handle bootc status after a soft reboot
After a soft reboot the kernel cmdline doesn't change so we can't rely
on the `composefs=` parameter in the cmdline. Instead, we check the
source of the root mount point

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-12-22 16:06:52 +05:30
Pragyan Poudyal
f9931d13e8 composefs: Implement soft reboot
Add an internal command for soft rebooting the system. Similar to how
it's done for ostree, we only allow soft reboot if the other deployment
has the same kernel state, i.e. the SHASum of kernel + initrd is the
same as that of the current deployment.

soft reboot is not possible in case of UKI deployment

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-12-22 16:06:52 +05:30
Pragyan Poudyal
387e9d3114 initramfs: Allow passing target for mounting
`target` field in Args was not being used. Use it if it is passed in the
args. Also helps us mount the new root at `/run/nextroot`

Also, use Cmdline struct instead of String to represent the kernel
command line

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-12-22 16:06:52 +05:30
Pragyan Poudyal
af1e0df7ac composefs/status: Check if deployment is soft rebootable
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-12-22 16:06:52 +05:30
John Eckersberg
72f1f2720d container: Add path-based compute-composefs-digest command
Add a new `bootc container compute-composefs-digest` command that computes
the bootable composefs digest directly from a filesystem directory path,
defaulting to `/target`. This enables computing digests in container
environments without requiring access to container storage or a booted
host system.

The existing container-storage-based behavior is preserved and renamed
to `compute-composefs-digest-from-storage` (hidden). The `hack/compute-composefs-digest`
script is updated to use the renamed command.

The core digest computation logic is extracted into a new
`bootc_composefs::digest` module with:
- `new_temp_composefs_repo()` helper for DRY temp repository creation
- `compute_composefs_digest()` function with "/" path rejection

Unit tests and an integration test verify the command works correctly,
producing valid SHA-512 hex digests with consistent results across
multiple invocations. Exact digest values are not asserted due to
environmental variations (SELinux labels, timestamps, etc.).

Closes: https://github.com/bootc-dev/bootc/issues/1862

Assisted-by: OpenCode (Claude Opus 4.5)
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-12-18 19:45:22 -05:00
John Eckersberg
d90f0197c0 ostree-ext: Fix unused import warning in objgv tests
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-12-18 19:20:48 -05:00
Anish Bhatt
be96cacb9a Silence cloud-init warnings
Silence cloud-init warnings about resizing rootfs. More discussion in https://gitlab.com/fedora/bootc/examples/-/merge_requests/78

Signed-off-by: Anish Bhatt <anish.7@gmail.com>
2025-12-18 14:39:36 -05:00
Pascal Bachor
eb84e37fbb cli: use file extension for host spec to be edited
Signed-off-by: Pascal Bachor <bachorp@users.noreply.github.com>
2025-12-18 13:15:47 -05:00
Huijing Hei
40dafdbfda ci: add crates-release.yml workflow to publish to crates.io
Publish two crates:
`bootc-internal-utils` and `bootc-internal-blockdev`

Part of	https://github.com/bootc-dev/infra/issues/20

Signed-off-by: Huijing Hei <hhei@redhat.com>
2025-12-18 10:34:29 -05:00
Pragyan Poudyal
fa1726b161 composefs/upgrade: Remove existing staged entries
When upgrading, switching if there is already a staged directory for
bootloader entries, then delete it as we would overwrite it anyway

Fixes: https://github.com/bootc-dev/bootc/issues/1857

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2025-12-18 17:22:17 +05:30
bootc-bot[bot]
d8ce93120f Sync common files from infra repository (#1868)
Synchronized from bootc-dev/infra@2dd498656b.

Signed-off-by: bootc-dev Bot <bot@bootc.dev>
Co-authored-by: bootc-dev Bot <bot@bootc.dev>
2025-12-18 11:47:08 +00:00
bootc-bot[bot]
c58fe915b5 Sync common files from infra repository (#1867)
Synchronized from bootc-dev/infra@81ea4256be.

Signed-off-by: bootc-dev Bot <bot@bootc.dev>
Co-authored-by: bootc-dev Bot <bot@bootc.dev>
2025-12-18 17:50:30 +08:00
Colin Walters
1a61162c92 build-sys: Minor doc improvement
Signed-off-by: Colin Walters <walters@verbum.org>
2025-12-17 10:25:30 -05:00
Colin Walters
81f0d5a78d build-sys: Various improvements
Pass SOURCE_DATE_EPOCH from git commit timestamp through to rpmbuild,
enabling bit-for-bit reproducible RPM builds. This is useful for
verification and caching.

Then fix the idempotency of the default `just build` to ensure
we're not incorrectly invalidating caches.

Add `just check-buildsys` command that builds packages twice and
verifies checksums match, confirming reproducibility. The CI package
job now uses this to catch regressions.

Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-12-17 10:25:30 -05:00
bootc-bot[bot]
64ad5c539f chore(deps): update github actions (#1850)
Signed-off-by: bootc-bot[bot] <225049296+bootc-bot[bot]@users.noreply.github.com>
Co-authored-by: bootc-bot[bot] <225049296+bootc-bot[bot]@users.noreply.github.com>
2025-12-17 16:25:43 +08:00
Huijing Hei
f6b7ec8009 install: read boot entry from /etc/fstab and write to new created (#1856)
bootc deployment

On rawhide, the /boot is subvol instead of separate partition, we
need to use the same option in the created deployment.

Fixes https://github.com/bootc-dev/bootc/issues/1849

Signed-off-by: Huijing Hei <hhei@redhat.com>
2025-12-17 16:13:40 +08:00
Colin Walters
f7b41cc1eb cli: Fix switch --mutate-in-place to work outside booted environment
Move the --mutate-in-place handling before get_storage() so it doesn't
require a fully booted ostree environment. This enables use cases like
Anaconda where we're chrooted into a non-booted system.

Closes: #1854
Assisted-by: OpenCode (claude-sonnet-4-20250514)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-12-16 21:11:24 -05:00
John Eckersberg
39b64e19b5 ostree-ext: Fix warning on rust 1.9.2
This started warning with:

warning: value assigned to `no_signature_verification` is never read
    --> crates/ostree-ext/src/cli.rs:1265:21
     |
1265 |                     mut no_signature_verification,
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: maybe it is overwritten before being read?
     = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default

Which is true in this case, we never actually read the pattern-matched
value.  Change it to be explicitly unused with '_' and then shadow it
with a `let` binding.

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-12-16 18:26:44 -05:00
Colin Walters
3c861fb27a podstorage: Improve authfile handling more
We should match exactly the logic we use with containers-image-proxy.

- If bootc doesn't have auth setup, then we need to not let podman
  fall back to the defaults
- Always pass a copy of the auth in a tempfile so we aren't
  reliant on absolute paths as we're continually trying to
  reduce our usage of those.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-12-16 18:08:15 -05:00
James Forcier
5bbd326495 lib: Pass absolute authfile path when pulling LBIs
ostree-ext explicitly handles authfile paths as relative; this works
fine for most callers of get_global_authfile, as they only read the
returned open file descriptor, and ignore the path. However, pulling
logically bound images requires passing the actual authfile path to
Podman, so we must resolve the absolute path in this case - otherwise,
we see errors like the following:

```
[root@fedora ~]# bootc upgrade
layers already present: 69; layers needed: 1 (242.2 MB)
Fetched layers: 230.95 MiB in 3 seconds (90.88 MiB/s)
  Deploying: done (3 seconds)
  Fetching bound image: quay.io/prometheus/node-exporter:v1.10.2: done (0 seconds)
error: Upgrading: Staging: Pulling bound images: Pulling bound images: Failed to pull image: Subprocess failed: ExitStatus(unix_wait_status(32000))
Error: credential file is not accessible: faccessat etc/ostree/auth.json: no such file or directory
```

Since cap_std::fs::Dir intentionally does not expose its filesystem
path, we must resort to reconstructing it from a file descriptor. We
could do this by inspectingthe file descriptor for `sysroot` and
combining that with the relative path returned by get_global_authfile,
but since get_global_authfile returns the descriptor of the actual
authfile, we can simply read that directly.

Signed-off-by: James Forcier <csssuf@csssuf.net>
2025-12-16 18:08:15 -05:00
Gareth Widlansky
439deff2f7 sdboot: add support for key enrollment in bootc install
systemd-boot has support for automatically enrolling keys
for Secure Boot, this adds support for copying these keys
as embedded in the input container image into the location
where systemd-boot can perform automatic enrollment on them.

Commit-message-written-by: Colin Walters <walters@verbum.org>
Signed-off-by: Gareth Widlansky <gareth.widlansky@proton.me>
2025-12-15 20:27:28 -05:00
Colin Walters
3efcbddeb3 lib: Fix bootc status on non-bootc systems
Previously, `BootedStorage::new()` unconditionally tried to open
`/sysroot` before checking the environment type. This caused
`bootc status` to fail on non-ostree/composefs systems.

(We did work in containers and we had tests for that; but
 the container case is special cased even earlier)

Fixes: https://issues.redhat.com/browse/RHEL-135687

Assisted-by: Claude Code (Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-12-14 10:06:53 -05:00