1use {
2 lfs_core::Mount,
3 std::path::Path,
4};
5
6pub fn is_normal(m: &Mount) -> bool {
9 (
10 m.stats().is_some()
11 || m.is_unreachable()
12 )
13 && (
14 m.disk.is_some() || m.info.fs_type == "zfs" || m.info.is_remote()
17 )
18 && m.disk.as_ref().is_none_or(|d| !d.image) && !m.info.bound && m.info.fs_type != "squashfs" && !is_system_path(&m.info.mount_point)
22}
23
24#[cfg(target_os="macos")]
25fn is_system_path(path: &Path) -> bool {
26 let Some(path) = path.to_str() else { return false; };
27 if path == "/" {
28 return true;
29 }
30 path.starts_with("/System")
31 && !path.starts_with("/System/Volumes/Data")
32}
33
34#[cfg(target_os="linux")]
35fn is_system_path(path: &Path) -> bool {
36 path.starts_with("/boot")
37}