Skip to content

Commit 3a1f691

Browse files
committed
docs: clarify package_mode_copy_to_boot; better statvfs errors. Use anyhow context for statvfs failures instead of raw_os_error.
AI-assisted: implementation reviewed by Claude. Some suggestions was added.
1 parent e4205a5 commit 3a1f691

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/component.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub(crate) trait Component {
8686
/// Locating efi vendor dir
8787
fn get_efi_vendor(&self, sysroot: &Path) -> Result<Option<String>>;
8888

89-
/// Copy from /usr/lib/efi to boot/ESP (package mode)
89+
/// Merge `/usr/lib/efi` onto the ESP for package-mode systems (EFI components only).
9090
fn package_mode_copy_to_boot(&self, root: &Path) -> Result<()>;
9191
}
9292

src/efi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ impl Component for Efi {
854854
}
855855
}
856856

857-
/// Package mode copy: Simple copy from /usr/lib/efi to boot/ESP.
857+
/// Package mode: merge `/usr/lib/efi` onto the ESP (write alongside, then atomic rename).
858858
fn package_mode_copy_to_boot(&self, root: &Path) -> Result<()> {
859859
self.package_mode_copy_to_boot_impl(root)
860860
}

src/util.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ pub(crate) fn available_space_bytes(dir: &openat::Dir) -> Result<u64> {
6363

6464
pub(crate) fn ensure_writable_mount<P: AsRef<Path>>(p: P) -> Result<()> {
6565
let p = p.as_ref();
66-
let stat =
67-
rustix::fs::statvfs(p).map_err(|e| std::io::Error::from_raw_os_error(e.raw_os_error()))?;
66+
let stat = rustix::fs::statvfs(p).with_context(|| format!("statvfs {:?}", p))?;
6867
if !stat.f_flag.contains(rustix::fs::StatVfsMountFlags::RDONLY) {
6968
return Ok(());
7069
}

0 commit comments

Comments
 (0)