Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ jobs:
# These tests may mutate the system live so we can't run in parallel
sudo bootc-integration-tests system-reinstall localhost/bootc --test-threads=1

# Unified storage case
sudo podman build -t localhost/bootc-unified-storage -f ci/Containerfile.install-unified-storage
sudo podman run --privileged --pid=host localhost/bootc-unified-storage bootc install to-existing-root --stateroot=unified-storage --acknowledge-destructive --skip-fetch-check
# Verify unified storage was activated; composefs/bootc.json is written relative to
# the target physical root (/target bind-mounted to host /), so the file appears at /composefs/bootc.json
sudo test -f /composefs/bootc.json

# And the fsverity case
sudo podman run --privileged --pid=host localhost/bootc-fsverity bootc install to-existing-root --stateroot=other \
--acknowledge-destructive --skip-fetch-check
Expand Down
15 changes: 15 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,27 @@ test-tmt-baseconfig baseconfig *ARGS:
--seal-state={{seal_state}} \
{{base_img}} readonly {{ARGS}}

# Run unified-storage baseconfig test (works with ostree variant, no composefs required)
[group('testing')]
test-tmt-baseconfig-unified-storage *ARGS:
just baseconfigs=unified-storage build
just baseconfigs=unified-storage _build-upgrade-image
cargo xtask run-tmt \
--env=BOOTC_baseconfigs=unified-storage \
--upgrade-image={{upgrade_img}} \
--bootloader={{bootloader}} \
--filesystem={{filesystem}} \
--boot-type={{boot_type}} \
--seal-state={{seal_state}} \
{{base_img}} readonly {{ARGS}}

# Run readonly tests for all standard baseconfigs
[group('testing')]
test-baseconfigs *ARGS:
just test-tmt-baseconfig etc-transient {{ARGS}}
just test-tmt-baseconfig root-transient {{ARGS}}
just test-tmt-baseconfig var-volatile {{ARGS}}
just test-tmt-baseconfig-unified-storage {{ARGS}}

# Run tmt tests on Fedora CoreOS
[group('testing')]
Expand Down
8 changes: 8 additions & 0 deletions ci/Containerfile.install-unified-storage
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Enable unified storage (composefs+ostree) at install time via image-embedded config
FROM localhost/bootc-install
RUN <<EORUN
set -xeuo pipefail
mkdir -p /usr/lib/bootc/install
printf '[install.storage]\nunified = "enabled-with-copy"\n' > /usr/lib/bootc/install/00-storage.toml
bootc container lint
EORUN
78 changes: 44 additions & 34 deletions contrib/packaging/inject-baseconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,8 @@ if [ -z "${BASECONFIGS}" ]; then
exit 0
fi

# setup-root-conf.toml is composefs-specific; ostree uses prepare-root.conf
# which has a different (INI) format and different option names.
case "${VARIANT}" in
composefs*)
TARGET="/usr/lib/composefs/setup-root-conf.toml"
;;
*)
echo "inject-baseconfig: baseconfigs not supported for variant '${VARIANT}'" >&2
exit 1
;;
esac

mkdir -p "$(dirname "${TARGET}")"

# Split on commas and process each token
# Split and process tokens; unified-storage is handled before the variant check
# because it is backend-independent (works with both ostree and composefs).
IFS=',' read -ra TOKENS <<< "${BASECONFIGS}"
for raw_token in "${TOKENS[@]}"; do
# Trim leading/trailing spaces
Expand All @@ -35,27 +22,50 @@ for raw_token in "${TOKENS[@]}"; do
[ -z "${token}" ] && continue

case "${token}" in
etc-transient)
printf '[etc]\ntransient = true\n' >> "${TARGET}"
;;
root-transient)
printf '[root]\ntransient = true\n' >> "${TARGET}"
;;
var-volatile)
# Mount /var as a fresh tmpfs on every boot via systemd.volatile=state.
# bootc-root-setup detects this karg in the initramfs and automatically
# skips the /var state bind-mount, leaving /var as an empty directory
# from the composefs image. systemd-fstab-generator then mounts a fresh
# tmpfs there at local-fs.target. Using a plain tmpfs avoids the
# overlayfs-on-overlayfs restriction that breaks tools like podman which
# use overlayfs under /var/lib/containers.
mkdir -p /usr/lib/bootc/kargs.d
printf 'kargs = ["systemd.volatile=state"]\n' \
> /usr/lib/bootc/kargs.d/50-var-volatile.toml
unified-storage)
# Write the bootc install config to enable unified storage at install time.
# This is backend-independent and works with both ostree and composefs variants.
mkdir -p /usr/lib/bootc/install
printf '[install.storage]\nunified = "enabled-with-copy"\n' \
> /usr/lib/bootc/install/00-storage.toml
;;
*)
echo "Unknown baseconfig: ${token}" >&2
exit 1
# All other tokens require the composefs variant (they write to composefs-specific paths).
# Validate variant here, not at the top, so unified-storage can run on any variant.
case "${VARIANT}" in
composefs*)
TARGET="/usr/lib/composefs/setup-root-conf.toml"
mkdir -p "$(dirname "${TARGET}")"
;;
*)
echo "inject-baseconfig: baseconfig '${token}' not supported for variant '${VARIANT}'" >&2
exit 1
;;
esac
case "${token}" in
etc-transient)
printf '[etc]\ntransient = true\n' >> "${TARGET}"
;;
root-transient)
printf '[root]\ntransient = true\n' >> "${TARGET}"
;;
var-volatile)
# Mount /var as a fresh tmpfs on every boot via systemd.volatile=state.
# bootc-root-setup detects this karg in the initramfs and automatically
# skips the /var state bind-mount, leaving /var as an empty directory
# from the composefs image. systemd-fstab-generator then mounts a fresh
# tmpfs there at local-fs.target. Using a plain tmpfs avoids the
# overlayfs-on-overlayfs restriction that breaks tools like podman which
# use overlayfs under /var/lib/containers.
mkdir -p /usr/lib/bootc/kargs.d
printf 'kargs = ["systemd.volatile=state"]\n' \
> /usr/lib/bootc/kargs.d/50-var-volatile.toml
;;
*)
echo "Unknown baseconfig: ${token}" >&2
exit 1
;;
esac
;;
esac
done
2 changes: 1 addition & 1 deletion crates/lib/src/bootc_composefs/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@ pub(crate) async fn setup_composefs_boot(
pull_result: &composefs_oci::PullResult<Sha512HashValue>,
allow_missing_fsverity: bool,
) -> Result<()> {
const COMPOSEFS_BOOT_SETUP_JOURNAL_ID: &str = "1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5";
const COMPOSEFS_BOOT_SETUP_JOURNAL_ID: &str = "ed426a753d3f4d698528c0228449de3f";

tracing::info!(
message_id = COMPOSEFS_BOOT_SETUP_JOURNAL_ID,
Expand Down
2 changes: 1 addition & 1 deletion crates/lib/src/bootc_composefs/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ pub(crate) async fn delete_composefs_deployment(
storage: &Storage,
booted_cfs: &BootedComposefs,
) -> Result<()> {
const COMPOSEFS_DELETE_JOURNAL_ID: &str = "2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6";
const COMPOSEFS_DELETE_JOURNAL_ID: &str = "52b55a65303244158335bfd03007bbc4";

tracing::info!(
message_id = COMPOSEFS_DELETE_JOURNAL_ID,
Expand Down
Loading
Loading