Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
3123471
install: Add tested /var migration engine
ckyrouac Oct 30, 2026
097c98f
install: Separate bound-image resolution from state lookup
ckyrouac Nov 2, 2026
01c7a14
install: Wire /var migration into existing-root install
ckyrouac Oct 30, 2026
bda1e8d
install: Use reflinks for /var migration when available
ckyrouac Oct 30, 2026
39da181
docs: Explain preserve-var migration behavior
ckyrouac Oct 30, 2026
abce53e
tmt: Test package-mode /var preservation
ckyrouac Oct 22, 2026
1d3107d
tmt: Install preserve-var workdir rule in deployment
ckyrouac Oct 22, 2026
9c9f5f5
tests: Restore nested bind-mount preserve-var coverage
ckyrouac Oct 22, 2026
83e903b
lib: Harden preserve-var migration safety
ckyrouac Oct 27, 2026
709fe16
docs: Clarify preserve-var crash durability
ckyrouac Oct 27, 2026
2907ea6
docs: Clarify preserve-var migration guarantees
ckyrouac Oct 27, 2026
ab1cbae
install: Preflight preserve-var sources before install
ckyrouac Nov 12, 2026
f900f67
install: Merge image-seeded preserve-var mountpoints
ckyrouac Nov 12, 2026
d8d2b86
install: Gate preserve-var exclusions
ckyrouac Nov 12, 2026
2601a9f
install: Relabel preserved /var from target policy
ckyrouac Nov 12, 2026
90e8266
tests: Expand package-mode preserve-var coverage
ckyrouac Nov 12, 2026
a5e06e7
docs: Explain preserve-var SSH host key handling
ckyrouac Nov 12, 2026
7fa316b
install: Check hardlink labels before relabeling
ckyrouac Nov 12, 2026
42a33c1
tests: Fix package-mode TMT workdir setup
ckyrouac Nov 12, 2026
004455e
tests: Harden preserve-var TMT workdir cleanup
ckyrouac Nov 12, 2026
6f15a0a
tests: Close TMT log freeze cleanup race
ckyrouac Nov 12, 2026
d521707
tests: Fix local package-mode TMT runner
ckyrouac Nov 12, 2026
ffc8c6d
tests: Force OSTree package-mode test image
ckyrouac Nov 12, 2026
de0daa5
tests: Exclude temporary build secrets from TMT snapshot
ckyrouac Nov 12, 2026
02c4e73
tests: Preserve pre-existing build secret files
ckyrouac Nov 12, 2026
82aadc1
tests: Avoid deleting shared Podman build secrets
ckyrouac Nov 12, 2026
aa5a5f9
tmt: Exercise preserve-var relabeling from disabled source
ckyrouac Nov 12, 2026
8a9f0ed
tests: Resolve package-mode TMT workdirs canonically
ckyrouac Nov 12, 2026
4d0969a
tests: Create PostgreSQL test mountpoint
ckyrouac Nov 12, 2026
f540054
tests: Set PostgreSQL test volume ownership
ckyrouac Nov 12, 2026
8fb2d68
tmt: Seed PostgreSQL below bind mount
ckyrouac Nov 12, 2026
201aecd
tmt: Use explicit PostgreSQL seed endpoints
ckyrouac Nov 12, 2026
0cf71d8
tmt: Mount PostgreSQL seed at target data path
ckyrouac Nov 12, 2026
ef6da59
tmt: Verify PostgreSQL data path in target image
ckyrouac Nov 12, 2026
fa73670
tmt: Compare boot manifests around rejected preflight
ckyrouac Nov 12, 2026
214fa7c
tmt: Cover EFI fallback boot entries
ckyrouac Nov 12, 2026
b0f8e17
tests: Snapshot package-mode BLS entries for preflight
ckyrouac Nov 12, 2026
3119147
tmt: Exclude OSTree entries from baseline BLS lookup
ckyrouac Nov 12, 2026
85a28bb
tmt: Set test SSH host key labels explicitly
ckyrouac Nov 12, 2026
4af51a8
tmt: Accept implicit latest tag in preserve-var test
ckyrouac Nov 12, 2026
f344be9
install/migrate: Allow unmatched mount placeholder labels
ckyrouac Nov 12, 2026
8d7d8a9
install: Require empty staged directories for unmatched labels
ckyrouac Nov 12, 2026
dd9ae8e
install: require experimental opt-in for preserve-var
ckyrouac Nov 18, 2026
8132dc5
docs: add experimental preserve-var guide
ckyrouac Nov 18, 2026
df58b00
docs: Explain preserve-var collision handling
ckyrouac Nov 24, 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 `--experimental --preserve-var` to copy
/// `/var` data into the new deployment before rebooting. This feature is experimental.
ToExistingRoot(crate::install::InstallToExistingRootOpts),
/// Nondestructively create a fresh installation state inside an existing bootc system.
///
Expand Down Expand Up @@ -2550,10 +2553,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