Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b6b28ce
install: Add tested /var migration engine
ckyrouac Oct 30, 2026
109c600
install: Separate bound-image resolution from state lookup
ckyrouac Nov 2, 2026
1d905b5
install: Wire /var migration into existing-root install
ckyrouac Oct 30, 2026
ef49df4
install: Use reflinks for /var migration when available
ckyrouac Oct 30, 2026
168794c
docs: Explain preserve-var migration behavior
ckyrouac Oct 30, 2026
9e1a300
tmt: Test package-mode /var preservation
ckyrouac Oct 22, 2026
c778103
tmt: Install preserve-var workdir rule in deployment
ckyrouac Oct 22, 2026
f7d04ef
tests: Restore nested bind-mount preserve-var coverage
ckyrouac Oct 22, 2026
4fa58a9
lib: Harden preserve-var migration safety
ckyrouac Oct 27, 2026
0306435
docs: Clarify preserve-var crash durability
ckyrouac Oct 27, 2026
86a65e0
docs: Clarify preserve-var migration guarantees
ckyrouac Oct 27, 2026
592ad9a
install: Preflight preserve-var sources before install
ckyrouac Nov 12, 2026
6128c9d
install: Merge image-seeded preserve-var mountpoints
ckyrouac Nov 12, 2026
de01e76
install: Gate preserve-var exclusions
ckyrouac Nov 12, 2026
4f2e942
install: Relabel preserved /var from target policy
ckyrouac Nov 12, 2026
c978fe8
tests: Expand package-mode preserve-var coverage
ckyrouac Nov 12, 2026
42a594c
docs: Explain preserve-var SSH host key handling
ckyrouac Nov 12, 2026
27417bc
install: Check hardlink labels before relabeling
ckyrouac Nov 12, 2026
53af74a
tests: Fix package-mode TMT workdir setup
ckyrouac Nov 12, 2026
38cce56
tests: Harden preserve-var TMT workdir cleanup
ckyrouac Nov 12, 2026
c5c63e2
tests: Close TMT log freeze cleanup race
ckyrouac Nov 12, 2026
f858514
tests: Fix local package-mode TMT runner
ckyrouac Nov 12, 2026
e3103f3
tests: Force OSTree package-mode test image
ckyrouac Nov 12, 2026
8092e18
tests: Exclude temporary build secrets from TMT snapshot
ckyrouac Nov 12, 2026
9fdfd4e
tests: Preserve pre-existing build secret files
ckyrouac Nov 12, 2026
7ba91fc
tests: Avoid deleting shared Podman build secrets
ckyrouac Nov 12, 2026
999f586
tmt: Exercise preserve-var relabeling from disabled source
ckyrouac Nov 12, 2026
876b9b8
tests: Resolve package-mode TMT workdirs canonically
ckyrouac Nov 12, 2026
71cad73
tests: Create PostgreSQL test mountpoint
ckyrouac Nov 12, 2026
025f6b7
tests: Set PostgreSQL test volume ownership
ckyrouac Nov 12, 2026
f10048a
tmt: Seed PostgreSQL below bind mount
ckyrouac Nov 12, 2026
0e2fac6
tmt: Use explicit PostgreSQL seed endpoints
ckyrouac Nov 12, 2026
ea7b305
tmt: Mount PostgreSQL seed at target data path
ckyrouac Nov 12, 2026
abd747f
tmt: Verify PostgreSQL data path in target image
ckyrouac Nov 12, 2026
05ae3de
tmt: Compare boot manifests around rejected preflight
ckyrouac Nov 12, 2026
bdcec68
tmt: Cover EFI fallback boot entries
ckyrouac Nov 12, 2026
d620ac2
tests: Snapshot package-mode BLS entries for preflight
ckyrouac Nov 12, 2026
79113f2
tmt: Exclude OSTree entries from baseline BLS lookup
ckyrouac Nov 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,28 @@ jobs:
context:
running_env: "packit"

# Run package-mode migration coverage on a single guest alongside the main
# tier-1 integration plan.
- job: tests
trigger: pull_request
identifier: package-mode-tier-1
require:
label:
present:
- ci/tier-1
targets:
- centos-stream-10-x86_64
- centos-stream-10-aarch64
- fedora-latest-stable-x86_64
- fedora-latest-stable-aarch64
tmt_plan: /tmt/plans/package-mode
tf_extra_params:
environments:
- tmt:
context:
running_env: "packit"
package_source: "artifacts"

# ci/merge: full target set
- job: tests
trigger: pull_request
Expand All @@ -124,6 +146,28 @@ jobs:
context:
running_env: "packit"

- job: tests
trigger: pull_request
identifier: package-mode-full
require:
label:
present:
- ci/merge
targets:
- centos-stream-9-x86_64
- centos-stream-9-aarch64
- centos-stream-10-x86_64
- centos-stream-10-aarch64
- fedora-all-x86_64
- fedora-all-aarch64
tmt_plan: /tmt/plans/package-mode
tf_extra_params:
environments:
- tmt:
context:
running_env: "packit"
package_source: "artifacts"

- job: propose_downstream
trigger: release
dist_git_branches:
Expand Down
105 changes: 104 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ erofs_version := env("BOOTC_erofs_version", "v1")
# Baseconfigs to inject into the image for testing (e.g. "etc-transient" or "root-transient")
baseconfigs := env("BOOTC_baseconfigs", "")
# Base container image to build from
base := env("BOOTC_base", "quay.io/centos-bootc/centos-bootc:stream10")
_default_base := "quay.io/centos-bootc/centos-bootc:stream10"
base := env("BOOTC_base", _default_base)
# Buildroot base image
buildroot_base := env("BOOTC_buildroot_base", "quay.io/centos/centos:stream10")
# Optional: path to extra source (e.g. composefs-rs) for local development
Expand Down Expand Up @@ -229,6 +230,108 @@ build-ukiboot-update-test-image: build-ukiboot-test-image
test-ukiboot: build-ukiboot-update-test-image
cargo xtask run-tmt --env=BOOTC_variant=composefs --filesystem=ext4 --boot-type=aboot --seal-state=unsealed --upgrade-image={{ukiboot_img}}:v2 {{ukiboot_img}}:v1 aboot

# Run the package-mode migration plan against the current checkout image.
# The VM cannot share controller Podman storage, so transfer it as an OCI archive.
[group('testing')]
test-tmt-package-mode image="centos-stream-10":
#!/bin/bash
set -euo pipefail
source_tree=$(git rev-parse --show-toplevel)
lbi_images="{{lbi_images}}"
case "{{image}}" in
fedora-44)
image_base=quay.io/fedora/fedora-bootc:44
;;
centos-stream-10)
image_base=quay.io/centos-bootc/centos-bootc:stream10
;;
*)
echo "Unsupported package-mode test image: {{image}}" >&2
exit 1
;;
esac
# Respect an explicit base override from the caller, while keeping the
# image-specific default selected above (e.g. Fedora for fedora-44).
if [[ "{{base}}" != "{{_default_base}}" ]]; then
image_base="{{base}}"
fi
test_tree=
cleanup() {
local status=$?
trap - EXIT
if [[ -n "$test_tree" ]]; then
rm -rf -- "$test_tree" || true
fi
exit "$status"
}
trap cleanup EXIT
build_status=0
BOOTC_base="$image_base" just {{_forward_settings}} base="$image_base" variant=ostree build || build_status=$?
if [[ "$build_status" -ne 0 ]]; then
exit "$build_status"
fi

# TMT 1.69 copies the whole git root during fmf discovery. Use a small
# snapshot so ignored build outputs and local worktrees are never copied.
trap 'exit 129' HUP
trap 'exit 130' INT
trap 'exit 143' TERM
test_tree=$(mktemp -d -- "${TMPDIR:-/tmp}/bootc-tmt-package-mode.XXXXXX")
# Podman-generated build secrets use shared temp paths; leave cleanup to Podman.
# Stale artifacts are not deleted here, only excluded from the test snapshot.
rsync -a --delete \
--exclude='/.git' \
--exclude='/target' \
--exclude='/.worktrees' \
--exclude='/podman-build-secret-*' \
--exclude='.package-mode-local.*' \
"$source_tree/" "$test_tree/"
git -C "$test_tree" init -q

archive_dir=$(mktemp -d -- "$test_tree/tmt/plans/.package-mode-local.XXXXXX")
archive_path="$archive_dir/bootc.oci"
archive_relative="${archive_dir#"$test_tree/"}/bootc.oci"
environment_file="$archive_dir/package-mode.env"
if [[ -e "$archive_path" ]]; then
echo "Refusing to overwrite existing archive: $archive_path" >&2
exit 1
fi
podman save --format oci-archive --output "$archive_path" {{base_img}}
# Keep TMT's lexical controller path under HOME without sudo or symlinks.
# The guest test stages its full /home run directory into preserved /var/home.
workdir_root="$HOME/.cache/bootc-tmt-workdirs"
mkdir -p -- "$workdir_root"
# The test consumes comma-separated refs, and tmt 1.69 supports these in
# a dotenv environment file without splitting the value on whitespace.
printf 'PACKAGE_MODE_LBI_IMAGES=%s\n' "${lbi_images// /,}" > "$environment_file"
tmt --root "$test_tree" \
--context=running_env=packit \
--context=package_source=local \
--context="test_disk_image={{image}}" \
run --workdir-root "$workdir_root" \
--environment-file "$environment_file" \
--environment "PACKAGE_MODE_IMAGE_NAME={{base_img}}" \
--environment "PACKAGE_MODE_IMAGE_ARCHIVE=$archive_relative" \
--environment "PACKAGE_MODE_TMT_WORKDIR_ROOT=$workdir_root" \
plans --name '^/tmt/plans/package-mode$'

# Check that a composefs caller still gets an OSTree package-mode test image,
# without losing its configured base image or image tag.
[group('testing')]
test-tmt-package-mode-dry-run:
#!/usr/bin/env bash
set -euo pipefail
output=$(BOOTC_variant=composefs BOOTC_image=localhost/package-mode-test:latest just --dry-run base=localhost/package-mode-base:latest test-tmt-package-mode 2>&1)
build_command=$(grep 'just .* variant=ostree build' <<< "$output")
if [[ ! "$build_command" =~ base=localhost/package-mode-base:latest.*variant=composefs.*variant=ostree\ build ]]; then
echo "package-mode dry-run did not force OSTree while preserving settings:" >&2
echo "$build_command" >&2
exit 1
fi
grep -Fq 'podman save --format oci-archive --output "$archive_path" localhost/package-mode-test:latest' <<< "$output"
grep -Fq -- "--exclude='/podman-build-secret-*'" <<< "$output"
grep -Fq 'trap cleanup EXIT' <<< "$output"

# Split out from `test-container` because, unlike the container integration tests,
# unit tests don't depend on variant/filesystem/bootloader/boot_type/seal_state, so
# CI runs this once per OS (in the `package` job) instead of once per test-integration
Expand Down
15 changes: 11 additions & 4 deletions crates/lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ pub(crate) enum InstallOpts {
/// the running host root filesystem. Currently, the host root filesystem's `/boot` partition
/// will be wiped, but the content of the existing root will otherwise be retained, and will
/// need to be cleaned up if desired when rebooted into the new root.
///
/// When migrating from a package-mode system, use `--preserve-var` to copy `/var` data
/// into the new deployment before rebooting.
ToExistingRoot(crate::install::InstallToExistingRootOpts),
/// Nondestructively create a fresh installation state inside an existing bootc system.
///
Expand Down Expand Up @@ -2544,10 +2547,14 @@ async fn run_from_opt(opt: Opt) -> Result<CliExitStatus> {
InstallOpts::Mount(opts) => crate::mount::mount(opts).await,
#[cfg(feature = "install-to-disk")]
InstallOpts::ToDisk(opts) => crate::install::install_to_disk(opts).await,
InstallOpts::ToFilesystem(opts) => {
crate::install::install_to_filesystem(opts, false, crate::install::Cleanup::Skip)
.await
}
InstallOpts::ToFilesystem(opts) => crate::install::install_to_filesystem(
opts,
false,
crate::install::Cleanup::Skip,
false,
)
.await
.map(|_| ()),
InstallOpts::ToExistingRoot(opts) => {
crate::install::install_to_existing_root(opts).await
}
Expand Down
Loading
Loading