diff options
author | Chris Lumens <clumens@redhat.com> | 2008-03-13 16:01:45 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2008-03-13 16:01:45 -0400 |
commit | 4df2e30c9e1d9711eb96ff930dbad46eca99acb2 (patch) | |
tree | e1b442fbc6ed464d9b138893ae52a76ab24d042d | |
parent | 169b3a293dc5cbabff289e3fc719a2ffbadbc95c (diff) | |
download | anaconda-4df2e30c9e1d9711eb96ff930dbad46eca99acb2.tar.gz anaconda-4df2e30c9e1d9711eb96ff930dbad46eca99acb2.tar.xz anaconda-4df2e30c9e1d9711eb96ff930dbad46eca99acb2.zip |
Fix the format of the method=hd: parameter.
-rwxr-xr-x | anaconda | 7 | ||||
-rw-r--r-- | image.py | 4 | ||||
-rw-r--r-- | instdata.py | 4 | ||||
-rw-r--r-- | loader2/hdinstall.c | 10 |
4 files changed, 12 insertions, 13 deletions
@@ -583,11 +583,8 @@ class Anaconda: f.write("url --url %s\n" % urllib.unquote(self._loaderMethodstr)) elif self._loaderMethodstr.startswith('cdrom://'): f.write("cdrom\n") - elif self._loaderMethodstr.startswith('hd://'): - pidx = string.find(self._loaderMethodstr, '//') + 2 - didx = string.find(self._loaderMethodstr[pidx:], '/') - partition = string.split(self._loaderMethodstr[pidx:pidx+didx], ':')[0] - dir = self._loaderMethodstr[pidx+didx+1:] + elif self._loaderMethodstr.startswith('hd:'): + (method, partition, dir) = string.split(self._loaderMethodstr, ':') f.write("harddrive --partition=%s --dir=%s\n" % (partition, dir)) elif self._loaderMethodstr.startswith('nfs:') or self._loaderMethodstr.startswith('nfsiso:'): (method, server, dir) = string.split(self._loaderMethodstr, ':') @@ -129,8 +129,8 @@ def getMediaId(path): # This mounts the directory containing the iso images, and places the # mount point in isodir. def mountDirectory(isodir, methodstr, messageWindow): - if methodstr.startswith("hd://"): - method = methodstr[5:] + if methodstr.startswith("hd:"): + method = methodstr[3:] (device, fstype, path) = method.split(":", 3) device = method[0:method.index(":")] else: diff --git a/instdata.py b/instdata.py index a48c44478..bf5300a04 100644 --- a/instdata.py +++ b/instdata.py @@ -100,8 +100,8 @@ class InstallData: stat.S_ISBLK(os.stat("/dev/live")[stat.ST_MODE]): target = os.readlink("/dev/live") self.partitions.protected = [target] - elif self.anaconda._loaderMethodstr.startswith("hd://"): - method = self.anaconda._loaderMethodstr[5:] + elif self.anaconda._loaderMethodstr.startswith("hd:"): + method = self.anaconda._loaderMethodstr[3:] device = method.split(":", 3)[0] self.partitions.protected = [device] diff --git a/loader2/hdinstall.c b/loader2/hdinstall.c index 4a633aa3c..d8b12af99 100644 --- a/loader2/hdinstall.c +++ b/loader2/hdinstall.c @@ -202,8 +202,9 @@ static char * setupIsoImages(char * device, char * dirName, char * location) { flags &= ~LOADER_FLAGS_STAGE2; goto err; } else { - rc = asprintf(&url, "hd://%s:%s:/%s", device, *type, - dirName ? dirName : "."); + rc = asprintf(&url, "hd:%.*s:%s:/%s", + (int) (strrchr(device, '/') - device), + device, *type, dirName ? dirName : "."); return url; } } @@ -228,8 +229,9 @@ static char * setupIsoImages(char * device, char * dirName, char * location) { } else { queryIsoMediaCheck(path); free(path); - rc = asprintf(&url, "hd://%s:%s:/%s", device, *type, - dirName ? dirName : "."); + rc = asprintf(&url, "hd:%.*s:%s:/%s", + (int) (strrchr(device, '/') - device), + device, *type, dirName ? dirName : "."); return url; } } |