summaryrefslogtreecommitdiffstats
path: root/instdata.py
diff options
context:
space:
mode:
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: