diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84006f024b..d48ad2f464 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -300,7 +300,7 @@ jobs: matrix: test_os: ${{ fromJson(needs.compute-ci-level.outputs.integration_os_matrix) }} variant: [ostree, composefs] - filesystem: ["ext4", "xfs"] + filesystem: ["ext4", "xfs", "btrfs"] bootloader: ["grub", "grub-cc", "systemd"] boot_type: ["bls", "uki"] seal_state: ["sealed", "unsealed"] @@ -326,8 +326,8 @@ jobs: - bootloader: grub boot_type: "uki" - # We only test filesystems for composefs to test if composefs backend will work on fs - # without fsverity + # ostree runs on xfs, and on btrfs (below); the other filesystems + # are for composefs, with and without fs-verity - variant: ostree filesystem: ext4 - variant: ostree @@ -335,6 +335,21 @@ jobs: - variant: ostree bootloader: systemd + # btrfs only on Fedora (CentOS Stream doesn't ship it): ostree, + # and composefs with one sealed UKI and one GRUB BLS cell. + - test_os: centos-9 + filesystem: btrfs + - test_os: centos-10 + filesystem: btrfs + - filesystem: btrfs + bootloader: grub-cc + - filesystem: btrfs + bootloader: systemd + boot_type: bls + - filesystem: btrfs + boot_type: uki + seal_state: unsealed + # For now only have grub-cc tests in F44 - test_os: fedora-45 bootloader: grub-cc @@ -445,10 +460,22 @@ jobs: matrix: test_os: ${{ fromJson(needs.compute-ci-level.outputs.upgrade_os_matrix) }} variant: [ostree, composefs] - # TODO: Re-enable this after 1.16.8 is released + filesystem: [xfs, ext4, btrfs] exclude: + # ostree installs on the image's default filesystem (xfs) + - variant: ostree + filesystem: ext4 + - variant: ostree + filesystem: btrfs + - variant: composefs + filesystem: xfs + # composefs runs on btrfs on Fedora, its default, and on ext4 on + # CentOS Stream, which doesn't ship btrfs - test_os: fedora-44 variant: composefs + filesystem: ext4 + - test_os: centos-10 + filesystem: btrfs runs-on: ubuntu-26.04 @@ -468,6 +495,7 @@ jobs: printf 'BOOTC_base=%s\n' "$BASE" >> "$GITHUB_ENV" printf 'BOOTC_buildroot_base=%s\n' "$BUILDROOT_BASE" >> "$GITHUB_ENV" echo "BOOTC_variant=${{ matrix.variant }}" >> $GITHUB_ENV + echo "BOOTC_filesystem=${{ matrix.filesystem }}" >> $GITHUB_ENV echo "BOOTC_SKIP_PACKAGE=1" >> $GITHUB_ENV echo "RUST_BACKTRACE=full" >> $GITHUB_ENV diff --git a/Justfile b/Justfile index 32123de29c..c23f160d33 100644 --- a/Justfile +++ b/Justfile @@ -38,7 +38,8 @@ ukiboot_img := base_img + "-ukiboot" # Build variant: ostree (default) or composefs variant := env("BOOTC_variant", "ostree") bootloader := env("BOOTC_bootloader", "grub") -# Only used for composefs tests +# Root filesystem for composefs test installs. Exported as BOOTC_filesystem, +# it also applies to ostree test installs, which otherwise use the image's default. filesystem := env("BOOTC_filesystem", "ext4") # Only used for composefs tests boot_type := env("BOOTC_boot_type", "bls") diff --git a/crates/xtask/src/bcvk.rs b/crates/xtask/src/bcvk.rs index 03791e6044..f78e8b542f 100644 --- a/crates/xtask/src/bcvk.rs +++ b/crates/xtask/src/bcvk.rs @@ -76,13 +76,17 @@ impl BcvkInstallOpts { /// and `--karg` flags. Note that `--bootloader` is only valid when /// `--composefs-backend` is also set (bcvk enforces this via a clap /// `requires` relationship). + /// + /// A filesystem that was asked for is passed for either backend. + /// Without one, composefs defaults to ext4 (it needs fs-verity), and + /// ostree uses the image's own default. pub(crate) fn install_args(&self) -> Vec { let mut args = Vec::new(); if self.composefs_backend { args.push("--composefs-backend".into()); } - if self.composefs_backend || self.composefs { - let fs = self.filesystem.as_deref().unwrap_or("ext4"); + let default_fs = (self.composefs_backend || self.composefs).then_some("ext4"); + if let Some(fs) = self.filesystem.as_deref().or(default_fs) { args.push(format!("--filesystem={fs}")); } if self.composefs_backend { @@ -140,14 +144,18 @@ mod tests { #[test] fn test_install_args() { - // (composefs_backend, composefs) => expected args - let cases: &[(bool, bool, &[&str])] = &[ - (false, false, &[]), + // (composefs_backend, composefs, filesystem) => expected args + let cases: &[(bool, bool, Option<&str>, &[&str])] = &[ + // ostree uses the image's default filesystem unless one is given + (false, false, None, &[]), + (false, false, Some("btrfs"), &["--filesystem=btrfs"]), // A composefs-native image selects the backend itself - (false, true, &["--filesystem=xfs"]), + (false, true, Some("xfs"), &["--filesystem=xfs"]), + (false, true, None, &["--filesystem=ext4"]), ( true, true, + Some("xfs"), &[ "--composefs-backend", "--filesystem=xfs", @@ -155,18 +163,18 @@ mod tests { ], ), ]; - for &(composefs_backend, composefs, expected) in cases { + for &(composefs_backend, composefs, filesystem, expected) in cases { let opts = BcvkInstallOpts { composefs_backend, composefs, bootloader: Some(Bootloader::Systemd), - filesystem: Some("xfs".into()), + filesystem: filesystem.map(Into::into), ..Default::default() }; assert_eq!( opts.install_args(), expected, - "composefs_backend={composefs_backend} composefs={composefs}" + "composefs_backend={composefs_backend} composefs={composefs} filesystem={filesystem:?}" ); } } diff --git a/crates/xtask/src/tmt.rs b/crates/xtask/src/tmt.rs index ba93f276ef..9bc8a7f6fa 100644 --- a/crates/xtask/src/tmt.rs +++ b/crates/xtask/src/tmt.rs @@ -633,7 +633,7 @@ pub(crate) fn run_tmt(sh: &Shell, args: &RunTmtArgs) -> Result<()> { ); } // Add --filesystem=xfs by default on fedora-coreos - if variant_id == "coreos" { + if variant_id == "coreos" && bcvk_opts.filesystem.is_none() { if distro.starts_with("fedora") { opts.push("--filesystem=xfs".to_string()); } diff --git a/docs/src/bootc-composefs.7.md b/docs/src/bootc-composefs.7.md index fba24e47f1..1dc1902e15 100644 --- a/docs/src/bootc-composefs.7.md +++ b/docs/src/bootc-composefs.7.md @@ -106,7 +106,7 @@ The following are supported with the composefs backend: [Bootloaders](bootc-bootloaders.7.md#composefs-backend). - Root filesystems with fs-verity support, and filesystems without it (such as XFS) with fs-verity made optional. Sealed images require fs-verity. - CI covers ext4 and XFS; btrfs is expected to work but is not tested. + CI covers ext4 and XFS, and btrfs on Fedora. - The [EROFS formats](#erofs-formats) and kernel arguments described above. - The image build commands `bootc container ukify`, `bootc container split-kernel-and-rootfs` and