Skip to content
Merged
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
36 changes: 32 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -326,15 +326,30 @@ 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
boot_type: uki
- 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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
3 changes: 2 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
26 changes: 17 additions & 9 deletions crates/xtask/src/bcvk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
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 {
Expand Down Expand Up @@ -140,33 +144,37 @@ 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",
"--bootloader=systemd",
],
),
];
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:?}"
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/xtask/src/tmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/bootc-composefs.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading