diff options
author | David Cantrell <dcantrell@redhat.com> | 2006-03-22 16:36:34 +0000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2006-03-22 16:36:34 +0000 |
commit | 2b41b5cd1e14ee449256ab335d89b9007c5e1b4f (patch) | |
tree | 26a01f495e01771d57a78e8d7f0eda7258fb2f72 /isys | |
parent | 939097ac2a4f340831238935595a98a4be4d7d99 (diff) | |
download | anaconda-2b41b5cd1e14ee449256ab335d89b9007c5e1b4f.tar.gz anaconda-2b41b5cd1e14ee449256ab335d89b9007c5e1b4f.tar.xz anaconda-2b41b5cd1e14ee449256ab335d89b9007c5e1b4f.zip |
* fsset.py (reiserfsFileSystem): Added missing labelDevice method.
(#183183).
* fsset.py (LabelFactory): Added isLabelReserved method (#183183).
* fsset.py (FileSystemSet.labelDevice): Call isLabelReserved in the
label factory to see if we should relabel the device. Handles weird
corner cases with existing partitions (#183183).
* isys/isys.py (readReiserFSLabel_int): Problem reading reiserfs
labels, moved label reading code to _inside_ the for loop so it
actually does some thing useful (#183183).
Diffstat (limited to 'isys')
-rw-r--r-- | isys/isys.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/isys/isys.py b/isys/isys.py index 0931ad6bd..b1b098a6d 100644 --- a/isys/isys.py +++ b/isys/isys.py @@ -675,7 +675,20 @@ def readReiserFSLabel_int(device): os.lseek(fd, start, 0) # read 120 bytes to get s_magic and s_label buf = os.read(fd, 120) + + # see if this block is the superblock + # this reads reiserfs_super_block_v1.s_magic as defined + # in include/reiserfs_fs.h in the reiserfsprogs source + m = string.rstrip(buf[52:61], "\0x00") + if m == "ReIsErFs" or m == "ReIsEr2Fs" or m == "ReIsEr3Fs": + # this reads reiserfs_super_block.s_label as + # defined in include/reiserfs_fs.h + label = string.rstrip(buf[100:116], "\0x00") + os.close(fd) + return label except OSError, e: + # [Error 22] probably means we're trying to read an + # extended partition. log.debug("error reading reiserfs label on %s: %s" %(device, e)) try: @@ -685,16 +698,6 @@ def readReiserFSLabel_int(device): return label - # see if this block is the superblock - # this reads reiserfs_super_block_v1.s_magic as defined - # in include/reiserfs_fs.h in the reiserfsprogs source - magic = string.rstrip(buf[52:61], "\0x00") - if magic == "ReIsErFs" or magic == "ReIsEr2Fs" or magic == "ReIsEr3Fs": - # this reads reiserfs_super_block.s_label as - # defined in include/reiserfs_fs.h - label = string.rstrip(buf[100:116], "\0x00") - - os.close(fd) return label def readReiserFSLabel(device, makeDevNode = 1): |