Skip to content
Draft
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
1 change: 0 additions & 1 deletion contrib/packaging/switch-to-sdboot
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ done
if [ "${#pkgs_to_remove[@]}" -gt 0 ]; then
rpm -e "${pkgs_to_remove[@]}"
fi
rm -vrf /usr/lib/bootupd/updates

# First install the unsigned systemd-boot RPM to get the package in place
rpm -Uvh --replacepkgs "${src}"/*.rpm
Expand Down
13 changes: 13 additions & 0 deletions crates/lib/src/bootloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use cap_std_ext::dirext::CapStdExtDirExt;
use fn_error_context::context;

use bootc_mount as mount;
use rustix::fs::statfs;

use crate::bootc_composefs::boot::{MountedImageRoot, SecurebootKeys};
use crate::utils;
Expand Down Expand Up @@ -46,6 +47,18 @@ const BOOTCTL_RANDOM_SEED_MIN_VERSION: u32 = 257;
/// in place (bootupd will overwrite them during installation).
// TODO: clean all ESPs on multi-device setups
pub(crate) fn mount_esp_part(root: &Dir, root_path: &Utf8Path, is_ostree: bool) -> Result<()> {
// systemd-gpt-auto-generator automounts ESP at /boot
let is_boot_mountpoint = root.is_mountpoint("boot")?;

if matches!(is_boot_mountpoint, Some(true)) {
let statfs = statfs(root_path.join("boot").as_std_path())?;

// We probably don't need to be this thorough, but no harm done
if statfs.f_type == libc::MSDOS_SUPER_MAGIC {
return Ok(());
}
}

let efi_path = Utf8Path::new(crate::install::BOOT).join(crate::bootloader::EFI_DIR);
let Some(esp_fd) = root
.open_dir_optional(&efi_path)
Expand Down
Loading
Loading