Skip to content

Commit 953628b

Browse files
authored
Merge pull request #1233 from cgwalters/remove-entries-no-context
install: Avoid context-per-recursion
2 parents 4df9fa4 + abf0d76 commit 953628b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/src/install.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,6 @@ fn require_empty_rootdir(rootfs_fd: &Dir) -> Result<()> {
15901590
/// Remove all entries in a directory, but do not traverse across distinct devices.
15911591
/// If mount_err is true, then an error is returned if a mount point is found;
15921592
/// otherwise it is silently ignored.
1593-
#[context("Removing entries (noxdev)")]
15941593
fn remove_all_in_dir_no_xdev(d: &Dir, mount_err: bool) -> Result<()> {
15951594
for entry in d.entries()? {
15961595
let entry = entry?;
@@ -1623,15 +1622,16 @@ fn clean_boot_directories(rootfs: &Dir, is_ostree: bool) -> Result<()> {
16231622
.context("removing bootupd-state.json")?;
16241623
} else {
16251624
// This should not remove /boot/efi note.
1626-
remove_all_in_dir_no_xdev(&bootdir, false)?;
1625+
remove_all_in_dir_no_xdev(&bootdir, false).context("Emptying /boot")?;
16271626
// TODO: Discover the ESP the same way bootupd does it; we should also
16281627
// support not wiping the ESP.
16291628
if ARCH_USES_EFI {
16301629
if let Some(efidir) = bootdir
16311630
.open_dir_optional(crate::bootloader::EFI_DIR)
16321631
.context("Opening /boot/efi")?
16331632
{
1634-
remove_all_in_dir_no_xdev(&efidir, false)?;
1633+
remove_all_in_dir_no_xdev(&efidir, false)
1634+
.context("Emptying EFI system partition")?;
16351635
}
16361636
}
16371637
}

0 commit comments

Comments
 (0)