diff options
author | Matt Wilson <msw@redhat.com> | 1999-08-31 13:33:22 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 1999-08-31 13:33:22 +0000 |
commit | 266d30a1d19e9f9ba56590f92f30793ccca03dd9 (patch) | |
tree | a51bc225ffc0a03603f6180a17e7e2faecd1613f | |
parent | dfd08711c55b93d63246131fe52724f51ea91aaa (diff) | |
download | anaconda-266d30a1d19e9f9ba56590f92f30793ccca03dd9.tar.gz anaconda-266d30a1d19e9f9ba56590f92f30793ccca03dd9.tar.xz anaconda-266d30a1d19e9f9ba56590f92f30793ccca03dd9.zip |
configure first device alphabetically, not first device hash-wise
-rw-r--r-- | installclass.py | 15 | ||||
-rw-r--r-- | kickstart.py | 55 | ||||
-rw-r--r-- | text.py | 4 | ||||
-rw-r--r-- | todo.py | 22 |
4 files changed, 84 insertions, 12 deletions
diff --git a/installclass.py b/installclass.py index 0cd735789..8e6a5ac10 100644 --- a/installclass.py +++ b/installclass.py @@ -64,6 +64,16 @@ class InstallClass: def getMakeBootdisk(self): return self.makeBootdisk + def setNetwork(self, bootproto, ip, netmask, gateway, nameserver): + self.bootProto = bootproto + self.ip = ip + self.netmask = netmask + self.gateway = gateway + self.nameserver = nameserver + + def getNetwork(self): + return (bootProto, ip, netmask, gateway, nameserver) + def __init__(self): self.skipSteps = {} self.hostname = None @@ -74,6 +84,11 @@ class InstallClass: self.setAuthentication(1, 1, 0) self.rootPassword = None self.installType = None + self.bootProto = None + self.ip = None + self.netmask = None + self.gateway = None + self.nameserver = None # custom installs are easy :-) class CustomInstall(InstallClass): diff --git a/kickstart.py b/kickstart.py index 05a6e820e..8129de910 100644 --- a/kickstart.py +++ b/kickstart.py @@ -5,7 +5,7 @@ import sys class Kickstart(InstallClass): - def setRootPassword(self, args): + def doRootPw(self, args): (args, extra) = getopt.getopt(args, '', [ 'iscrypted=' ]) isCrypted = 0 @@ -14,10 +14,10 @@ class Kickstart(InstallClass): if (str == '--iscrypted'): isCrypted = 1 - InstallClass.setRootPassword(self, extra[0], isCrypted = isCrypted) + InstallClass.doRootPw(self, extra[0], isCrypted = isCrypted) self.addToSkipList("accounts") - def authconfig(self, args): + def doAuthconfig(self, args): (args, extra) = getopt.getopt(args, '', [ 'enablenis', 'nisdomain=', 'nisserver=', 'useshadow', 'enablemd5' ]) @@ -48,7 +48,7 @@ class Kickstart(InstallClass): nisBroadcast, nisServer) self.addToSkipList("authentication") - def setupLilo(self, args): + def doLilo (self, args): (args, extra) = getopt.getopt(args, '', [ 'append=', 'location=', 'linear' ]) @@ -74,7 +74,7 @@ class Kickstart(InstallClass): self.setLiloInformation(location, linear, appendLine) self.addToSkipList("lilo") - def setTimezone(self, args): + def doTimezone(self, args): (args, extra) = getopt.getopt(args, '', [ 'utc' ]) @@ -89,14 +89,47 @@ class Kickstart(InstallClass): self.addToSkipList("timezone") + def doInstall(self, args): + self.installType = "install" + + def doUpgrade(self, args): + self.installType = "upgrade" + + def doNetwork(self, args): + (args, extra) = getopt.getopt(args, '', + [ 'bootproto', 'ip', 'netmask', 'gateway', 'nameserver' ]) + bootProto = "dhcp" + ip = None + netmask = None + gateway = None + nameserve = None + for n in args: + (str, arg) = n + if str == "--bootproto": + bootProto = arg + elif str == "--ip": + ip = arg + elif str == "--netmask": + netmask = arg + elif str == "--gateway": + gateway = arg + elif str == "--nameserver": + nameserver = arg + self.setNetwork(bootProto, ip, netmask, gateway, nameserver) + def readKickstart(self, file): - handlers = { "nfs" : None , + handlers = { + "authconfig" : self.doAuthconfig , "cdrom" : None , - "authconfig" : self.authconfig , + "install" : self.doInstall , + "network" : self.doNetwork , + "lang" : self.doLanguage , + "lilo" : self.doLilo , "network" : None , - "rootpw" : self.setRootPassword , - "timezone" : self.setTimezone , - "lilo" : self.setupLilo , + "nfs" : None , + "rootpw" : self.doRootPw , + "timezone" : self.doTimezone , + "upgrade" : self.doUpgrade , } for n in open(file).readlines(): @@ -113,8 +146,8 @@ class Kickstart(InstallClass): self.addToSkipList("bootdisk") self.addToSkipList("welcome") - self.readKickstart(file) self.installType = "install" + self.readKickstart(file) self.setGroups(["Base"]) self.addToSkipList("package-selection") @@ -560,7 +560,9 @@ class NetworkWindow: # XXX expert mode, allow changing network settings here return INSTALL_NOOP - dev = devices[devices.keys ()[0]] + list = devices.keys () + list.sort() + dev = list[0] firstg = Grid (1, 1) boot = dev.get ("bootproto") @@ -304,6 +304,9 @@ class ToDo: raise TypeError, "installation class expected" self.setClass(instClass) + self.todo.network.gateway = self.gw.get_text () + self.todo.network.primaryNS = self.ns.get_text () + def umountFilesystems(self): if (not self.setupFilesystems): return @@ -856,6 +859,24 @@ class ToDo: if todo.instClass.rootPassword: todo.rootpassword.set(todo.instClass.rootPassword) + (bootProto, ip, netmask, gateway, nameserver) = \ + todo.instClass.getNetwork() + + self.gateway = gateway + self.primaryNS = nameserver + + devices = todo.network.available () + if (devices): + list = devices.keys () + list.sort() + dev = list[0] + dev.set (("bootproto", bootProto)) + + if (ip): + dev.set (("ipaddr", ip)) + if (netmask): + dev.set (("netmask", netmask)) + # List of (accountName, fullName, password) tupes def setUserList(todo, users): todo.users = users @@ -887,6 +908,7 @@ class ToDo: list = isys.cdromList() count = 0 for device in list: + (device, descript) = device cdname = "cdrom" if (count): cdname = "%s%d" % (cdname, count) |