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
16 changes: 16 additions & 0 deletions crates/lib/src/bootc_composefs/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,22 @@ pub(crate) fn setup_composefs_bls_boot(
ComposefsCmdline::build(&id_hex, state.composefs_options.allow_missing_verity);
cmdline_options.extend(&Cmdline::from(&composefs_cmdline.to_string()));

// If there's a separate /boot partition, add a systemd.mount-extra
// karg so systemd mounts it after reboot. This avoids writing to
// /etc/fstab which conflicts with transient etc (see #1388).
if let Some(boot) = root_setup.boot_mount_spec() {
if !boot.source.is_empty() {
let mount_extra = format!(
"systemd.mount-extra={}:/boot:{}:{}",
boot.source,
boot.fstype,
boot.options.as_deref().unwrap_or("defaults"),
);
cmdline_options.extend(&Cmdline::from(mount_extra.as_str()));
tracing::debug!("Added /boot mount karg: {mount_extra}");
}
}

// Locate ESP partition device
let esp_part = root_setup.device_info.find_partition_of_esp()?;

Expand Down
5 changes: 5 additions & 0 deletions crates/lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,11 @@ impl RootSetup {
self.boot.as_ref().map(require_boot_uuid).transpose()
}

/// Get the boot mount spec, if a separate /boot partition exists.
pub(crate) fn boot_mount_spec(&self) -> Option<&MountSpec> {
self.boot.as_ref()
}

// Drop any open file descriptors and return just the mount path and backing luks device, if any
#[cfg(feature = "install-to-disk")]
fn into_storage(self) -> (Utf8PathBuf, Option<String>) {
Expand Down