summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2007-12-03 15:50:45 -0500
committerJeremy Katz <katzj@redhat.com>2007-12-03 15:50:45 -0500
commit67dd982d2d5b3a07718b79efaa926c092685c083 (patch)
tree16e44c871ee9b0e92e3346285e321ecedbcf1f89 /isys
parentd6b03ab77abcf68c9dbb9f0c674c7dbf3548b786 (diff)
downloadanaconda-67dd982d2d5b3a07718b79efaa926c092685c083.tar.gz
anaconda-67dd982d2d5b3a07718b79efaa926c092685c083.tar.xz
anaconda-67dd982d2d5b3a07718b79efaa926c092685c083.zip
Probe for LVM fstype since we don't get that out of libblkid (#409321)
Diffstat (limited to 'isys')
-rw-r--r--isys/isys.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/isys/isys.py b/isys/isys.py
index 691c1d579..2519db034 100644
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -779,7 +779,30 @@ def readFSLabel(device, makeDevNode = 1):
return label
def readFSType(device):
- return _isys.getblkid(device, "TYPE")
+ fstype = _isys.getblkid(device, "TYPE")
+ if fstype is None:
+ # FIXME: libblkid doesn't show physical volumes as having a filesystem
+ # so let's sniff for that.(#409321)
+ try:
+ fd = os.open(device, os.O_RDONLY)
+ buf = os.read(fd, 2048)
+ except:
+ return fstype
+ finally:
+ try:
+ os.close(fd)
+ except:
+ pass
+
+ if buf.startswith("HM"):
+ return "physical volume (LVM)"
+ for sec in range(0, 4):
+ off = (sec * 512) + 24
+ if len(buf) < off:
+ continue
+ if buf[off:].startswith("LVM2"):
+ return "physical volume (LVM)"
+ return fstype
def ext2Clobber(device, makeDevNode = 1):
_isys.e2fsclobber(device)