summaryrefslogtreecommitdiffstats
path: root/anaconda
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2008-02-29 17:16:53 -0500
committerChris Lumens <clumens@redhat.com>2008-03-04 13:00:32 -0500
commitd7b4046e681189d6d96668471454f5fe448ccdbe (patch)
tree872bd58bd2864fec1bcbb01f8d24eb0e6f6b331a /anaconda
parentcd8a7a03397f431649f113936ffee6025dc90c33 (diff)
downloadanaconda-d7b4046e681189d6d96668471454f5fe448ccdbe.tar.gz
anaconda-d7b4046e681189d6d96668471454f5fe448ccdbe.tar.xz
anaconda-d7b4046e681189d6d96668471454f5fe448ccdbe.zip
Update the method string handling for NFS and URL installs.
yum doesn't understand nfs: and nfsiso: URLs, so we've been mangling them early in the anaconda file. Now with stage2=, we need to do this later because in the NFS case, we won't have the source repo mounted. Delay the mangling until we're doing repo setup, which is also where the NFS source will get mounted.
Diffstat (limited to 'anaconda')
-rwxr-xr-xanaconda26
1 files changed, 16 insertions, 10 deletions
diff --git a/anaconda b/anaconda
index a0fd789f5..0f2a14429 100755
--- a/anaconda
+++ b/anaconda
@@ -558,22 +558,28 @@ class Anaconda:
# real URIs, though.
self._loaderMethodstr = methodstr
- if methodstr.startswith("nfs://"):
- self.methodstr = "file:///" + methodstr[6:]
- elif methodstr.startswith("nfsiso:/"):
- self.methodstr = "file://" + methodstr[8:]
- elif methodstr.startswith("cdrom://"):
- (device, tree) = string.split(methodstr[8:], ":", 1)
+ # Make a best guess at where the repo is by trimming off the image file
+ # from the end. If this doesn't work, we've got repo reconfig screens
+ # to use later on.
+ if methodstr.endswith(".img"):
+ try:
+ m = methodstr[:methodstr.rindex("/")]
+ m = m[:m.rindex("/")]
+ except:
+ m = methodstr
+ else:
+ m = methodstr
+
+ if m.startswith("cdrom://"):
+ (device, tree) = string.split(m[8:], ":", 1)
if not tree.startswith("/"):
tree = "/%s" %(tree,)
self.mediaDevice = device
self.methodstr = "file://" + tree
- elif methodstr.startswith("hd://"):
- self.methodstr = "file:///mnt/source"
else:
- self.methodstr = methodstr
+ self.methodstr = m
def writeMethodstr(self, f):
import urllib
@@ -588,7 +594,7 @@ class Anaconda:
partition = string.split(self._loaderMethodstr[pidx:pidx+didx], ':')[0]
dir = self._loaderMethodstr[pidx+didx+1:]
f.write("harddrive --partition=%s --dir=%s\n" % (partition, dir))
- elif self._loaderMethodstr.startswith('nfs:/') or self._loaderMethodstr.startswith('nfsiso:'):
+ elif self._loaderMethodstr.startswith('nfs:') or self._loaderMethodstr.startswith('nfsiso:'):
(method, tmpmntpt) = string.split(self._loaderMethodstr, ':')
# clean up extra '/' at front
if tmpmntpt[1] == '/':