summaryrefslogtreecommitdiffstats
path: root/textw
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 /textw
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 'textw')
-rw-r--r--textw/partitioning_text.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/textw/partitioning_text.py b/textw/partitioning_text.py
index 56e85aef5..0d4455e4b 100644
--- a/textw/partitioning_text.py
+++ b/textw/partitioning_text.py
@@ -296,7 +296,29 @@ class LoopSizeWindow:
if not todo.fstab.rootOnLoop():
return INSTALL_NOOP
- avail = apply(isys.spaceAvailable, todo.fstab.getRootDevice())
+ rootdev = 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
+
(size, swapSize) = todo.fstab.getLoopbackSize()
if not size:
size = avail / 2