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
18 changes: 18 additions & 0 deletions crates/lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2053,6 +2053,24 @@ async fn install_to_filesystem_impl(
}
} else {
ostree_install(state, rootfs, cleanup).await?;

// For s390x, we set zipl as the bootloader
// this needs to be done after the ostree commit is deployed,
// as we don't want zipl to run during the initial ostree deployement.
if cfg!(target_arch = "s390x") {
Command::new("ostree")
.args([
"config",
"--repo",
"ostree/repo",
"set",
"sysroot.bootloader",
"zipl",
])
.cwd_dir(rootfs.physical_root.try_clone()?)
.run_capture_stderr()
.context("Setting bootloader config to zipl")?;
}
}

// As the very last step before filesystem finalization, do a full SELinux
Expand Down
5 changes: 3 additions & 2 deletions crates/lib/src/install/baseline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,15 +484,16 @@ pub(crate) fn install_create_rootfs(
}
}

bootc_mount::mount(&rootdev_path, &physical_root_path)?;
let fstype = &root_filesystem.to_string();
bootc_mount::mount_typed(&rootdev_path, fstype, &physical_root_path)?;
let target_rootfs = Dir::open_ambient_dir(&physical_root_path, cap_std::ambient_authority())?;
crate::lsm::ensure_dir_labeled(&target_rootfs, "", Some("/".into()), 0o755.into(), sepolicy)?;
let physical_root = Dir::open_ambient_dir(&physical_root_path, cap_std::ambient_authority())?;
let bootfs = physical_root_path.join("boot");
// Create the underlying mount point directory, which should be labeled
crate::lsm::ensure_dir_labeled(&target_rootfs, "boot", None, 0o755.into(), sepolicy)?;
if let Some(bootdev) = bootdev {
bootc_mount::mount(&bootdev.path(), &bootfs)?;
bootc_mount::mount_typed(&bootdev.path(), fstype, &bootfs)?;
}
// And we want to label the root mount of /boot
crate::lsm::ensure_dir_labeled(&target_rootfs, "boot", None, 0o755.into(), sepolicy)?;
Expand Down
13 changes: 13 additions & 0 deletions crates/mount/src/mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,19 @@ pub fn mount(dev: &str, target: &Utf8Path) -> Result<()> {
.run_inherited_with_cmd_context()
}

/// Mount a device with an explicit filesystem type.
///
/// This avoids relying on the `mount` utility's blkid auto-detection,
/// which can fail in certain container environments (e.g. when the
/// required filesystem kernel module is not yet loaded and the blkid
/// probe doesn't work, causing mount to fall back to iterating
/// `/etc/filesystems` and `/proc/filesystems`).
pub fn mount_typed(dev: &str, fstype: &str, target: &Utf8Path) -> Result<()> {
Command::new("mount")
.args(["-t", fstype, dev, target.as_str()])
.run_inherited_with_cmd_context()
}

/// If the fsid of the passed path matches the fsid of the same path rooted
/// at /proc/1/root, it is assumed that these are indeed the same mounted
/// filesystem between container and host.
Expand Down
10 changes: 10 additions & 0 deletions tmt/tests/booted/readonly/052-test-bli-detection.nu
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ if not ($os_id == "fedora" and $version_id >= 43) {
exit 0
}

# DPS root discovery only works when bootc install to-disk created the
# partitions with DPS type GUIDs. In Packit/gating CI the system was
# installed via to-existing-root on pre-existing partitions, so skip.
# BCVK_EXPORT=1 is set by xtask when running via bcvk (image-mode).
if ($env.BCVK_EXPORT? | default "" | is-empty) {
print "# skip: not running in image-mode (BCVK_EXPORT not set)"
tap ok
exit 0
}

print $"Running on ($os_id) ($version_id), checking DPS root discovery"

let cmdline = (open /proc/cmdline)
Expand Down
Loading