summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fsset.py26
-rw-r--r--image.py7
-rw-r--r--packages.py15
3 files changed, 37 insertions, 11 deletions
diff --git a/fsset.py b/fsset.py
index b7f1ac731..56a21e190 100644
--- a/fsset.py
+++ b/fsset.py
@@ -495,6 +495,32 @@ class FileSystemSet:
entry.mountpoint, msg))
sys.exit(0)
+ def filesystemSpace(self, chroot='/'):
+ space = []
+ # XXX limit to ext[23] etc?
+ for entry in self.entries:
+ if not entry.isMounted():
+ continue
+ path = "%s/%s" % (chroot, entry.mountpoint)
+ try:
+ space.append((entry.mountpoint, isys.fsSpaceAvailable(path)))
+ except SystemError:
+ pass
+
+ def spaceSort(a, b):
+ (m1, s1) = a
+ (m2, s2) = b
+
+ if (s1 > s2):
+ return -1
+ elif s1 < s2:
+ return 1
+
+ return 0
+
+ space.sort(spaceSort)
+ return space
+
def umountFilesystems(self, instPath, ignoreErrors = 0):
# XXX remove special case
try:
diff --git a/image.py b/image.py
index 315695df7..be540d732 100644
--- a/image.py
+++ b/image.py
@@ -43,7 +43,7 @@ class CdromInstallMethod(ImageInstallMethod):
"%s/RedHat/base/stage2.img" % self.tree)
self.loopbackFile = None
- def systemMounted(self, fstab, mntPoint, selected):
+ def systemMounted(self, fsset, chroot, selected):
changeloop=0
for p in selected:
if p[1000002] and p[1000002] > 1:
@@ -52,8 +52,9 @@ class CdromInstallMethod(ImageInstallMethod):
if changeloop == 0:
return
- self.loopbackFile = mntPoint + fstab.filesystemSpace(mntPoint)[0][0] + \
- "/rhinstall-stage2.img"
+ self.loopbackFile = "%s%s%s" % (chroot,
+ fsset.filesystemSpace(chroot)[0][0],
+ "/rhinstall-stage2.img")
try:
iutil.copyFile("%s/RedHat/base/stage2.img" % self.tree,
diff --git a/packages.py b/packages.py
index b9da7961e..9780521e5 100644
--- a/packages.py
+++ b/packages.py
@@ -358,7 +358,9 @@ def doInstall(method, id, intf, instPath):
id.hdList['krb5-libs'].selected = 1
xserver = id.videocard.primaryCard().getXServer()
- if xserver and id.comps.packages.has_key('XFree86') and id.comps.packages['XFree86'].selected and xserver != "XFree86":
+ if (xserver and id.comps.packages.has_key('XFree86')
+ and id.comps.packages['XFree86'].selected
+ and xserver != "XFree86"):
try:
id.hdList['XFree86-' + xserver[5:]].selected = 1
except ValueError, message:
@@ -376,10 +378,9 @@ def doInstall(method, id, intf, instPath):
f = open(instPath + "/etc/mtab", "w+")
f.close()
- # XXX
- #if method.systemMounted (fstab, instPath, id.hdList.selected()):
- #fstab.umountFilesystems(instPath)
- #return 1
+ if method.systemMounted (id.fsset, instPath, id.hdList.selected()):
+ id.fsset.umountFilesystems(instPath)
+ return 1
for i in ( '/var', '/var/lib', '/var/lib/rpm', '/tmp', '/dev', '/etc',
'/etc/sysconfig', '/etc/sysconfig/network-scripts',
@@ -666,7 +667,6 @@ def doInstall(method, id, intf, instPath):
# needed for prior systems which were not xinetd based
migrateXinetd(instPath, instLogName)
- # XXX
if flags.setupFilesystems:
errors = None
@@ -713,8 +713,7 @@ def doInstall(method, id, intf, instPath):
w.set(6)
- # XXX
- #self.instClass.postAction(instPath, self.serial)
+ self.instClass.postAction(instPath, flags.serial)
w.set(7)