summaryrefslogtreecommitdiffstats
path: root/iw
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2001-01-25 00:22:48 +0000
committerMike Fulbright <msf@redhat.com>2001-01-25 00:22:48 +0000
commita533cb6ac95d34ec6094ce3b2c7e676baadffe92 (patch)
tree33243fe3085e383e9a20af7faf12853598fd5e9a /iw
parent0a6cc166e218ac1f265926a6f6e7f71a0cb9f3cd (diff)
downloadanaconda-a533cb6ac95d34ec6094ce3b2c7e676baadffe92.tar.gz
anaconda-a533cb6ac95d34ec6094ce3b2c7e676baadffe92.tar.xz
anaconda-a533cb6ac95d34ec6094ce3b2c7e676baadffe92.zip
fix handling of space calc to include existing redhat.img and rh-swap.img on installs
Diffstat (limited to 'iw')
-rw-r--r--iw/rootpartition_gui.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/iw/rootpartition_gui.py b/iw/rootpartition_gui.py
index 6d2496f4b..71f17fc7e 100644
--- a/iw/rootpartition_gui.py
+++ b/iw/rootpartition_gui.py
@@ -183,7 +183,28 @@ class LoopSizeWindow(InstallWindow):
def getScreen (self):
# XXX error check mount that this check tries
if self.todo.setupFilesystems:
- avail = apply(isys.spaceAvailable, self.todo.fstab.getRootDevice())
+ rootdev = self.todo.fstab.getRootDevice()
+ avail = apply(isys.spaceAvailable, rootdev)
+
+ # add in size of loopback files if they exist
+ extra = 0
+ try:
+ import os, stat
+ isys.mount(rootdev[0], "/mnt/space", fstype = rootdev[1])
+ extra = extra + os.stat("/mnt/space/redhat.img")[stat.ST_SIZE]
+ extra = extra + os.stat("/mnt/space/rh-swap.img")[stat.ST_SIZE]
+ isys.umount("/mnt/space")
+ except:
+ pass
+
+ # do this separate since we dont know when above failed
+ try:
+ isys.umount("/mnt/space")
+ except:
+ pass
+
+ extra = extra / 1024 / 1024
+ avail = avail + extra
else:
# test mode
avail = 5000