summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--installclass.py10
-rw-r--r--iw/mouse.py1
-rw-r--r--kickstart.py71
-rw-r--r--todo.py21
4 files changed, 99 insertions, 4 deletions
diff --git a/installclass.py b/installclass.py
index 29f34a77f..b4d491d34 100644
--- a/installclass.py
+++ b/installclass.py
@@ -138,6 +138,12 @@ class InstallClass:
return (self.bootProto, self.ip, self.netmask, self.gateway,
self.nameserver)
+ def setLanguage(self, lang):
+ self.language = lang
+
+ def setKeyboard(self, kb):
+ self.keyboard = kb
+
def __init__(self):
self.skipSteps = {}
self.hostname = None
@@ -160,6 +166,9 @@ class InstallClass:
self.clearText = None
self.clearPartText = None
self.zeroMbr = 0
+ self.language = None
+ self.keyboard = None
+ self.mouse = None
# custom installs are easy :-)
class CustomInstall(InstallClass):
@@ -212,6 +221,7 @@ class Server(InstallClass):
self.addToSkipList("authentication")
self.addToSkipList("bootdisk")
self.addToSkipList("partition")
+ self.addToSkipList("format")
self.partitions.append(('/boot', 16, 16, 0))
self.partitions.append(('/', 256, 256, 0))
diff --git a/iw/mouse.py b/iw/mouse.py
index 07e009b63..75cd6e921 100644
--- a/iw/mouse.py
+++ b/iw/mouse.py
@@ -90,6 +90,7 @@ class MouseWindow (InstallWindow):
return name
def getNext (self):
+ if not self.__dict__.has_key("availableMice"): return
cur = self.getCurrentKey()
(gpm, xdev, device, emulate) = self.availableMice[cur]
self.todo.mouse.set (cur, self.emulate3.get_active ())
diff --git a/kickstart.py b/kickstart.py
index 9cf50ffe9..dff16f4c2 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -103,7 +103,7 @@ class Kickstart(InstallClass):
ip = None
netmask = None
gateway = None
- nameserve = None
+ nameserver = None
for n in args:
(str, arg) = n
if str == "--bootproto":
@@ -117,11 +117,74 @@ class Kickstart(InstallClass):
elif str == "--nameserver":
nameserver = arg
self.setNetwork(bootProto, ip, netmask, gateway, nameserver)
+ self.addToSkipList("network")
+
+ def doLang(self, args):
+ self.setLanguage(args[0])
+ self.addToSkipList("language")
+
+ def doKeyboard(self, args):
+ self.setKeyboard(args[0])
+ self.addToSkipList("keyboard")
def doZeroMbr(self, args):
if args[0] == "yes":
self.setZeroMbr(1)
+ def doMouse(self, args):
+ mouseToMouse = {
+ "alpsps/2" : "ALPS - GlidePoint (PS/2)",
+ "ascii" : "ASCII - MieMouse (serial)",
+ "asciips/2" : "ASCII - MieMouse (PS/2)",
+ "atibm" : "ATI - Bus Mouse",
+ "generic" : "Generic - 2 Button Mouse (serial)" ,
+ "generic3" : "Generic - 3 Button Mouse (serial)" ,
+ "genericps/2" : "Generic - 2 Button Mouse (PS/2)" ,
+ "generic3ps/2" : "Generic - 3 Button Mouse (PS/2)" ,
+ "geniusnm" : "Generic - 2 Button Mouse (PS/2)" ,
+ "geniusnmps/2" : "Genius - NetMouse (PS/2)" ,
+ "geniusnsps/2" : "Genius - NetScroll (PS/2)" ,
+ "thinking" : "" ,
+ "thinkingps/2" : "" ,
+ "logitech" : "Logitech - C7 Mouse (serial, old C7 type)" ,
+ "logitechcc" : "Logitech - CC Series (serial)" ,
+ "logibm" : "Logitech - Bus Mouse" ,
+ "logimman" : "Logitech - MouseMan/FirstMouse (serial)" ,
+ "logimmanps/2" : "Logitech - MouseMan/FirstMouse (ps/2)" ,
+ "logimman+" : "Logitech - MouseMan+/FirstMouse+ (serial)" ,
+ "logimman+ps/2" : "Logitech - MouseMan+/FirstMouse+ (PS/2)" ,
+ "microsoft" : "Microsoft - Compatible Mouse (serial)" ,
+ "msnew" : "Microsoft - Rev 2.1A or higher (serial)" ,
+ "msintelli" : "Microsoft - IntelliMouse (serial)" ,
+ "msintellips/2" : "Microsoft - IntelliMouse (PS/2)" ,
+ "msbm" : "Microsoft - Bus Mouse" ,
+ "mousesystems" : "Mouse Systems - Mouse (serial)" ,
+ "mmseries" : "MM - Series (serial)" ,
+ "mmhittab" : "MM - HitTablet (serial)"
+ }
+
+ (args, extra) = isys.getopt(args, '', [ 'device', 'emulthree' ])
+ mouseType = "none"
+ device = None
+ emulThree = 0
+
+ for n in args:
+ (str, arg) = n
+ if str == "--device":
+ device = arg
+ elif str == "--emulthree":
+ emulThree = 1
+
+ if extra:
+ mouseType = extra[0]
+
+ print "mouseType is", mouseType
+
+ if mouseType != "none":
+ self.setMouseType(mouseToMouse[mouseType], device, emulThree)
+
+ self.addToSkipList("mouse")
+
def readKickstart(self, file):
handlers = {
"authconfig" : self.doAuthconfig ,
@@ -129,9 +192,11 @@ class Kickstart(InstallClass):
"clearpart" : self.doClearPart ,
"harddrive" : None ,
"install" : self.doInstall ,
- "network" : self.doNetwork ,
+ "keyboard" : self.doKeyboard ,
+ "lang" : self.doLang ,
"lilo" : self.doLilo ,
- "network" : None ,
+ "mouse" : self.doMouse ,
+ "network" : self.doNetwork ,
"nfs" : None ,
"part" : self.definePartition ,
"rootpw" : self.doRootPw ,
diff --git a/todo.py b/todo.py
index b6afb728f..3ebb4869f 100644
--- a/todo.py
+++ b/todo.py
@@ -149,9 +149,16 @@ class Language (SimpleConfigFile):
"English" : "C",
"German" : "de",
}
+ self.abbrevMap = { # kickstart needs this
+ "en": "English",
+ "de": "German"
+ }
def available (self):
return self.langs
+
+ def setByAbbrev(self, lang):
+ self.set(self.abbrevMap[lang])
def set (self, lang):
self.lang = self.langs[lang]
@@ -487,6 +494,8 @@ class ToDo:
else:
if (fs == "ext2"):
f.write (format % ( '/dev/' + dev, mntpoint, fs, 'defaults', 1, 2))
+ elif fs == "iso9660":
+ f.write (format % ( '/dev/' + dev, mntpoint, fs, 'noauto,ro', 0, 0))
else:
f.write (format % ( '/dev/' + dev, mntpoint, fs, 'defaults', 0, 0))
f.write (format % ("/dev/fd0", "/mnt/floppy", 'ext', 'noauto', 0, 0))
@@ -905,6 +914,10 @@ class ToDo:
todo.users = []
if todo.instClass.rootPassword:
todo.rootpassword.set(todo.instClass.rootPassword)
+ if todo.instClass.language:
+ todo.language.setByAbbrev(todo.instClass.language)
+ if todo.instClass.keyboard:
+ todo.keyboard.set(todo.instClass.keyboard)
(bootProto, ip, netmask, gateway, nameserver) = \
todo.instClass.getNetwork()
@@ -924,6 +937,10 @@ class ToDo:
if (netmask):
dev.set (("netmask", netmask))
+ if (todo.instClass.mouse):
+ (type, device, emulateThreeButtons) = todo.instClass.mouse
+ todo.mouse.set(type, emulateThreeButtons, thedev = device)
+
def getSkipPartitioning(self):
return self.instClass.skipPartitioning
@@ -976,6 +993,8 @@ class ToDo:
count = count + 1
os.symlink(device, self.instPath + "/dev/" + cdname)
+ mntpoint = "/mnt/" + cdname
+ self.mounts[mntpoint] = ("/dev/" + cdname, "iso9660", 0)
def setDefaultRunlevel (self):
inittab = open (self.instPath + '/etc/inittab', 'r')
@@ -1103,6 +1122,7 @@ class ToDo:
_("Performing post install configuration..."))
if not self.upgrade:
+ self.createCdrom()
self.writeFstab ()
self.writeLanguage ()
self.writeMouse ()
@@ -1111,7 +1131,6 @@ class ToDo:
self.writeRootPassword ()
self.setupAuthentication ()
self.createAccounts ()
- self.createCdrom()
self.writeTimezone()
pcmcia.createPcmciaConfig(self.instPath + "/etc/sysconfig/pcmcia")
self.copyConfModules ()