Skip to content

Commit 9eb80ce

Browse files
alexlarssoncgwalters
authored andcommitted
install-to-filesystem: Allow /boot to be missing in target
When we're currently checking if /boot is a mountpoint we ware failing if /boot is missing. In the automotive usecase, with aboot, neither /boot or /boot/EFI are real partitions, so when bootc-image-builder runs there will be no mounts anywhere under /boot, which means bootc errors out with: ``` No /boot directory found in root; this is is currently required. ``` This isn't necessary, we can just continue on with boot_is_mount as false in this case. Note: Things later fail in bootupd, but that can be fixed separately. Signed-off-by: Alexander Larsson <alexl@redhat.com>
1 parent 47e2bcc commit 9eb80ce

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

crates/lib/src/install.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2412,15 +2412,15 @@ pub(crate) async fn install_to_filesystem(
24122412
tracing::debug!("Root mount: {} {:?}", root_info.mount_spec, root_info.kargs);
24132413

24142414
let boot_is_mount = {
2415-
let root_dev = rootfs_fd.dir_metadata()?.dev();
2416-
let boot_dev = target_rootfs_fd
2417-
.symlink_metadata_optional(BOOT)?
2418-
.ok_or_else(|| {
2419-
anyhow!("No /{BOOT} directory found in root; this is is currently required")
2420-
})?
2421-
.dev();
2422-
tracing::debug!("root_dev={root_dev} boot_dev={boot_dev}");
2423-
root_dev != boot_dev
2415+
if let Some(boot_metadata) = target_rootfs_fd.symlink_metadata_optional(BOOT)? {
2416+
let root_dev = rootfs_fd.dir_metadata()?.dev();
2417+
let boot_dev = boot_metadata.dev();
2418+
tracing::debug!("root_dev={root_dev} boot_dev={boot_dev}");
2419+
root_dev != boot_dev
2420+
} else {
2421+
tracing::debug!("No /{BOOT} directory found");
2422+
false
2423+
}
24242424
};
24252425
// Find the UUID of /boot because we need it for GRUB.
24262426
let boot_uuid = if boot_is_mount {

0 commit comments

Comments
 (0)