diff options
author | Jeremy Katz <katzj@redhat.com> | 2004-09-27 19:29:59 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2004-09-27 19:29:59 +0000 |
commit | 7e18ebe28650324292a6911f12763a9f61f6f6fa (patch) | |
tree | 54359a22a52690f9f8b1a8a9c82e20e4fd7ba855 /fsset.py | |
parent | 367ca94f3875d4ce8f60c46a3f1a02fdfab1a133 (diff) | |
download | anaconda-7e18ebe28650324292a6911f12763a9f61f6f6fa.tar.gz anaconda-7e18ebe28650324292a6911f12763a9f61f6f6fa.tar.xz anaconda-7e18ebe28650324292a6911f12763a9f61f6f6fa.zip |
2004-09-27 Jeremy Katz <katzj@redhat.com>
* fsset.py (swapFileSystem.mount): Skip version 0 swaps (#122101)
Diffstat (limited to 'fsset.py')
-rw-r--r-- | fsset.py | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -696,6 +696,26 @@ class swapFileSystem(FileSystemType): self.supported = 1 def mount(self, device, mountpoint, readOnly=0, bindMount=0): + pagesize = isys.getpagesize() + buf = None + if pagesize > 2048: + num = pagesize + else: + num = 2048 + try: + fd = os.open(dev, os.O_RDONLY) + buf = os.read(fd, num) + os.close(fd) + except: + pass + + # FIXME: we should ask if they want to reinitialize swaps that + # are of format 0 (#122101) + if buf is not None and len(buf) == pagesize: + if buf[pagesize - 10:] == "SWAP-SPACE": + log("SWAP is of format 0, skipping it") + return + isys.swapon (device) def umount(self, device, path): |