Skip to content

Commit f6b7ec8

Browse files
authored
install: read boot entry from /etc/fstab and write to new created (#1856)
bootc deployment On rawhide, the /boot is subvol instead of separate partition, we need to use the same option in the created deployment. Fixes #1849 Signed-off-by: Huijing Hei <hhei@redhat.com>
1 parent f7b41cc commit f6b7ec8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

crates/lib/src/install.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,9 +2235,15 @@ pub(crate) async fn install_to_filesystem(
22352235
Some(MountSpec::new(&spec, "/boot"))
22362236
}
22372237
} else {
2238-
boot_uuid
2239-
.as_deref()
2240-
.map(|boot_uuid| MountSpec::new_uuid_src(boot_uuid, "/boot"))
2238+
// Read /etc/fstab to get boot entry, but only use it if it's UUID-based
2239+
// Otherwise fall back to boot_uuid
2240+
read_boot_fstab_entry(&rootfs_fd)?
2241+
.filter(|spec| spec.get_source_uuid().is_some())
2242+
.or_else(|| {
2243+
boot_uuid
2244+
.as_deref()
2245+
.map(|boot_uuid| MountSpec::new_uuid_src(boot_uuid, "/boot"))
2246+
})
22412247
};
22422248
// Ensure that we mount /boot readonly because it's really owned by bootc/ostree
22432249
// and we don't want e.g. apt/dnf trying to mutate it.

0 commit comments

Comments
 (0)