summaryrefslogtreecommitdiffstats
path: root/instdata.py
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2003-08-15 20:38:28 +0000
committerMike Fulbright <msf@redhat.com>2003-08-15 20:38:28 +0000
commitbd2cc742780d3054ff7be143b8ce535c7f0c815b (patch)
treeec60071788698c9106e1be230b5004193f380c35 /instdata.py
parent71d57482995e470f5d8ccc2975fafa5b34ecfa22 (diff)
downloadanaconda-bd2cc742780d3054ff7be143b8ce535c7f0c815b.tar.gz
anaconda-bd2cc742780d3054ff7be143b8ce535c7f0c815b.tar.xz
anaconda-bd2cc742780d3054ff7be143b8ce535c7f0c815b.zip
implement RFE to put install source in anaconad-ks.cfg, bug #53277
Diffstat (limited to 'instdata.py')
-rw-r--r--instdata.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/instdata.py b/instdata.py
index 218612889..437c82347 100644
--- a/instdata.py
+++ b/instdata.py
@@ -13,6 +13,8 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
+import os
+import string
import language
import network
import firewall
@@ -130,6 +132,39 @@ class InstallData:
else:
f.write("install\n");
+ # figure out the install method and write out a line
+ if self.methodstr.startswith('ftp://') or self.methodstr.startswith('http://'):
+ f.write("url --url %s\n" % (self.methodstr,))
+ elif self.methodstr.startswith('cdrom://'):
+ f.write("cdrom\n")
+ elif self.methodstr.startswith('hd://'):
+ pidx = string.find(self.methodstr, '//') + 2
+ didx = string.find(self.methodstr[pidx:], '/')
+ partition = string.split(self.methodstr[pidx:pidx+didx], ':')[0]
+ dir = self.methodstr[pidx+didx+1:]
+ f.write("harddrive --partition=%s --dir=%s\n" % (partition, dir))
+ elif self.methodstr.startswith('nfs:/') or self.methodstr.startswith('nfsiso:'):
+ (method, tmpmntpt) = string.split(self.methodstr, ':')
+ # clean up extra '/' at front
+ if tmpmntpt[1] == '/':
+ rawmntpt = tmpmntpt[1:]
+ else:
+ rawmntpt = tmpmntpt
+ mntpt = os.path.normpath(rawmntpt)
+
+ # find mntpt in /proc/mounts so we can get NFS server info
+ fproc = open("/proc/mounts", "r")
+ lines = fproc.readlines()
+ fproc.close()
+
+ for l in lines:
+ minfo = string.split(l)
+ if len(minfo) > 1 and minfo[1] == mntpt:
+ nfsinfo = minfo[0]
+ (srv, dir) = string.split(nfsinfo, ':')
+ f.write("nfs --server=%s --dir=%s\n" % (srv, dir))
+ break
+
self.instLanguage.writeKS(f)
self.langSupport.writeKS(f)
if not self.isHeadless: