mount: fix iPod automount (lsblk flags + udisks suffixed paths)
Two bugs kept the connected iPod from being auto-mounted: - `lsblk -o PATH,LABEL -n -l -P` is invalid (--pairs and --list are mutually exclusive), so device lookup by label always failed with "no block device found" — a regression from the earlier parse fix. Drop -l. - udisks mounted the iPod volume at /media/sebastian/IPOD1 because the configured directory /media/sebastian/IPOD already exists, so even a resolved device failed with AlreadyMounted. The configured mount point is now treated as a hint: mounted_path_for() resolves an exact mount or the lowest-numbered udisks-suffixed sibling (IPOD → IPOD1) from /proc/self/mountinfo, and the sync destination, storage stats, settings display and fatsort resolution all use the real mount. Also harden fatsort: resolve_fatsort_target now refuses to run when the path is not a mount point, so findmnt can never fall back to the root filesystem's block device. Verified on the connected iPod: mounted_path_for → IPOD1, resolve_block_device → /dev/sdb2, mount_device → "already mounted at /media/sebastian/IPOD1", UI shows ● mounted with 9.7 GiB free · 92% and mount point ✓ /media/sebastian/IPOD1. Bump to 0.3.3.
This commit is contained in:
+3
-1
@@ -122,12 +122,14 @@ pub struct Config {
|
||||
|
||||
impl Config {
|
||||
/// Refresh `Device::mounted` from the kernel mount table (no subprocess).
|
||||
/// A device counts as mounted when its volume is mounted at the configured
|
||||
/// path or at a udisks-suffixed sibling (e.g. `IPOD` → `IPOD1`).
|
||||
pub fn refresh_mounts(&mut self) {
|
||||
for d in self.devices.iter_mut() {
|
||||
d.mounted = d
|
||||
.mount_point
|
||||
.as_deref()
|
||||
.map(crate::disk::is_mounted)
|
||||
.map(|p| crate::disk::mounted_path_for(p).is_some())
|
||||
.unwrap_or(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user