summaryrefslogtreecommitdiffstats
path: root/harddrive.py
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2003-06-23 20:39:07 +0000
committerMike Fulbright <msf@redhat.com>2003-06-23 20:39:07 +0000
commitc3c6186f119894bedba234debf9caadf8ef04f03 (patch)
treea5a12d86c948b0c24ae5ce7cd122618c5d7c995d /harddrive.py
parent23882ef0f2a0d26cd645a740d31075e5a3a4defc (diff)
downloadanaconda-c3c6186f119894bedba234debf9caadf8ef04f03.tar.gz
anaconda-c3c6186f119894bedba234debf9caadf8ef04f03.tar.xz
anaconda-c3c6186f119894bedba234debf9caadf8ef04f03.zip
revert back to mounting source ISO partition as needed. Stage 2 is in RAM as before.
Diffstat (limited to 'harddrive.py')
-rw-r--r--harddrive.py38
1 files changed, 35 insertions, 3 deletions
diff --git a/harddrive.py b/harddrive.py
index f1dcf42fa..1ad7840de 100644
--- a/harddrive.py
+++ b/harddrive.py
@@ -48,6 +48,8 @@ class HardDriveInstallMethod(InstallMethod):
if (self.mediaIsMounted):
raise SystemError, "trying to mount already-mounted iso image!"
+ self.mountDirectory()
+
isoImage = self.isoDir + '/' + self.path + '/' + self.discImages[cdNum]
isys.makeDevInode("loop3", "/tmp/loop3")
@@ -62,8 +64,38 @@ class HardDriveInstallMethod(InstallMethod):
isys.umount(self.tree)
isys.makeDevInode("loop3", "/tmp/loop3")
isys.unlosetup("/tmp/loop3")
+ self.umountDirectory()
+ self.tree = None
self.mediaIsMounted = 0
+ # This mounts the directory containing the iso images, and places the
+ # mount point in self.isoDir. It's only used directly by __init__;
+ # everything else goes through mountMedia
+ def mountDirectory(self):
+ if (self.isoDirIsMounted):
+ raise SystemError, "trying to mount already-mounted image!"
+
+ f = open("/proc/mounts", "r")
+ l = f.readlines()
+ f.close()
+
+ for line in l:
+ s = string.split(line)
+ if s[0] == "/dev/" + self.device:
+ self.isoDir = s[1] + "/"
+ return
+
+ isys.mount(self.device, "/tmp/isodir", fstype = self.fstype,
+ readOnly = 1);
+ self.isoDir = "/tmp/isodir/"
+ self.isoDirIsMounted = 1
+
+ def umountDirectory(self):
+ if self.isoDirIsMounted:
+ isys.umount(self.isoDir)
+ self.tree = None
+ self.isoDirIsMounted = 0
+
def readCompsViaMethod(self, hdlist):
self.mountMedia(1)
fname = self.findBestFileMatch(self.tree, 'comps.xml')
@@ -137,12 +169,12 @@ class HardDriveInstallMethod(InstallMethod):
self.path = path
self.fstype = type
self.fnames = {}
+ self.isoDirIsMounted = 0
self.mediaIsMounted = 0
self.messageWindow = messageWindow
- # assumes that loader set this up properly as /tmp/isodir
- self.isoDir = "/tmp/hdimage"
-
# Go ahead and poke through the directory looking for interesting
# iso images
+ self.mountDirectory()
self.discImages = findIsoImages(self.isoDir + '/' + self.path, messageWindow)
+ self.umountDirectory()