mirror of
https://github.com/9001/copyparty.git
synced 2026-01-04 18:45:38 +10:00
fstab: deref fuseblk to real fs
This commit is contained in:
@@ -127,6 +127,24 @@ class Fstab(object):
|
|||||||
|
|
||||||
self.log("mtab has changed; reevaluating support for sparse files")
|
self.log("mtab has changed; reevaluating support for sparse files")
|
||||||
|
|
||||||
|
try:
|
||||||
|
fuses = [mp for mp, fs in dtab.items() if fs == "fuseblk"]
|
||||||
|
if not fuses or MACOS:
|
||||||
|
raise Exception()
|
||||||
|
try:
|
||||||
|
so, _ = chkcmd(["lsblk", "-nrfo", "FSTYPE,MOUNTPOINT"]) # centos6
|
||||||
|
except:
|
||||||
|
so, _ = chkcmd(["lsblk", "-nrfo", "FSTYPE,MOUNTPOINTS"]) # future
|
||||||
|
for ln in so.split("\n"):
|
||||||
|
zsl = ln.split(" ", 1)
|
||||||
|
if len(zsl) != 2:
|
||||||
|
continue
|
||||||
|
fs, mp = zsl
|
||||||
|
if mp in fuses:
|
||||||
|
dtab[mp] = fs
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
tab1 = list(dtab.items())
|
tab1 = list(dtab.items())
|
||||||
tab1.sort(key=lambda x: (len(x[0]), x[0]))
|
tab1.sort(key=lambda x: (len(x[0]), x[0]))
|
||||||
path1, fs1 = tab1[0]
|
path1, fs1 = tab1[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user