diff options
author | Jeremy Katz <katzj@redhat.com> | 2003-11-10 23:20:22 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2003-11-10 23:20:22 +0000 |
commit | 4ee37133eeac6ca6151a20d2ed883fa8f2d9c95c (patch) | |
tree | f7ef05ebde1b8998cf7045e17245db34390862f6 /isys | |
parent | 5a121bdca61522d786deb7dab5091e700c9b443d (diff) | |
download | anaconda-4ee37133eeac6ca6151a20d2ed883fa8f2d9c95c.tar.gz anaconda-4ee37133eeac6ca6151a20d2ed883fa8f2d9c95c.tar.xz anaconda-4ee37133eeac6ca6151a20d2ed883fa8f2d9c95c.zip |
add patch from Ajay Ramaswamy <xfs@ramaswamy.net> for jfs labels
Diffstat (limited to 'isys')
-rw-r--r-- | isys/isys.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/isys/isys.py b/isys/isys.py index b10c5f7c7..29b77b339 100644 --- a/isys/isys.py +++ b/isys/isys.py @@ -497,6 +497,32 @@ def readXFSLabel(device, makeDevNode = 1): label = readXFSLabel_int(device) return label +def readJFSLabel_int(device): + jfslabel = None + try: + fd = os.open(device, os.O_RDONLY) + except: + return jfslabel + + os.lseek(fd,32768,0) + buf = os.read(fd, 180) + os.close(fd) + + if (len(buf) == 180 and buf[0:4] == "JFS1"): + jfslabel = string.rstrip(buf[152:168],"\0x00") + + return jfslabel + +def readJFSLabel(device, makeDevNode = 1): + if makeDevNode: + makeDevInode(device, "/tmp/disk") + label = readJFSLabel_int("/tmp/disk") + os.unlink("/tmp/disk") + else: + label = readJFSLabel_int(device) + return label + + def readExt2Label(device, makeDevNode = 1): if makeDevNode: makeDevInode(device, "/tmp/disk") |