diff options
-rwxr-xr-x | anaconda | 69 | ||||
-rw-r--r-- | bootloader.py | 214 | ||||
-rw-r--r-- | dispatch.py | 1 | ||||
-rw-r--r-- | fsset.py | 28 | ||||
-rw-r--r-- | gettext_rh.py | 2 | ||||
-rwxr-xr-x | gui.py | 6 | ||||
-rw-r--r-- | installclass.py | 40 | ||||
-rw-r--r-- | isys/devnodes.c | 4 | ||||
-rw-r--r-- | isys/probe.c | 6 | ||||
-rw-r--r-- | iw/network_gui.py | 5 | ||||
-rw-r--r-- | iw/partition_gui.py | 28 | ||||
-rw-r--r-- | kickstart.py | 2 | ||||
-rw-r--r-- | mouse.py | 2 | ||||
-rw-r--r-- | network.py | 3 | ||||
-rw-r--r-- | packages.py | 51 | ||||
-rw-r--r-- | partitioning.py | 131 | ||||
-rw-r--r-- | text.py | 4 | ||||
-rw-r--r-- | textw/network_text.py | 22 | ||||
-rw-r--r-- | textw/partition_text.py | 30 |
19 files changed, 540 insertions, 108 deletions
@@ -213,6 +213,8 @@ for n in args: display_mode = 't' elif (str == '-x' or str == '--xmode'): xmode = 1 + elif iutil.getArch() == "s390" or iutil.getArch() == "s390x": + logFile = "/tmp/anaconda-s390.log" # # must specify install, rescue or reconfig mode @@ -247,10 +249,11 @@ if (debug): import pdb pdb.set_trace() -# don't let folks do anything stupid -if (not flags.test and os.getpid() > 90 and flags.setupFilesystems): +# don't let folks do anything stupid on !s390 +if (not flags.test and os.getpid() > 90 and flags.setupFilesystems and + not (iutil.getArch() == "s390" or iutil.getArch() == "s390x")): sys.stderr.write( - "You're running me on a live system! that's incredibly stupid.\n") + "You're running me on a live system! that's incredibly stupid.\n") sys.exit(1) import isys @@ -316,10 +319,6 @@ if (not flags.test): display_mode = 't' time.sleep(2) -# Force text mode on IBM s390/s390x -if iutil.getArch() == "s390" or iutil.getArch() == "s390x": - display_mode = 't' - if iutil.memInstalled() < isys.MIN_RAM: from snack import * @@ -367,6 +366,13 @@ if instClass.forceTextMode: # find out what video hardware is available to run installer # +# XXX kind of hacky +if os.environ.has_key('DISPLAY') and display_mode == 'g': + x_already_set = 1 +else: + x_already_set = 0 + + mousehw = mouse.Mouse(skipProbe = 1) #if display_mode == 'g': @@ -413,18 +419,26 @@ if (display_mode != 't' and method and display_mode = 't' time.sleep(2) -# if no mouse we force text mode -mousedev = mousehw.get() -if display_mode != 't' and mousedev[0] == "None - None": - # ask for the mouse type - if mouse.mouseWindow(mousehw) == 0: - print _("No mouse was detected. A mouse is required for graphical " +# XXX should be fixed to be more generic instead of just ifarching +if iutil.getArch() != "s390" and iutil.getArch() != "s390x": + # if no mouse we force text mode + mousedev = mousehw.get() + if display_mode != 't' and mousedev[0] == "None - None": + # ask for the mouse type + if mouse.mouseWindow(mousehw) == 0: + print _("No mouse was detected. A mouse is required for graphical " "installation. Starting text mode.") + display_mode = 't' + time.sleep(2) + else: + sys.stdout.write(_("Using mouse type: ")) + sys.stdout.write(mousehw.shortDescription()+'\n') +else: # s390 checks + if display_mode == 'g' and not os.environ.has_key('DISPLAY'): + print _("DISPLAY variable not set. Starting text mode!") display_mode = 't' time.sleep(2) - else: - sys.stdout.write(_("Using mouse type: ")) - sys.stdout.write(mousehw.shortDescription()+'\n') + # # startup X server is we're not already running under an X session @@ -449,14 +463,23 @@ if display_mode == 'g': display_mode = 't' time.sleep(2) else: - xcfg = xf86config.XF86Config(videohw.primaryCard(), - monitorhw, mousehw, runres) + # XXX x_already_set is a hack, see above + if x_already_set: + card = videocard.VideoCard() + else: + card = videohw.primaryCard() + xcfg = xf86config.XF86Config(card, monitorhw, mousehw, runres) + elif progmode != 'reconfig': - # only probe X related stuff if we're doing an install - import xf86config - xcfg = xf86config.XF86Config(videohw.primaryCard(), - monitorhw, mousehw, runres) + + # only probe X related stuff if we're doing an install + if iutil.getArch() == "s390" or iutil.getArch() == "s390x": + # XXX why doesn't videohw.primaryCard() dtrt on s390? + card = videocard.VideoCard() + else: + card = videohw.primaryCard() + xcfg = xf86config.XF86Config(card, monitorhw, mousehw, runres) import configFileData configFile = configFileData.configFileData() @@ -575,6 +598,8 @@ floppyDevice = floppy.probeFloppyDevice() id = instClass.installDataClass(extraModules, floppyDevice, configFileData) #id = instClass.installDataClass(extraModules, floppyDevice) +id.x_already_set = x_already_set + if mousehw: id.setMouse(mousehw) diff --git a/bootloader.py b/bootloader.py index 5c7f83ade..ef5b5cce6 100644 --- a/bootloader.py +++ b/bootloader.py @@ -74,13 +74,19 @@ class KernelArguments: self.args = args def __init__(self): - cdrw = isys.ideCdRwList() - str = "" - for device in cdrw: - if str: str = str + " " - str = str + ("%s=ide-scsi" % device) + str = "" - self.args = str + if iutil.getArch() == "s390" or iutil.getArch() == "s390x": + if os.environ.has_key("DASD"): + str = str + "dasd=" + os.environ["DASD"] + + cdrw = isys.ideCdRwList() + str = "" + for device in cdrw: + if str: str = str + " " + str = str + ("%s=ide-scsi" % device) + + self.args = str class BootImages: @@ -672,6 +678,200 @@ class x86BootloaderInfo(bootloaderInfo): self.password = None self.pure = None +class s390BootloaderInfo(bootloaderInfo): + def getBootloaderConfig(self, instRoot, fsset, bl, langs, kernelList, + chainList, defaultDev): + images = bl.images.getImages() + + # on upgrade read in the lilo config file + lilo = LiloConfigFile () + self.perms = 0644 + if os.access (instRoot + self.configfile, os.R_OK): + self.perms = os.stat(instRoot + self.configfile)[0] & 0777 + lilo.read (instRoot + self.configfile) + os.rename(instRoot + self.configfile, + instRoot + self.configfile + '.rpmsave') + + # Remove any invalid entries that are in the file; we probably + # just removed those kernels. + for label in lilo.listImages(): + (fsType, sl) = lilo.getImage(label) + if fsType == "other": continue + + if not os.access(instRoot + sl.getPath(), os.R_OK): + lilo.delImage(label) + + #lilo.addEntry("prompt", replace = 0) + #lilo.addEntry("timeout", "50", replace = 0) + + rootDev = fsset.getEntryByMountPoint("/").device.getDevice() + if not rootDev: + raise RuntimeError, "Installing zilo, but there is no root device" + + if rootDev == defaultDev: + lilo.addEntry("default", kernelList[0][0]) + else: + lilo.addEntry("default", chainList[0][0]) + + for (label, longlabel, version) in kernelList: + kernelTag = "-" + version + kernelFile = self.kernelLocation + "vmlinuz" + kernelTag + + try: + lilo.delImage(label) + except IndexError, msg: + pass + + sl = LiloConfigFile(imageType = "image", path = kernelFile) + + initrd = makeInitrd (kernelTag, instRoot) + + sl.addEntry("label", label) + if os.access (instRoot + initrd, os.R_OK): + sl.addEntry("initrd", + "%sinitrd%s.img" %(self.kernelLocation, kernelTag)) + + sl.addEntry("read-only") + sl.addEntry("root", '/dev/' + rootDev) + sl.addEntry("ipldevice", '/dev/' + rootDev[:-1]) + + if self.args.get(): + sl.addEntry('append', '"%s"' % self.args.get()) + + lilo.addImage (sl) + + for (label, longlabel, device) in chainList: + if ((not label) or (label == "")): + continue + try: + (fsType, sl) = lilo.getImage(label) + lilo.delImage(label) + except IndexError: + sl = LiloConfigFile(imageType = "other", + path = "/dev/%s" %(device)) + sl.addEntry("optional") + + sl.addEntry("label", label) + lilo.addImage (sl) + + # Sanity check #1. There could be aliases in sections which conflict + # with the new images we just created. If so, erase those aliases + imageNames = {} + for label in lilo.listImages(): + imageNames[label] = 1 + + for label in lilo.listImages(): + (fsType, sl) = lilo.getImage(label) + if sl.testEntry('alias'): + alias = sl.getEntry('alias') + if imageNames.has_key(alias): + sl.delEntry('alias') + imageNames[alias] = 1 + + # Sanity check #2. If single-key is turned on, go through all of + # the image names (including aliases) (we just built the list) and + # see if single-key will still work. + if lilo.testEntry('single-key'): + singleKeys = {} + turnOff = 0 + for label in imageNames.keys(): + l = label[0] + if singleKeys.has_key(l): + turnOff = 1 + singleKeys[l] = 1 + if turnOff: + lilo.delEntry('single-key') + + return lilo + + def writeChandevConf(self, instroot): # S/390 only + cf = "/etc/chandev.conf" + self.perms = 0644 + if os.environ.has_key("CHANDEV"): + fd = os.open(instroot + "/etc/chandev.conf", + os.O_WRONLY | os.O_CREAT) + os.write(fd, os.environ["CHANDEV"]) + os.close(fd) + return "" + + + def writeZipl(self, instRoot, fsset, bl, langs, kernelList, chainList, + defaultDev, justConfigFile): + images = bl.images.getImages() + rootDev = fsset.getEntryByMountPoint("/").device.getDevice() + + cf = '/etc/zipl.conf' + self.perms = 0600 + if os.access (instRoot + cf, os.R_OK): + self.perms = os.stat(instRoot + cf)[0] & 0777 + os.rename(instRoot + cf, + instRoot + cf + '.rpmsave') + + f = open(instRoot + cf, "w+") + + f.write('[defaultboot]\n') + f.write('default=' + kernelList[0][0] + '\n') + + cfPath = "/boot/" + for (label, longlabel, version) in kernelList: + kernelTag = "-" + version + kernelFile = "%svmlinuz%s" % (cfPath, kernelTag) + + initrd = makeInitrd (kernelTag, instRoot) + f.write('[%s]\n' % (label)) + f.write('\ttarget=%s\n' % (self.kernelLocation)) + f.write('\timage=%s\n' % (kernelFile)) + if os.access (instRoot + initrd, os.R_OK): + f.write("ramdisk=%sinitrd%s.img\n" %(self.kernelLocation, + kernelTag)) + if self.args.get(): + f.write('\tparameters="root=/dev/%s %s"\n' % (rootDev, + self.args.get())) + f.write('\n') + + f.close() + + if not justConfigFile: + argv = [ "/sbin/zipl" ] + iutil.execWithRedirect(argv[0], argv, root = instRoot, + stdout = "/dev/tty5", + stderr = "/dev/tty5") + + return "" + + def writeZilo(self, instRoot, fsset, bl, langs, kernelList, + chainList, defaultDev, justConfig): + config = self.getBootloaderConfig(instRoot, fsset, bl, langs, + kernelList, chainList, defaultDev) + config.write(instRoot + self.configfile, perms = self.perms) + + if not justConfig: + # throw away stdout, catch stderr + str = iutil.execWithCapture(instRoot + '/sbin/zilo' , + [ "zilo", "-r", instRoot ], + catchfd = 2, closefd = 1) + else: + str = "" + + return str + + def write(self, instRoot, fsset, bl, langs, kernelList, chainList, + defaultDev, justConfig, intf): + str = self.writeZilo(instRoot, fsset, bl, langs, kernelList, + chainList, defaultDev, + justConfig | (self.useZiplVal)) + str = self.writeZipl(instRoot, fsset, bl, langs, kernelList, + chainList, defaultDev, + justConfig | (not self.useZiplVal)) + str = self.writeChandevConf(instRoot) + + def __init__(self): + bootloaderInfo.__init__(self) + self.useZiplVal = 1 # only used on s390 + self.kernelLocation = "/boot/" + self.configfile = "/etc/zilo.conf" + + def availableBootDevices(diskSet, fsset): devs = [] foundDos = 0 @@ -833,5 +1033,7 @@ def getBootloader(): return x86BootloaderInfo() elif iutil.getArch() == 'ia64': return ia64BootloaderInfo() + elif iutil.getArch() == 's390' or iutil.getArch() == "s390x": + return s390BootloaderInfo() else: return bootloaderInfo() diff --git a/dispatch.py b/dispatch.py index 87f91e55c..801c6e819 100644 --- a/dispatch.py +++ b/dispatch.py @@ -66,6 +66,7 @@ installSteps = [ "id.partitions", "intf", "id.instClass", "dispatch")), ("fdisk", ("id.diskset", "id.partitions", "intf")), + ("fdasd", ("id.diskset", "id.partitions", "intf")), ("partition", ("id.fsset", "id.diskset", "id.partitions", "intf")), ("upgrademount", upgradeMountFilesystems, ("intf", "id.upgradeRoot", "id.fsset", "instPath")), @@ -35,7 +35,11 @@ else: fileSystemTypes = {} -availRaidLevels = ['RAID0', 'RAID1', 'RAID5'] +# XXX define availraidlevels and defaultmntpts as arch characteristics +if (iutil.getArch() != "s390" and iutil.getArch() != "s390x"): + availRaidLevels = ['RAID0', 'RAID1', 'RAID5'] +else: + availRaidLevels = ['RAID0', 'RAID5'] def fileSystemTypeGetDefault(): if fileSystemTypeGet('ext3').isSupported(): @@ -1545,18 +1549,22 @@ def ext2FormatFilesystem(argList, messageFile, windowCreator, mntpoint): except: pass else: - if num: + if num and len(num): l = string.split(num, '/') - val = (int(l[0]) * 100) / int(l[1]) - w and w.set(val) - # sync every 10% - if sync + 10 < val: - isys.sync() - sync = val + try: + val = (int(l[0]) * 100) / int(l[1]) + except IndexError, TypeError: + pass + else: + w and w.set(val) + # sync every 10% + if sync + 10 < val: + isys.sync() + sync = val num = '' except OSError, args: - (num, str) = args - if (num != 4): + (errno, str) = args + if (errno != 4): raise IOError, args try: diff --git a/gettext_rh.py b/gettext_rh.py index a9b44a156..b8969b1fa 100644 --- a/gettext_rh.py +++ b/gettext_rh.py @@ -82,7 +82,7 @@ if os.environ.has_key('PY_XGETTEXT'): else: xgettext = None -if iutil.getArch() == 'sparc': +if iutil.getArch() == 'sparc' or iutil.getArch() == "s390" or iutil.getArch() == "s390x": _gettext_byteorder = 'msb' else: _gettext_byteorder = 'lsb' @@ -43,6 +43,7 @@ stepToClass = { "addswap" : ("upgrade_swap_gui", "UpgradeSwapWindow"), "upgrademigratefs" : ("upgrade_migratefs_gui", "UpgradeMigrateFSWindow"), "fdisk" : ("fdisk_gui", "FDiskWindow"), + "fdasd" : ("fdasd_gui", "FDasdWindow"), "format" : ("format_gui", "FormatWindow"), "bootloader": ("bootloader_gui", "BootloaderWindow"), "bootloaderpassword" : ("bootloaderpassword_gui", "BootloaderPasswordWindow"), @@ -71,6 +72,8 @@ stepToClass = { if iutil.getArch() == 'sparc': stepToClass["bootloader"] = ("silo_gui", "SiloWindow") +elif iutil.getArch() == 's390' or iutil.getArch() == 's390x': + stepToClass["bootloader"] = ("zipl_gui", "ZiplWindow") else: stepToClass["bootloader"] = ("bootloader_gui", "BootloaderWindow") @@ -343,7 +346,8 @@ class InstallInterface: except SystemError: pass - if id.keyboard: + # XXX x_already_set is a hack + if id.keyboard and not id.x_already_set: info = id.keyboard.getXKB() if info: (rules, model, layout, variant, options) = info diff --git a/installclass.py b/installclass.py index c835eb8d3..1e7065fb1 100644 --- a/installclass.py +++ b/installclass.py @@ -77,6 +77,7 @@ class BaseInstallClass: "autopartition", "autopartitionexecute", "fdisk", + "fdasd", "partition", "partitiondone", "bootloadersetup", @@ -113,26 +114,33 @@ class BaseInstallClass: "complete" ) + # XXX ugh, this badly needs some clean up if iutil.getArch() == "alpha" or iutil.getArch() == "ia64": dispatch.skipStep("bootdisk") dispatch.skipStep("bootloader") dispatch.skipStep("bootloaderpassword") - - if iutil.getArch() == "s390" or iutil.getArch() == "s390x": - dispatch.skipStep("bootdisk") - dispatch.skipStep("lilo") - dispatch.skipStep("partition") - dispatch.skipStep("format") - dispatch.skipStep("mouse") - dispatch.skipStep("network") - dispatch.skipStep("firewall") - dispatch.skipStep("authentication") - # dispatch.skipStep("accounts") - dispatch.skipStep("language") - dispatch.skipStep("keyboard") - dispatch.skipStep("xconfig") - dispatch.skipStep("lba32warning") - + dispatch.skipStep("fdasd", permanent = 1) + elif iutil.getArch() == "s390" or iutil.getArch() == "s390x": + #dispatch.skipStep("language") + dispatch.skipStep("keyboard", permanent = 1) + dispatch.skipStep("mouse", permanent = 1) + + dispatch.skipStep("partitionmethod", permanent = 1) + dispatch.skipStep("autopartition", permanent = 1) + dispatch.skipStep("autopartitionexecute", permanent = 1) + dispatch.skipStep("fdisk", permanent = 1) + dispatch.skipStep("bootloaderpassword", permanent = 1) + + dispatch.skipStep("handleX11pkgs", permanent = 1) + dispatch.skipStep("videocard", permanent = 1) + dispatch.skipStep("monitor", permanent = 1) + dispatch.skipStep("xcustom", permanent = 1) + dispatch.skipStep("writexconfig", permanent = 1) + + dispatch.skipStep("bootdisk", permanent = 1) + else: + dispatch.skipStep("fdasd", permanent = 1) + # This is called after the hdlist is read in. def setPackageSelection(self, hdlist): pass diff --git a/isys/devnodes.c b/isys/devnodes.c index a04e5e2b2..e8a76c62d 100644 --- a/isys/devnodes.c +++ b/isys/devnodes.c @@ -163,12 +163,12 @@ int devMakeInode(char * devName, char * path) { if (devName[3]) minor += devName[3] - '1'; #if defined (__s390__) || defined (__s390x__) - } else if (!strncmp(devName, "dasd", 4)) { + } else if (!strncmp(devName, "dasd", 4) && strlen(devName) > 4) { /* IBM Dasd Drives */ type = S_IFBLK; major = 94; minor = ( devName[4] - 'a' ) * 4; - if (devName[5]) + if (devName[5] && isdigit(devName[5]) ) minor += devName[5] - '0'; } else if (!strncmp(devName, "mnd", 4)) { /* IBM MiniDisk Drives */ diff --git a/isys/probe.c b/isys/probe.c index d3db6577d..a02c9a429 100644 --- a/isys/probe.c +++ b/isys/probe.c @@ -422,10 +422,12 @@ int kdFindDasdList(struct knownDevices * devices, int code) { /* Every line in this file is a harddisk */ while ((fgets(line, 190, fd)) != NULL) { - sscanf(line, "%*X %*[(A-Z)] at (%*d:%*d) is %[a-z0-9]:%s ", name, status); + int num; + num = sscanf(line, "%*X %*[(A-Z)] at (%*d:%*d) is %[a-z0-9] : %s ", + name, status); /* Take every dasd, formated and unformated */ - if (!deviceKnown(devices, name)) { + if ((num == 2) && (strlen(name) <= 6) && !deviceKnown(devices, name)) { snprintf(model, sizeof(model), "IBM DASD (%s)", status); device.class = CLASS_HD; device.name = strdup(name); diff --git a/iw/network_gui.py b/iw/network_gui.py index 62ba61448..10a71225e 100644 --- a/iw/network_gui.py +++ b/iw/network_gui.py @@ -195,6 +195,11 @@ class NetworkWindow(InstallWindow): (_("Netmask"), "netmask"), (_("Network"), "network"), (_("Broadcast"), "broadcast")] + + if len(i) >= 3 and i[:3] == 'ctc': + newopt = (_("Point to Point (IP)"), "remip") + options.append(newopt) + ipTable = gtk.Table(len(options), 2) # this is the iptable used for DNS, et. al self.ipTable = gtk.Table(len(options), 2) diff --git a/iw/partition_gui.py b/iw/partition_gui.py index cd054b4be..f70cb7793 100644 --- a/iw/partition_gui.py +++ b/iw/partition_gui.py @@ -1388,6 +1388,12 @@ class PartitionWindow(InstallWindow): def deleteCb(self, widget): partition = self.tree.getCurrentPartition() + if (iutil.getArch() == "s390" or iutil.getArch() == "s390x") \ + and type(partition) != type("RAID"): + self.intf.messageWindow(_("Error"), + _("DASD partitions can only be deleted with fdasd")) + return + if doDeletePartitionByRequest(self.intf, self.partitions, partition): self.refresh() @@ -1449,7 +1455,11 @@ class PartitionWindow(InstallWindow): if type == "RAID": self.editRaidRequest(request) elif type == "NEW": - self.editPartitionRequest(request, isNew = 1) + if iutil.getArch() == "s390" or iutil.getArch() == "s390x": + self.intf.messageWindow(_("Error"), + _("You must go back and use fdasd to inititalize this partition")) + else: + self.editPartitionRequest(request, isNew = 1) else: self.editPartitionRequest(request) @@ -1655,11 +1665,17 @@ class PartitionWindow(InstallWindow): buttonBox = gtk.HButtonBox() buttonBox.set_layout(gtk.BUTTONBOX_SPREAD) - ops = ((_("_New"), self.newCB), - (_("_Edit"), self.editCb), - (_("_Delete"), self.deleteCb), - (_("_Reset"), self.resetCb), - (_("Make _RAID"), self.makeraidCB)) + if iutil.getArch() == "s390" or iutil.getArch() == "s390x": + ops = ((_("_Edit"), self.editCb), + (_("_Delete"), self.deleteCb), + (_("_Reset"), self.resetCb), + (_("Make _RAID"), self.makeraidCB),) + else: + ops = ((_("_New"), self.newCB), + (_("_Edit"), self.editCb), + (_("_Delete"), self.deleteCb), + (_("_Reset"), self.resetCb), + (_("Make _RAID"), self.makeraidCB)) for label, cb in ops: button = gtk.Button(label) diff --git a/kickstart.py b/kickstart.py index e607c02ae..6904908c1 100644 --- a/kickstart.py +++ b/kickstart.py @@ -787,6 +787,7 @@ class KickstartBase(BaseInstallClass): self.skipSteps.append("partitionmethod") self.skipSteps.append("partitionmethodsetup") self.skipSteps.append("fdisk") + self.skipSteps.append("fdasd") self.skipSteps.append("autopartition") def setSteps(self, dispatch): @@ -808,6 +809,7 @@ class KickstartBase(BaseInstallClass): dispatch.skipStep("partitionmethod") dispatch.skipStep("partitionmethodsetup") dispatch.skipStep("fdisk") + dispatch.skipStep("fdasd") dispatch.skipStep("autopartition") dispatch.skipStep("bootdisk") return @@ -88,7 +88,7 @@ class Mouse (SimpleConfigFile): N_("MM - HitTablet (serial)"): ("MMHitTab", "MMHittab", "ttyS", 1, "mmhittab"), # "None - None" : -# ("none", "none", "null", 0, "none"), +# ("none", "none", None, 0, "none"), N_("Sun - Mouse"): ("sun", "sun", "sunmouse", 0, "sun"), } diff --git a/network.py b/network.py index 11f6ab96e..933bd82f7 100644 --- a/network.py +++ b/network.py @@ -86,7 +86,8 @@ class Network: netinf = string.splitfields(line, '=') info [netinf[0]] = string.strip(netinf[1]) self.netdevices [info["DEVICE"]] = NetworkDevice(info["DEVICE"]) - for key in ("IPADDR", "NETMASK", "BOOTPROTO", "ONBOOT"): + # XXX is REMIP ever used? + for key in ("IPADDR", "NETMASK", "BOOTPROTO", "ONBOOT", "REMIP"): if info.has_key(key): self.netdevices [info["DEVICE"]].set((key, info[key])) if info.has_key("GATEWAY"): diff --git a/packages.py b/packages.py index d43494f51..6d301542e 100644 --- a/packages.py +++ b/packages.py @@ -366,10 +366,10 @@ def doPreInstall(method, id, intf, instPath, dir): # this is NICE and LATE. It lets kickstart/server/workstation # installs detect this properly if arch == "s390" or arch == "s390x": - if (string.find(os.uname()[2], "vrdr") > -1): - select(id.hdList, 'kernel-vrdr') if (string.find(os.uname()[2], "tape") > -1): select(id.hdList, 'kernel-tape') + else: + select(id.hdList, 'kernel') elif isys.smpAvailable(): select(id.hdList, 'kernel-smp') @@ -405,27 +405,28 @@ def doPreInstall(method, id, intf, instPath, dir): if pcmcia.pcicType(): select(id.hdList, 'kernel-pcmcia-cs') - xserver = id.videocard.primaryCard().getXServer() - if (xserver and id.comps.packages.has_key('XFree86') - and id.comps.packages['XFree86'].selected - and xserver != "XFree86"): - try: - id.hdList['XFree86-' + xserver[5:]].selected = 1 - except ValueError, message: - log ("Error selecting XFree86 server package: %s", message) - except KeyError: - log ("Error selecting XFree86 server package, " - "package not available") - - # XXX remove me once we have dependency resolution after - # videocard selection - try: - id.hdList['XFree86-compat-modules'].selected = 1 - except ValueError, message: - log ("Error selecting XFree86-compat-modules package") - except KeyError: - log ("Error selecting XFree86-compat-modules, " - "package not available") + if iutil.getArch() != "s390" and iutil.getArch() != "s390x": + xserver = id.videocard.primaryCard().getXServer() + if (xserver and id.comps.packages.has_key('XFree86') + and id.comps.packages['XFree86'].selected + and xserver != "XFree86"): + try: + id.hdList['XFree86-' + xserver[5:]].selected = 1 + except ValueError, message: + log ("Error selecting XFree86 server package: %s", message) + except KeyError: + log ("Error selecting XFree86 server package, " + "package not available") + + # XXX remove me once we have dependency resolution after + # videocard selection + try: + id.hdList['XFree86-compat-modules'].selected = 1 + except ValueError, message: + log ("Error selecting XFree86-compat-modules package") + except KeyError: + log ("Error selecting XFree86-compat-modules, " + "package not available") # make sure that all comps that include other comps are @@ -866,11 +867,13 @@ def recreateInitrd (kernelTag, instRoot): searchPath = 1, root = instRoot) +# XXX Deprecated. Is this ever called anymore? def depmodModules(comps, instPath): kernelVersions = comps.kernelVersionList() for (version, tag) in kernelVersions: iutil.execWithRedirect ("/sbin/depmod", - [ "/sbin/depmod", "-a", version ], + [ "/sbin/depmod", "-a", version, + "-F", "/boot/System.map-" + version ], root = instPath, stderr = '/dev/null') diff --git a/partitioning.py b/partitioning.py index 30096af8e..01f2d7c3e 100644 --- a/partitioning.py +++ b/partitioning.py @@ -2,6 +2,9 @@ # partitioning.py: partitioning and other disk management # # Matt Wilson <msw@redhat.com> +# Jeremy Katz <katzj@redhat.com> +# Mike Fulbright <msf@redhat.com> +# Harald Hoyer <harald@redhat.de> # # Copyright 2001 Red Hat, Inc. # @@ -519,6 +522,7 @@ def sanityCheckRaidRequest(reqpartitions, newraid, doPartitionCheck = 1): # XXX fix this code to look to see if there is a bootable partition bootreq = reqpartitions.getBootableRequest() if not bootreq and newraid.mountpoint: + # XXX 390 can't have boot on raid if ((newraid.mountpoint == "/boot" or newraid.mountpoint == "/") and not isRaid1(newraid.raidlevel)): return _("Bootable partitions can only be on RAID1 devices.") @@ -609,6 +613,7 @@ def sanityCheckAllRequests(requests, diskset, baseChecks = 0): errors.append(rc) bootreq = requests.getBootableRequest() + # XXX 390 can't have boot on RAID if (bootreq and (bootreq.type == REQUEST_RAID) and (not isRaid1(bootreq.raidlevel))): errors.append(_("Bootable partitions can only be on RAID1 devices.")) @@ -682,12 +687,18 @@ def getDefaultDiskType(): return parted.disk_type_get("msdos") elif iutil.getArch() == "ia64": return parted.disk_type_get("GPT") + elif iutil.getArch() == "s390": + return parted.disk_type_get("dasd") + elif iutil.getArch() == "s390x": + return parted.disk_type_get("dasd") else: # XXX fix me for alpha at least return parted.disk_type_get("msdos") archLabels = {'i386': ['msdos'], 'alpha': ['bsd'], + 's390': ['dasd'], + 's390x': ['dasd'], 'ia64': ['msdos', 'GPT']} def checkDiskLabel(disk, intf): @@ -702,12 +713,12 @@ def checkDiskLabel(disk, intf): if intf: rc = intf.messageWindow(_("Warning"), _("The partition table on device /dev/%s is of an " - "unexpected type for your architecture. To use this " - "disk for installation of Red Hat Linux, it must be " - "re-initialized causing the loss of ALL DATA on this " - "drive.\n\n" + "unexpected type %s for your architecture. To " + "use this disk for installation of Red Hat Linux, " + "it must be re-initialized causing the loss of " + "ALL DATA on this drive.\n\n" "Would you like to initialize this drive?") - % (disk.dev.path[5:]), type = "yesno") + % (disk.dev.path[5:], disk.type.name), type = "yesno") if rc == 0: return 1 else: @@ -1394,6 +1405,84 @@ class DiskSet: for disk in self.disks.keys(): del self.disks[disk] + def dasdFmt (self, intf = None, drive = None): + w = intf.progressWindow (_("Initializing"), + _("Please wait while formatting drive %s...\n" + ) % (drive,), 100) + try: + isys.makeDevInode(drive, '/tmp/' + drive) + except: + pass + + argList = [ "/sbin/dasdfmt", + "-y", + "-b", "4096", + "-d", "cdl", + "-P", + "-f", + "/tmp/%s" % drive] + + fd = os.open("/dev/null", os.O_RDWR | os.O_CREAT | os.O_APPEND) + p = os.pipe() + childpid = os.fork() + if not childpid: + os.close(p[0]) + os.dup2(p[1], 1) + os.dup2(fd, 2) + os.close(p[1]) + os.close(fd) + os.execv(argList[0], argList) + log("failed to exec %s", argList) + sys.exit(1) + + os.close(p[1]) + + num = '' + sync = 0 + s = 'a' + while s: + try: + s = os.read(p[0], 1) + os.write(fd, s) + + if s != '\n': + try: + num = num + s + except: + pass + else: + if num: + val = string.split(num) + if (val[0] == 'cyl'): + # printf("cyl %5d of %5d | %3d%%\n", + val = int(val[5][:-1]) + w and w.set(val) + # sync every 10% + if sync + 10 <= val: + isys.sync() + sync = val + num = '' + except OSError, args: + (errno, str) = args + if (errno != 4): + raise IOError, args + + try: + (pid, status) = os.waitpid(childpid, 0) + except OSError, (num, msg): + print __name__, "waitpid:", msg + + os.close(fd) + + w and w.pop() + + isys.flushDriveDict() + + if os.WIFEXITED(status) and (os.WEXITSTATUS(status) == 0): + return 0 + + return 1 + def openDevices (self, intf = None, initAll = 0, zeroMbr = 0): if self.disks: return @@ -1442,9 +1531,19 @@ class DiskSet: continue else: recreate = 1 + if recreate == 1 and not flags.test: + if iutil.getArch() == "s390" or iutil.getArch() == "s390x": + if (self.dasdFmt(intf, drive)): + DiskSet.skippedDisks.append(drive) + continue + else: + try: + dev.disk_create(getDefaultDiskType()) + except parted.error, msg: + DiskSet.skippedDisks.append(drive) + continue try: - dev.disk_create(getDefaultDiskType()) disk = parted.PedDisk.open(dev) self.disks[drive] = disk except parted.error, msg: @@ -1457,8 +1556,17 @@ class DiskSet: DiskSet.skippedDisks.append(drive) continue elif ret == -1: + if iutil.getArch() == "s390" or iutil.getArch() == "s390x": + if (self.dasdFmt(intf, drive)): + DiskSet.skippedDisks.append(drive) + continue + else: + try: + dev.disk_create(getDefaultDiskType()) + except parted.error, msg: + DiskSet.skippedDisks.append(drive) + continue try: - dev.disk_create(getDefaultDiskType()) disk = parted.PedDisk.open(dev) self.disks[drive] = disk except parted.error, msg: @@ -1528,6 +1636,10 @@ def checkNoDisks(diskset, intf): sys.exit(0) def partitionObjectsInitialize(diskset, partitions, dir, intf): + if iutil.getArch() == "s390" or iutil.getArch() == "s390x": + partitions.useAutopartitioning = 0 + partitions.useFdisk = 1 + if dir == DISPATCH_BACK: diskset.closeDevices() return @@ -1560,7 +1672,10 @@ def partitionMethodSetup(partitions, dispatch): skip = not partitions.useAutopartitioning) dispatch.skipStep("autopartitionexecute", skip = not partitions.useAutopartitioning) - dispatch.skipStep("fdisk", skip = not partitions.useFdisk) + if iutil.getArch() == "s390" or iutil.getArch() == "s390x": + dispatch.skipStep("fdasd", skip = not partitions.useFdisk) + else: + dispatch.skipStep("fdisk", skip = not partitions.useFdisk) setProtected(partitions, dispatch) @@ -42,6 +42,7 @@ stepToClasses = { "addswap" : ("upgrade_text", "UpgradeSwapWindow"), "upgrademigratefs" : ("upgrade_text", "UpgradeMigrateFSWindow"), "fdisk" : ("fdisk_text", "fdiskPartitionWindow"), + "fdasd" : ("fdasd_text", "fdasdPartitionWindow"), "partitionmethod" : ("partmethod_text", ("PartitionMethod")), "partition": ("partition_text", ("PartitionWindow")), "findinstall" : ("upgrade_text", ("UpgradeExamineWindow", @@ -80,7 +81,8 @@ if iutil.getArch() == 'sparc': stepToClasses["bootloader"] = ("silo_text", ("SiloAppendWindow", "SiloWindow" "SiloImagesWindow")) - +if iutil.getArch() == 's390' or iutil.getArch() == 's390x': + stepToClasses["bootloader"] = ("zipl_text", ( "ZiplWindow")) class InstallWindow: def __call__ (self, screen, todo): diff --git a/textw/network_text.py b/textw/network_text.py index a820c178a..392a1691c 100644 --- a/textw/network_text.py +++ b/textw/network_text.py @@ -78,14 +78,22 @@ class NetworkWindow: isOn = (boot == "dhcp")) firstg.setField (self.cb, 0, 0, anchorLeft = 1) - secondg = Grid (2, 6) + ask_ptp = None + if len(dev.info["DEVICE"]) >= 3 and dev.info["DEVICE"][:3] == "ctc": + ask_ptp = 1 + secondg = Grid (2, 7) + else: + secondg = Grid (2, 6) + secondg.setField (Label (_("IP address:")), 0, 0, anchorLeft = 1) secondg.setField (Label (_("Netmask:")), 0, 1, anchorLeft = 1) secondg.setField (Label (_("Default gateway (IP):")), 0, 2, anchorLeft = 1) secondg.setField (Label (_("Primary nameserver:")), 0, 3, anchorLeft = 1) secondg.setField (Label (_("Secondary nameserver:")), 0, 4, anchorLeft = 1) secondg.setField (Label (_("Ternary nameserver:")), 0, 5, anchorLeft = 1) - + if ask_ptp: + secondg.setField (Label (_("Point to Point (IP):")), 0, 6, anchorLeft = 1) + self.ip = Entry (16) self.ip.set (dev.get ("ipaddr")) self.nm = Entry (16) @@ -98,7 +106,11 @@ class NetworkWindow: self.ns2.set (network.secondaryNS) self.ns3 = Entry (16) self.ns3.set (network.ternaryNS) + if ask_ptp: + self.ptp = Entry(16) + self.ptp.set (dev.get ("remip")) + self.cb.setCallback (self.setsensitive) self.ip.setCallback (self.calcNM) self.nm.setCallback (self.calcGW) @@ -109,6 +121,8 @@ class NetworkWindow: secondg.setField (self.ns, 1, 3, (1, 0, 0, 0)) secondg.setField (self.ns2, 1, 4, (1, 0, 0, 0)) secondg.setField (self.ns3, 1, 5, (1, 0, 0, 0)) + if ask_ptp: + secondg.setField (self.ptp, 1, 6, (1, 0, 0, 0)) bb = ButtonBar (screen, (TEXT_OK_BUTTON, TEXT_BACK_BUTTON)) @@ -124,7 +138,7 @@ class NetworkWindow: result = toplevel.run () if self.cb.selected (): dev.set (("bootproto", "dhcp")) - dev.unset ("ipaddr", "netmask", "network", "broadcast") + dev.unset ("ipaddr", "netmask", "network", "broadcast", "remip") else: try: (net, bc) = isys.inet_calcNetBroad (self.ip.value (), self.nm.value ()) @@ -137,6 +151,8 @@ class NetworkWindow: dev.set (("bootproto", "static")) dev.set (("ipaddr", self.ip.value ()), ("netmask", self.nm.value ()), ("network", net), ("broadcast", bc)) + if ask_ptp: + dev.set (("remip", ptp)) network.gateway = self.gw.value () network.primaryNS = self.ns.value () network.secondaryNS = self.ns2.value() diff --git a/textw/partition_text.py b/textw/partition_text.py index 52bea4ec5..6688a72bf 100644 --- a/textw/partition_text.py +++ b/textw/partition_text.py @@ -943,13 +943,23 @@ class PartitionWindow: if type == "RAID": self.editRaidRequest(request) elif type == "NEW": - self.editPartitionRequest(request, isNew = 1) + if iutil.getArch() == "s390" or iutil.getArch() == "s390x": + self.intf.messageWindow(_("Error"), + _("You must go back and use fdasd to initialize this partition")) + else: + self.editPartitionRequest(request, isNew = 1) else: self.editPartitionRequest(request) def deleteCb(self): partition = self.lb.current() + if (iutil.getArch() == "s390" or iutil.getArch() == "s390x") \ + and type(partition) != type("RAID"): + self.intf.messageWindow(_("Error"), + _("DASD partitions can only be deleted with fdasd")) + return + if doDeletePartitionByRequest(self.intf, self.partitions, partition): self.refresh() @@ -987,11 +997,23 @@ class PartitionWindow: col_label_align=[CENTER, CENTER,CENTER,CENTER,CENTER,CENTER]) self.g.add(self.lb, 0, 1) - self.bb = ButtonBar (screen, ((_("New"), "new", "F2"), (_("Edit"), "edit", "F3"), (_("Delete"), "delete", "F4"), (_("RAID"), "raid", "F11"), TEXT_OK_BUTTON, TEXT_BACK_BUTTON)) + if iutil.getArch() == "s390" or iutil.getArch() == "s390x": + self.bb = ButtonBar (screen, ((_("Edit"), "edit", "F3"), + (_("Delete"), "delete", "F4"), + (_("RAID"), "raid", "F11"), + TEXT_OK_BUTTON, TEXT_BACK_BUTTON)) + screen.pushHelpLine( _(" F1-Help F3-Edit F4-Delete F5-Reset F12-OK ")) + else: + self.bb = ButtonBar (screen, ((_("New"), "new", "F2"), + (_("Edit"), "edit", "F3"), + (_("Delete"), "delete", "F4"), + (_("RAID"), "raid", "F11"), + TEXT_OK_BUTTON, TEXT_BACK_BUTTON)) + + screen.pushHelpLine( _(" F1-Help F2-New F3-Edit F4-Delete F5-Reset F12-OK ")) + self.g.add(self.bb, 0, 2, (0, 1, 0, 0)) self.g.addHotKey("F5") - screen.pushHelpLine( _(" F1-Help F2-New F3-Edit F4-Delete F5-Reset F12-OK ")) - self.populate() while 1: |