diff options
author | Jeremy Katz <katzj@redhat.com> | 2003-03-21 00:09:53 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2003-03-21 00:09:53 +0000 |
commit | c29f0955045cdd02965a14300ce5e99364db2d1b (patch) | |
tree | d84a948b5288d9b0b9bd28649f608b8df9f18ea0 | |
parent | 720f69db5a6df4a3d6afe90ea228b5a90fe41333 (diff) | |
download | anaconda-c29f0955045cdd02965a14300ce5e99364db2d1b.tar.gz anaconda-c29f0955045cdd02965a14300ce5e99364db2d1b.tar.xz anaconda-c29f0955045cdd02965a14300ce5e99364db2d1b.zip |
merge taroon branch up until now. tagged as before-taroon-merge before and
will be tagged after-taroon-merge after. taroon at this point is tagged
taroon-merge-point for where to base merges from in the future
46 files changed, 1809 insertions, 506 deletions
diff --git a/Makefile.inc b/Makefile.inc index 99db07128..ad57fd498 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -1,8 +1,8 @@ # # define destination locations # -VERSION = 9.0 -RELEASE = 4 +VERSION = 9.0.1 +RELEASE = 0 TIMESTAMP := $(shell date "+.%Y%m%d%H%M%S") SNAPRELEASE := $(RELEASE)$(TIMESTAMP) @@ -212,6 +212,15 @@ progmode = 'install' # 'rescue', or 'install' method = None # URL representation of install method logFile = None # may be a file object or a file name +# should we ever try to probe for X stuff? this will give us a convenient +# out eventually to circumvent all probing and just fall back to text mode +# on hardware where we break things if we probe +doXProbe = 1 + +# probing for hardware on an s390 seems silly... +if iutil.getArch() == "s390": + doXProbe = 0 + # # xcfg - xserver info (?) # mousehw - mouseinfo info @@ -346,9 +355,10 @@ if (debug): import isys import instdata import floppy -import xsetup -import rhpl.xhwstate as xhwstate +if doXProbe: + import xsetup + import rhpl.xhwstate as xhwstate import rhpl.keyboard as keyboard # handle traceonly and exit @@ -458,30 +468,35 @@ if os.environ.has_key('DISPLAY') and display_mode == 'g': else: x_already_set = 0 -# -# Probe what is available for X and setup a hardware state -# -# try to probe interesting hw -import rhpl.xserver as xserver -skipddcprobe = (skipddc or (x_already_set and flags.test)) -skipmouseprobe = not (not os.environ.has_key('DISPLAY') or flags.setupFilesystems) +if doXProbe: + # + # Probe what is available for X and setup a hardware state + # + # try to probe interesting hw + import rhpl.xserver as xserver + skipddcprobe = (skipddc or (x_already_set and flags.test)) + skipmouseprobe = not (not os.environ.has_key('DISPLAY') or flags.setupFilesystems) -(videohw, monitorhw, mousehw) = xserver.probeHW(skipDDCProbe=skipddcprobe, - skipMouseProbe = skipmouseprobe) + (videohw, monitorhw, mousehw) = xserver.probeHW(skipDDCProbe=skipddcprobe, + skipMouseProbe = skipmouseprobe) + + # setup a X hw state for use later with configuration. + try: + xcfg = xhwstate.XF86HardwareState(defcard=videohw, defmon=monitorhw) + except Exception, e: + print _("Unable to instantiate a X hardware state object.") + xcfg = None +else: + videohw = None + monitorhw = None + mousehw = None + xcfg = None # keyboard kbd = keyboard.Keyboard() if keymap: kbd.set(keymap) -# setup a X hw state for use later with configuration -xcfg = xhwstate.XF86HardwareState(defcard=videohw, defmon=monitorhw) -try: - xcfg = xhwstate.XF86HardwareState(defcard=videohw, defmon=monitorhw) -except: - print _("Unable to instantiate a X hardware state object.") - xcfg = None - # # delay to let use see status of attempt to probe hw # @@ -501,8 +516,7 @@ if (display_mode != 't' and method and display_mode = 't' time.sleep(2) -# XXX should be fixed to be more generic instead of just ifarching -if iutil.getArch() != "s390": +if doXProbe: # if no mouse we force text mode mousedev = mousehw.get() if display_mode != 't' and mousedev[0] == "No - mouse": @@ -602,7 +616,7 @@ if (display_mode == 'g'): splashScreenShow(configFileData) from gui import InstallInterface - except: + except Exception, e: # if we're not going to really go into GUI mode, we need to get # back to vc1 where the text install is going to pop up. if not x_already_set: @@ -612,18 +626,14 @@ if (display_mode == 'g'): if 'DISPLAY' in os.environ.keys(): del os.environ['DISPLAY'] time.sleep(2) - from text import InstallInterface if (display_mode == 't'): from text import InstallInterface from text import stepToClasses -if display_mode == "t": - intf = InstallInterface () -else: - # determine the mode we actually ended up in - intf = InstallInterface () +# go ahead and set up the interface +intf = InstallInterface () # imports after setting up the path if method: @@ -693,10 +703,10 @@ if monitorhw: # # not sure what to do here - somehow we didnt detect anything # -if xcfg is None: +if xcfg is None and doXProbe: try: xcfg = xhwstate.XF86HardwareState() - except: + except Exception, e: print _("Unable to instantiate a X hardware state object.") xcfg = None diff --git a/anaconda.spec.in b/anaconda.spec.in index 772f7c692..472083dc8 100644 --- a/anaconda.spec.in +++ b/anaconda.spec.in @@ -1,4 +1,3 @@ -ExclusiveArch: i386 ia64 x86_64 Name: anaconda Version: @@VERSION@@ Release: @@RELEASE@@ @@ -6,7 +5,7 @@ License: GPL Summary: The Red Hat Linux installation program. Group: Applications/System Source: anaconda-%{PACKAGE_VERSION}.tar.bz2 -BuildPreReq: pump-devel, kudzu-devel, pciutils-devel, bzip2-devel, e2fsprogs-devel, python-devel gtk2-devel rpm-python >= 4.2-0.61, newt-devel, rpm-devel, gettext >= 0.11, modutils-devel, rhpl, booty, libxml2-python, zlib-devel, bogl-devel >= 0:0.1.9-17, bogl-bterm >= 0:0.1.9-17, elfutils-devel +BuildPreReq: pump-devel >= 0.8.15, kudzu-devel, pciutils-devel, bzip2-devel, e2fsprogs-devel, python-devel gtk2-devel rpm-python >= 4.2-0.61, newt-devel, rpm-devel, gettext >= 0.11, modutils-devel, rhpl, booty, libxml2-python, zlib-devel, bogl-devel >= 0:0.1.9-17, bogl-bterm >= 0:0.1.9-17, elfutils-devel %ifarch i386 BuildRequires: dietlibc %endif diff --git a/anaconda_log.py b/anaconda_log.py index f0a5424d0..13f4434ed 100644 --- a/anaconda_log.py +++ b/anaconda_log.py @@ -15,11 +15,13 @@ # import sys +import iutil class Anaconda_LogFile: def __init__ (self): self.logFile = None self.logFile2 = None + self.failcount = 0 def close (self): try: @@ -37,27 +39,39 @@ class Anaconda_LogFile: elif file: self.logFile = file else: - self.logFile = open("/dev/tty3", "w") + if iutil.getArch() != "s390": + self.logFile = open("/dev/tty3", "w") + else: + # we don't really want to have to write this stuff to two + # files. + self.logFile = None try: self.logFile2 = open("/tmp/anaconda.log", "a") except: - pass + self.logFile2 = None def __call__ (self, format, *args): if not self.logFile: raise RuntimeError, "log file not open yet" - - if args: - self.logFile.write ("* %s\n" % (format % args)) - else: - self.logFile.write ("* %s\n" % format) - if self.logFile2: + for file in [self.logFile, self.logFile2]: + if file is None: + continue if args: - self.logFile2.write ("* %s\n" % (format % args)) + file.write ("* %s\n" % (format % args)) else: - self.logFile2.write ("* %s\n" % format) - self.logFile2.flush() + file.write ("* %s\n" % format) + + try: + file.flush() + except IOError: + # if we can't write here, there's not much we can do. + # keep a counter of the number of times it's failed + # if we fail more than 10 times, just abort writing to + # the logfile + self.failcount = self.failcount + 1 + if self.failcount > 10: + file = None def getFile (self): return self.logFile.fileno () diff --git a/autopart.py b/autopart.py index dbd44a298..4e2b8e6de 100644 --- a/autopart.py +++ b/autopart.py @@ -137,7 +137,9 @@ def bestPartType(disk, request): raise PartitioningError, "Unable to create additional primary partitions on /dev/%s" % (disk.dev.path[5:]) if request.primary: return parted.PARTITION_PRIMARY - if (numPrimary == (maxPrimary - 1)) and not disk.extended_partition: + if ((numPrimary == (maxPrimary - 1)) and + not disk.extended_partition and + disk.type.check_feature(parted.DISK_TYPE_EXTENDED)): return parted.PARTITION_EXTENDED return parted.PARTITION_PRIMARY @@ -52,7 +52,6 @@ stepToClass = { "addswap" : ("upgrade_swap_gui", "UpgradeSwapWindow"), "upgrademigratefs" : ("upgrade_migratefs_gui", "UpgradeMigrateFSWindow"), "fdisk" : ("fdisk_gui", "FDiskWindow"), - "fdasd" : ("fdasd_gui", "FDasdWindow"), "bootloader": ("bootloader_main_gui", "MainBootloaderWindow"), "bootloaderadvanced": ("bootloader_advanced_gui", "AdvancedBootloaderWindow"), "upgbootloader": ("upgrade_bootloader_gui", "UpgradeBootloaderWindow"), diff --git a/installclass.py b/installclass.py index 0a14e0151..343a24dc6 100644 --- a/installclass.py +++ b/installclass.py @@ -108,7 +108,6 @@ class BaseInstallClass: "autopartition", "autopartitionexecute", "fdisk", - "fdasd", "partition", "partitiondone", "bootloadersetup", @@ -154,18 +153,13 @@ class BaseInstallClass: # XXX ugh, this badly needs some clean up if iutil.getArch() == "x86_64": dispatch.skipStep("bootdisk") - dispatch.skipStep("fdasd", permanent = 1) elif (iutil.getArch() == "alpha" or iutil.getArch() == "ia64" or iutil.getArch() == "sparc" or iutil.getArch() == "ppc"): dispatch.skipStep("bootdisk") dispatch.skipStep("bootloader") - dispatch.skipStep("fdasd", permanent = 1) elif iutil.getArch() == "s390": 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("handleX11pkgs", permanent = 1) dispatch.skipStep("videocard", permanent = 1) @@ -173,8 +167,6 @@ class BaseInstallClass: dispatch.skipStep("xcustom", permanent = 1) dispatch.skipStep("writexconfig", permanent = 1) dispatch.skipStep("bootdisk", permanent = 1) - else: - dispatch.skipStep("fdasd", permanent = 1) # 'noupgrade' can be used on the command line to force not looking # for partitions to upgrade. useful in some cases... diff --git a/instdata.py b/instdata.py index 53d224e61..ce9523905 100644 --- a/instdata.py +++ b/instdata.py @@ -103,8 +103,10 @@ class InstallData: self.xsetup = xsetup def write(self, instPath): - self.langSupport.write (instPath) - self.mouse.write(instPath) + self.langSupport.write (instPath) + if self.mouse is not None: + self.mouse.write(instPath) + self.keyboard.write (instPath) self.network.write (instPath) self.timezone.write (instPath) @@ -126,8 +128,10 @@ class InstallData: self.instLanguage.writeKS(f) self.langSupport.writeKS(f) self.keyboard.writeKS(f) - self.mouse.writeKS(f) - self.xsetup.writeKS(f, self.desktop) + if self.mouse is not None: + self.mouse.writeKS(f) + if self.xsetup is not None: + self.xsetup.writeKS(f, self.desktop) self.network.writeKS(f) self.rootPassword.writeKS(f, self.auth) self.firewall.writeKS(f) diff --git a/isys/Makefile b/isys/Makefile index c5b6454ea..673ee934f 100644 --- a/isys/Makefile +++ b/isys/Makefile @@ -47,7 +47,7 @@ all: subdirs $(PYMODULES) libisys.a $(DIETLIB) $(DIET) $(CC) -c $(CFLAGS) -DGZLIB=1 -DDIET=1 "-Du_char=unsigned char" -o $@ $< _isys.so: isys.lo $(SOBJECTS) - gcc -shared -g -o $@ isys.lo $(SOBJECTS) $(LOADLIBES) + gcc -shared -g -fPIC -o $@ isys.lo $(SOBJECTS) $(LOADLIBES) _silo.so: silo.c gcc -shared $(CFLAGS) -fpic -o $@ silo.c ../balkan/libbalkan.a diff --git a/isys/devnodes.c b/isys/devnodes.c index e24b9e8c2..c130499e0 100644 --- a/isys/devnodes.c +++ b/isys/devnodes.c @@ -170,8 +170,13 @@ int devMakeInode(char * devName, char * path) { type = S_IFBLK; major = 94; minor = ( devName[4] - 'a' ) * 4; - if (devName[5] && isdigit(devName[5]) ) - minor += devName[5] - '0'; + if (devName[5] && isalpha(devName[5])) { + minor += 26 * 4 + ( devName[5] - 'a' ) * 4; + if (devName[6] && isdigit(devName[6]) ) + minor += devName[6] - '0'; + } else if (devName[5] && isdigit(devName[5])) { + minor += devName[5] - '0'; + } } else if (!strncmp(devName, "mnd", 4)) { /* IBM MiniDisk Drives */ type = S_IFBLK; diff --git a/isys/gzlib/Makefile b/isys/gzlib/Makefile index e959dc542..231098874 100644 --- a/isys/gzlib/Makefile +++ b/isys/gzlib/Makefile @@ -1,6 +1,6 @@ include ../../Makefile.inc -CFLAGS += -I . -Os -g -Wall +CFLAGS += -I . -Os -fPIC -g -Wall SOURCES = bits.c gzip.c inflate.c lzw.c trees.c unzip.c util.c zip.c binding.c \ deflate.c zip.c OBJS = $(patsubst %.c,%.o,$(SOURCES)) diff --git a/isys/isys.c b/isys/isys.c index 02ffe0d45..21bc300d7 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -100,6 +100,8 @@ static PyObject * py_bind_textdomain_codeset(PyObject * o, PyObject * args); static PyObject * getLinkStatus(PyObject * s, PyObject * args); static PyObject * hasIdeRaidMagic(PyObject * s, PyObject * args); static PyObject * start_bterm(PyObject * s, PyObject * args); +static PyObject * py_getDasdPorts(PyObject * s, PyObject * args); +static PyObject * py_isUsableDasd(PyObject * s, PyObject * args); static PyMethodDef isysModuleMethods[] = { { "ejectcdrom", (PyCFunction) doEjectCdrom, METH_VARARGS, NULL }, @@ -149,6 +151,8 @@ static PyMethodDef isysModuleMethods[] = { { "getLinkStatus", (PyCFunction) getLinkStatus, METH_VARARGS, NULL }, { "hasIdeRaidMagic", (PyCFunction) hasIdeRaidMagic, METH_VARARGS, NULL }, { "startBterm", (PyCFunction) start_bterm, METH_VARARGS, NULL }, + { "getDasdPorts", (PyCFunction) py_getDasdPorts, METH_VARARGS, NULL}, + { "isUsableDasd", (PyCFunction) py_isUsableDasd, METH_VARARGS, NULL}, { NULL } } ; @@ -701,9 +705,7 @@ static PyObject * probedListScsi(probedListObject * o, PyObject * args) { static PyObject * probedListDasd(probedListObject * o, PyObject * args) { if (!PyArg_ParseTuple(args, "")) return NULL; -#if defined (__s390__) || defined (__s390x__) kdFindDasdList(&o->list, 0); -#endif Py_INCREF(Py_None); return Py_None; @@ -1371,6 +1373,19 @@ static PyObject * getLinkStatus(PyObject * s, PyObject * args) { return Py_BuildValue("i", ret); } +static PyObject * py_getDasdPorts(PyObject * o, PyObject * args) { + if (!PyArg_ParseTuple(args, "")) return NULL; + + return Py_BuildValue("s", getDasdPorts()); +} + +static PyObject * py_isUsableDasd(PyObject * o, PyObject * args) { + char *devname; + if (!PyArg_ParseTuple(args, "s", &devname)) + return NULL; + return Py_BuildValue("i", isUsableDasd(devname)); +} + static PyObject * printObject (PyObject * o, PyObject * args) { PyObject * obj; char buf[256]; diff --git a/isys/isys.py b/isys/isys.py index f6450681a..2ddb44e1c 100644 --- a/isys/isys.py +++ b/isys/isys.py @@ -304,6 +304,12 @@ def cdromList(): list.sort() return list +def getDasdPorts(): + return _isys.getDasdPorts() + +def isUsableDasd(device): + return _isys.isUsableDasd(device) + def makeDevInode(name, fn=None): if fn: _isys.mkdevinode(name, fn) diff --git a/isys/lang.c b/isys/lang.c index 74e09a53c..684ae2247 100644 --- a/isys/lang.c +++ b/isys/lang.c @@ -25,6 +25,9 @@ int isysLoadFont(void) { gzFile stream; int rc; +#if defined (__s390__) || defined (__s390x__) + return 0; +#endif stream = gunzip_open("/etc/screenfont.gz"); if (!stream) return -EACCES; @@ -56,6 +59,9 @@ int isysLoadFont(void) { int isysSetUnicodeKeymap(void) { int console; +#if defined (__s390__) || defined (__s390x__) + return 0; +#endif console = open("/dev/console", O_RDWR); if (console < 0) return -EACCES; @@ -76,6 +82,9 @@ int loadKeymap(gzFile stream) { int magic; short keymap[NR_KEYS]; +#if defined (__s390__) || defined (__s390x__) + return 0; +#endif if (gunzip_read(stream, &magic, sizeof(magic)) != sizeof(magic)) return -EIO; diff --git a/isys/probe.c b/isys/probe.c index 71df5ceab..4d37e13a8 100644 --- a/isys/probe.c +++ b/isys/probe.c @@ -9,6 +9,10 @@ #include <string.h> #include <sys/ioctl.h> #include <unistd.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/ioctl.h> +#include <linux/fs.h> #include "isys.h" #include "probe.h" @@ -152,6 +156,170 @@ bye: return 0; } +#if defined(__s390__) || defined(__s390x__) +/* s390 stuff to detect DASDs */ +int vtoc_read_volume_label (int fd, unsigned long vlabel_start, + volume_label_t *vlabel) { + int rc; + if (lseek(fd, vlabel_start, SEEK_SET) < 0) { + /* fprintf(stderr, "Could not read volume label.\n"); */ + return 2; + } + rc = read(fd, vlabel, sizeof(volume_label_t)); + if (rc != sizeof(volume_label_t)) { + /* fprintf(stderr, "Could not read volume label, DASD is probably unformatted\n"); */ + return 1; + } + return 0; +} + +int read_vlabel(dasd_information_t *dasd_info, int fd, int blksize, volume_label_t *vlabel) { + volume_label_t tmp; + unsigned long pos; + int ret; + + pos = dasd_info->label_block * blksize; + + memset(vlabel, 0, sizeof(volume_label_t)); + if ((strncmp(dasd_info->type, "ECKD", 4) == 0) && + (!dasd_info->FBA_layout)) { + /* OS/390 and zOS compatible disk layout */ + return vtoc_read_volume_label(fd, pos, vlabel); + } + else { + /* standard LINUX disk layout */ + ret = vtoc_read_volume_label(fd, pos, &tmp); + if(!ret) { + memcpy(vlabel->vollbl, &tmp, sizeof(tmp)-4); + return 0; + } + return ret; + } +} +#endif + +int isUsableDasd(char *device) { +#if !defined(__s390__) && !defined(__s390x__) + return 0; +#else + char devname[16]; + char label[5], v4_hex[9]; + char v4ebcdic_hex[] = "e5d6d3f1"; /* VOL1 */ + char l4ebcdic_hex[] = "d3d5e7f1"; /* LNX1 */ + int f, ret, blksize; + dasd_information_t dasd_info; + volume_label_t vlabel; + memset(&dasd_info, 0, sizeof(dasd_info)); + strcpy(devname, "/dev/"); + strcat(devname, device); + devMakeInode(device, devname); + if((f = open(devname, O_RDONLY)) == -1) { + unlink(devname); + return 0; + } + if (ioctl(f, BLKSSZGET, &blksize) != 0) { + close(f); + unlink(devname); + /* fprintf(stderr, "Could not retrieve blocksize information!\n"); */ + return 0; + } + if (ioctl(f, BIODASDINFO, &dasd_info) != 0) { + close(f); + unlink(devname); + /* fprintf(stderr, "Could not retrieve disk information!\n"); */ + return 0; + } + ret = read_vlabel(&dasd_info, f, blksize, &vlabel); + + if (ret == 2) { + close(f); + unlink(devname); + return 0; + } else if (ret == 1) { /* probably unformatted DASD */ + close(f); + unlink(devname); + /* fprintf(stderr, "Found a usable device: %s\n", devname); */ + return 1; + } + memset(label, 0, 5); + memset(v4_hex, 0, 9); + strncpy(label, vlabel.volkey, 4); + sprintf(v4_hex, "%02x%02x%02x%02x", label[0], label[1], label[2], label[3]); + if(!strncmp(v4_hex, v4ebcdic_hex, 9) || !strncmp(v4_hex, l4ebcdic_hex, 9)) { + /* fprintf(stderr, "Found a usable device: %s\n", devname); */ + return 1; + } + return 0; +#endif +} + +char *getDasdPorts() { +#if !defined(__s390__) && !defined(__s390x__) + return 0; +#else + char * line, *ports = NULL; + char devname[7]; + char port[6]; + FILE *fd; + int ret; + fd = fopen ("/proc/dasd/devices", "r"); + if(!fd) { + return NULL; + } + line = (char *)malloc(100*sizeof(char)); + while (fgets (line, 100, fd) != NULL) { + if ((strstr(line, "unknown") != NULL)) { + continue; + } + ret = sscanf (line, "%[A-Za-z0-9](ECKD) at ( %*d: %*d) is %s : %*s", port, devname); + if (ret == 2) { + if(!ports) { + ports = (char *)malloc(strlen(port) + 1); + strcpy(ports, port); + } else { + ports = (char *)realloc(ports, strlen(ports) + strlen(port) + 2); + strcat(ports, ","); + strcat(ports, port); + } + } + } + if (fd) fclose(fd); + return ports; +#endif +} + +int kdFindDasdList(struct knownDevices * devices, int code) { + char devname[7]; + char *line; + int ret; + FILE *fd; + + struct kddevice device; + + fd = fopen ("/proc/dasd/devices", "r"); + if(!fd) { + return 0; + } + + line = (char *)malloc(100*sizeof(char)); + while (fgets (line, 100, fd) != NULL) { + ret = sscanf (line, "%*[A-Za-z0-9](ECKD) at ( %*d: %*d) is %s : %*s", + devname); + if (ret == 1 && !deviceKnown(devices, devname) + && isUsableDasd(devname)) { + device.code = code; + device.class = CLASS_HD; + device.name = strdup(devname); + device.model = strdup("IBM DASD"); + addDevice(devices, device); + } + } + if (fd) fclose(fd); + qsort(devices->known, devices->numKnown, sizeof(*devices->known), + sortDevices); + return 0; +} + int kdFindIdeList(struct knownDevices * devices, int code) { return kdFindFilteredIdeList(devices, code, NULL); } @@ -408,47 +576,6 @@ bye: return val; } -#if defined (__s390__) || defined (__s390x__) -int kdFindDasdList(struct knownDevices * devices, int code) { - /* patch for s390 by Oliver Paukstadt <oliver.paukstadt@millenux.com> */ - /* based upon code by Erik Tews <erik.tews@gmx.net> */ - FILE * fd; - struct kddevice device; - char line[200]; - char name[10]; - char status[10]; - char model[30]; - - if (access("/proc/dasd/devices", R_OK)) return 0; - /* a system without /proc/dasd/devices is nothing to worry about */ - - fd = fopen ("/proc/dasd/devices", "r"); - if (fd == NULL) return 1; - - /* Every line in this file is a harddisk */ - while ((fgets(line, 190, fd)) != NULL) { - 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 ((num == 2) && (strlen(name) <= 6) && !deviceKnown(devices, name)) { - snprintf(model, sizeof(model), "IBM DASD (%s)", status); - device.class = CLASS_HD; - device.name = strdup(name); - device.model = strdup(model); - device.code = code; - addDevice(devices, device); - } - } - fclose (fd); - - qsort(devices->known, devices->numKnown, sizeof(*devices->known), - sortDevices); - return 0; -} -#endif - struct knownDevices kdInit(void) { struct knownDevices kd; diff --git a/isys/probe.h b/isys/probe.h index 90a4ee4c0..f3886f0d7 100644 --- a/isys/probe.h +++ b/isys/probe.h @@ -3,6 +3,9 @@ #include "kudzu/kudzu.h" +#define DASD_IOCTL_LETTER 'D' +#define BIODASDINFO _IOR(DASD_IOCTL_LETTER,1,dasd_information_t) + struct kddevice { char * name; /* malloced */ char * model; @@ -16,12 +19,65 @@ struct knownDevices { int numKnownAlloced; }; +#if defined(__s390__) || defined(__s390x__) +/* + * struct dasd_information_t + * represents any data about the data, which is visible to userspace + */ +typedef struct dasd_information_t { + unsigned int devno; /* S/390 devno */ + unsigned int real_devno; /* for aliases */ + unsigned int schid; /* S/390 subchannel identifier */ + unsigned int cu_type : 16; /* from SenseID */ + unsigned int cu_model : 8; /* from SenseID */ + unsigned int dev_type : 16; /* from SenseID */ + unsigned int dev_model : 8; /* from SenseID */ + unsigned int open_count; + unsigned int req_queue_len; + unsigned int chanq_len; + char type[4]; /* from discipline.name, 'none' for unknown */ + unsigned int status; /* current device level */ + unsigned int label_block; /* where to find the VOLSER */ + unsigned int FBA_layout; /* fixed block size (like AIXVOL) */ + unsigned int characteristics_size; + unsigned int confdata_size; + char characteristics[64]; /* from read_device_characteristics */ + char configuration_data[256]; /* from read_configuration_data */ +} dasd_information_t; + +typedef struct cchhb +{ + u_int16_t cc; + u_int16_t hh; + u_int8_t b; +} __attribute__ ((packed)) cchhb_t; + +typedef struct volume_label +{ + char volkey[4]; /* volume key = volume label */ + char vollbl[4]; /* volume label */ + char volid[6]; /* volume identifier */ + u_int8_t security; /* security byte */ + cchhb_t vtoc; /* VTOC address */ + char res1[5]; /* reserved */ + char cisize[4]; /* CI-size for FBA,... */ + /* ...blanks for CKD */ + char blkperci[4]; /* no of blocks per CI (FBA), blanks for CKD */ + char labperci[4]; /* no of labels per CI (FBA), blanks for CKD */ + char res2[4]; /* reserved */ + char lvtoc[14]; /* owner code for LVTOC */ + char res3[29]; /* reserved */ +} __attribute__ ((packed)) volume_label_t; +#endif + + /* 0 if the device should be filtered from the list, 1 if it should be included */ typedef int (*kdFilterType)(const struct kddevice * dev); struct knownDevices kdInit(void); int kdFindNetList(struct knownDevices * devices, int code); +int kdFindDasdList(struct knownDevices * devices, int code); int kdFindIdeList(struct knownDevices * devices, int code); int kdFindFilteredIdeList(struct knownDevices * devices, int code, kdFilterType filter); @@ -29,5 +85,6 @@ int kdFindScsiList(struct knownDevices * devices, int code); void kdFree(struct knownDevices * devices); void kdAddDevice(struct knownDevices * devices, enum deviceClass devClass, char * devName, char * devModel); +char *getDasdPorts(); #endif diff --git a/iw/ipwidget.py b/iw/ipwidget.py index 19375e210..cc9939959 100644 --- a/iw/ipwidget.py +++ b/iw/ipwidget.py @@ -20,11 +20,9 @@ import gettext import gtk import gobject import gui +import network from rhpl.translate import _, N_ -ip_re = re.compile('^([0-2]?[0-9]?[0-9])\\.([0-2]?[0-9]?[0-9])\\.([0-2]?[0-9]?[0-9])\\.([0-2]?[0-9]?[0-9])$') -_=gettext.gettext - ip_fields = ['entry1', 'entry2', 'entry3', 'entry4'] # Includes an error message, and the widget with problems @@ -72,18 +70,8 @@ class IPEditor: def hydrate (self, ip_string): self.clear_entries() - #Sanity check the string - m = ip_re.match (ip_string) - try: - if not m: - return - octets = m.groups() - if len(octets) != 4: - return - for octet in octets: - if (int(octet) < 0) or (int(octet) > 255): - return - except TypeError: + octets = network.sanityCheckIPString(ip_string) + if octets is None: return i = 0 diff --git a/iw/network_gui.py b/iw/network_gui.py index 678a23506..164caa5a8 100644 --- a/iw/network_gui.py +++ b/iw/network_gui.py @@ -225,8 +225,8 @@ class NetworkWindow(InstallWindow): options = [(_("_IP Address"), "ipaddr"), (_("Net_mask"), "netmask")] - if len(dev) >= 3 and dev[:3] == 'ctc': - newopt = (_("Point to Point (IP)"), "remip") + if (isPtpDev(dev)): + newopt = (_("_Point to Point (IP)"), "remip") options.append(newopt) ipTable = gtk.Table(len(options), 2) diff --git a/iw/partition_gui.py b/iw/partition_gui.py index 8ec407afb..64492d3df 100644 --- a/iw/partition_gui.py +++ b/iw/partition_gui.py @@ -1335,18 +1335,12 @@ class PartitionWindow(InstallWindow): buttonBox = gtk.HButtonBox() buttonBox.set_layout(gtk.BUTTONBOX_SPREAD) - if iutil.getArch() == "s390": - ops = ((_("_Edit"), self.editCb), - (_("_Delete"), self.deleteCb), - (_("_Reset"), self.resetCb), - (_("Make _RAID"), self.makeraidCB),) - else: - ops = ((_("Ne_w"), self.newCB), - (_("_Edit"), self.editCb), - (_("_Delete"), self.deleteCb), - (_("Re_set"), self.resetCb), - (_("R_AID"), self.makeraidCB), - (_("_LVM"), self.makeLvmCB)) + ops = ((_("Ne_w"), self.newCB), + (_("_Edit"), self.editCb), + (_("_Delete"), self.deleteCb), + (_("Re_set"), self.resetCb), + (_("R_AID"), self.makeraidCB), + (_("_LVM"), self.makeLvmCB)) for label, cb in ops: button = gtk.Button(label) diff --git a/iw/zipl_gui.py b/iw/zipl_gui.py index e646fb209..78aa31422 100644 --- a/iw/zipl_gui.py +++ b/iw/zipl_gui.py @@ -12,14 +12,14 @@ # # must replace with explcit form so update disks will work +import isys +import gtk +import gui +import iutil +import string from iw_gui import * - -from gtk import * -from gnome.ui import * from rhpl.translate import _, N_ -import iutil from package_gui import queryUpgradeContinue -import gui class ZiplWindow (InstallWindow): checkMark = None @@ -56,7 +56,7 @@ class ZiplWindow (InstallWindow): #sys.exit(0) def getNext (self): - self.bl.args.set(self.appendEntry.get_text()) + self.bl.args.set(self.kernelEntry.get_text()) # ZiplWindow tag="zipl" @@ -69,9 +69,9 @@ class ZiplWindow (InstallWindow): defaultDevice = bl.images.getDefault() self.ignoreSignals = 0 - box = GtkVBox(FALSE, 5) + box = gtk.VBox(gtk.FALSE, 5) box.set_border_width(5) - label = GtkLabel(_("The z/IPL Boot Loader will now be installed " + label = gtk.Label(_("The z/IPL Boot Loader will now be installed " "on your system." "\n" "\n" @@ -91,21 +91,45 @@ class ZiplWindow (InstallWindow): "You can now enter any additional kernel parameters " "which your machine or your setup may require.")) label.set_size_request(500, -1) - label.set_line_wrap(TRUE) + label.set_line_wrap(gtk.TRUE) label.set_alignment(0.0, 0.0) label.set_padding(50,50) - box.pack_start(label, FALSE) + box.pack_start(label, gtk.FALSE) - box.pack_start (GtkHSeparator (), FALSE) + box.pack_start (gtk.HSeparator (), gtk.FALSE) - label = GtkLabel(_("Kernel Parameters") + ":") + label = gtk.Label(_("Kernel Parameters") + ":") label.set_alignment(0.0, 0.5) - self.appendEntry = GtkEntry() + self.kernelEntry = gtk.Entry() + clabel1 = gtk.Label(_("Chandev Parameters") + ":") + clabel1.set_alignment(0.0, 0.5) + self.chandeventry1 = gtk.Entry() + clabel2 = gtk.Label(_("Chandev Parameters") + ":") + clabel2.set_alignment(0.0, 0.5) + self.chandeventry2 = gtk.Entry() if bl.args and bl.args.get(): - self.appendEntry.set_text(bl.args.get()) - hbox = GtkHBox(FALSE, 5) - hbox.pack_start(label, FALSE) - hbox.pack_start(self.appendEntry) - box.pack_start(hbox, FALSE) + self.kernelEntry.set_text(bl.args.get()) + if isys.getDasdPorts(): + self.kernelEntry.set_text(self.kernelEntry.get_text() + " dasd=" + isys.getDasdPorts()) + if bl.args and bl.args.chandevget(): + cdevs = bl.args.chandevget() + self.chandeventry1.set_text('') + self.chandeventry2.set_text('') + if len(cdevs) > 0: + self.chandeventry1.set_text(cdevs[0]) + if len(cdevs) > 1: + self.chandeventry2.set_text(string.join(cdevs[1:],';')) + hbox = gtk.HBox(gtk.FALSE, 5) + hbox.pack_start(label, gtk.FALSE) + hbox.pack_start(self.kernelEntry) + box.pack_start(hbox, gtk.FALSE) + hbox1 = gtk.HBox(gtk.FALSE, 5) + hbox1.pack_start(clabel1, gtk.FALSE) + hbox1.pack_start(self.chandeventry1) + box.pack_start(hbox1, gtk.FALSE) + hbox2 = gtk.HBox(gtk.FALSE, 5) + hbox2.pack_start(clabel2, gtk.FALSE) + hbox2.pack_start(self.chandeventry2) + box.pack_start(hbox2, gtk.FALSE) return box diff --git a/kickstart.py b/kickstart.py index a25ad5a8c..ded9ef5ae 100644 --- a/kickstart.py +++ b/kickstart.py @@ -1085,7 +1085,6 @@ 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): @@ -1114,7 +1113,6 @@ class KickstartBase(BaseInstallClass): dispatch.skipStep("partitionmethod") dispatch.skipStep("partitionmethodsetup") dispatch.skipStep("fdisk") - dispatch.skipStep("fdasd") dispatch.skipStep("autopartition") dispatch.skipStep("bootdisk") return diff --git a/loader2/Makefile b/loader2/Makefile index 45fa2f51e..778db6adf 100644 --- a/loader2/Makefile +++ b/loader2/Makefile @@ -30,14 +30,14 @@ SOURCES = $(subst .o,.c,$(OBJS)) loader.c HWLIBS = -lkudzu_loader -lpci DEBUG = -ggdb -COPTS = $(DEBUG) -Os -Wall -DVERSION='"$(VERSION)"' +COPTS = $(DEBUG) -Os -Wall -DUSE_LOGDEV -DVERSION='"$(VERSION)"' CFLAGS = $(COPTS) -ffunction-sections -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DHAVE_LIBIO_H STATIC = -static +REALCC=gcc ifeq (1, $(USEDIET)) CFLAGS += -DGZLIB=1 DIET=diet -REALCC=gcc CC=$(DIET) $(REALCC) BTERMLIB = -lbtermdiet -lbogldiet WLITELIB = -lwlitediet @@ -51,8 +51,8 @@ else OBJS += wcstubs.o endif -ifeq (i386, $(ARCH)) -COPTS += -DUSE_LOGDEV +ifneq (,$(filter s390 s390x,$(ARCH))) +BINS += linuxrc.s390 endif # translation stuff @@ -80,6 +80,9 @@ loader.po: $(wildcard *.c) xgettext --default-domain=loader --add-comments \ --keyword=_ --keyword=N_ *.c +linuxrc.s390: + @echo "Nothing to do for $@" + init: init.o $(CC) $(STATIC) $(COPTS) $(LDFLAGS) -o $@ init.o @@ -118,7 +121,7 @@ install: all mkdir -p $(DESTDIR)/$(RUNTIMEDIR)/loader for n in $(BINS); do \ install -m 755 $$n $(DESTDIR)/$(RUNTIMEDIR)/loader; \ - strip $(DESTDIR)/$(RUNTIMEDIR)/loader/$$n; \ + strip $(DESTDIR)/$(RUNTIMEDIR)/loader/$$n || :; \ done install -m 644 loader.tr $(DESTDIR)/$(RUNTIMEDIR)/loader install -m 644 module-info $(DESTDIR)/$(RUNTIMEDIR)/loader diff --git a/loader2/cdinstall.c b/loader2/cdinstall.c index f9366f660..1db6c2700 100644 --- a/loader2/cdinstall.c +++ b/loader2/cdinstall.c @@ -26,10 +26,7 @@ #include <sys/mount.h> #include <sys/ioctl.h> #include <unistd.h> - -#if !defined(__s390__) && !defined(__s390x__) #include <linux/cdrom.h> -#endif #include "kickstart.h" #include "loader.h" @@ -49,9 +46,6 @@ static int getISOStatusFromFD(int isofd, char *mediasum); /* ejects the CD device the device node /tmp/cdrom points at */ void ejectCdrom(void) { -#if defined(__s390__) || defined(__s390x__) - return; -#else int ejectfd; logMessage("ejecting /tmp/cdrom..."); @@ -62,7 +56,6 @@ void ejectCdrom(void) { } else { logMessage("eject failed %d ", errno); } -#endif } /* diff --git a/loader2/hardware.c b/loader2/hardware.c index 569d7dade..bc92e61da 100644 --- a/loader2/hardware.c +++ b/loader2/hardware.c @@ -6,7 +6,7 @@ * Michael Fulbright <msf@redhat.com> * Jeremy Katz <katzj@redhat.com> * - * Copyright 1997 - 2002 Red Hat, Inc. + * Copyright 1997 - 2003 Red Hat, Inc. * * This software may be freely redistributed under the terms of the GNU * General Public License. @@ -21,6 +21,7 @@ #include <string.h> #include <stdlib.h> #include <unistd.h> +#include <ctype.h> #include "loader.h" #include "hardware.h" @@ -30,6 +31,21 @@ /* JKFIXME: this is the same hack as in loader.c for second stage modules */ extern struct moduleBallLocation * secondStageModuleLocation; +/* returns whether or not we can probe devices automatically or have to + * ask for them manually. */ +int canProbeDevices(void) { +#if defined(__s390__) || defined(__s390x__) + return 1; +#endif + + if ((access("/proc/bus/pci/devices", R_OK) && + access("/proc/openprom", R_OK) && + access("/proc/iSeries", R_OK))) + return 0; + + return 1; +} + static int detectHardware(moduleInfoSet modInfo, char *** modules, int flags) { struct device ** devices, ** device; @@ -166,7 +182,7 @@ int scsiTapeInitialize(moduleList modLoaded, moduleDeps modDeps, kudzu can autodetect and setup printers in post install*/ void initializeParallelPort(moduleList modLoaded, moduleDeps modDeps, moduleInfoSet modInfo, int flags) { - /* JKFIXME: this can be used on other arches too... */ + /* JKFIXME: this could be useful on other arches too... */ #if !defined (__i386__) return; #endif @@ -184,6 +200,7 @@ void initializeParallelPort(moduleList modLoaded, moduleDeps modDeps, void updateKnownDevices(struct knownDevices * kd) { kdFindIdeList(kd, 0); kdFindScsiList(kd, 0); + kdFindDasdList(kd, 0); kdFindNetList(kd, 0); } @@ -199,8 +216,7 @@ int busProbe(moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps, if (FL_NOPROBE(flags)) return 0; - if (!access("/proc/bus/pci/devices", R_OK) || - !access("/proc/openprom", R_OK)) { + if (canProbeDevices()) { /* autodetect whatever we can */ if (detectHardware(modInfo, &modList, flags)) { logMessage("failed to scan pci bus!"); @@ -240,3 +256,74 @@ void ideSetup(moduleList modLoaded, moduleDeps modDeps, struct knownDevices * kd) { mlLoadModuleSet("ide-cd", modLoaded, modDeps, modInfo, flags); } + + +/* check if the system has been booted with dasd parameters */ +/* These parameters define the order in which the DASDs */ +/* are visible to Linux. Otherwise load dasd modules probeonly, */ +/* then parse proc to find active DASDs */ +/* Reload dasd_mod with correct range of DASD ports */ +void dasdSetup(moduleList modLoaded, moduleDeps modDeps, + moduleInfoSet modInfo, int flags, + struct knownDevices * kd) { +#if !defined(__s390__) && !defined(__s390x__) + return; +#else + char **dasd_parms; + char *line, *ports = NULL; + char *parms = NULL, *parms_end; + FILE *fd; + + dasd_parms = malloc(sizeof(*dasd_parms) * 2); + dasd_parms[0] = NULL; + dasd_parms[1] = NULL; + + fd = fopen ("/proc/cmdline", "r"); + if(fd) { + line = (char *)malloc(sizeof(char) * 200); + while (fgets (line, 199, fd) != NULL) { + if((parms = strstr(line, " dasd=")) || + (parms = strstr(line, " DASD="))) { + parms++; + strncpy(parms, "dasd", 4); + parms_end = parms; + while(*parms_end && !(isspace(*parms_end))) parms_end++; + *parms_end = '\0'; + break; + } + } + fclose(fd); + free(line); + } + if(!parms || (strlen(parms) == 5)) { + parms = NULL; + } else { + dasd_parms[0] = strdup(parms); + mlLoadModule("dasd_mod", modLoaded, modDeps, modInfo, + dasd_parms, flags); + + mlLoadModuleSet("dasd_diag_mod:dasd_fba_mod:dasd_eckd_mod", + modLoaded, modDeps, modInfo, flags); + return; + } + if(!parms) { + mlLoadModuleSet("dasd_mod:dasd_diag_mod:dasd_fba_mod:dasd_eckd_mod", + modLoaded, modDeps, modInfo, flags); + if((ports = getDasdPorts())) { + parms = (char *)malloc(strlen("dasd=") + strlen(ports) + 1); + strcpy(parms,"dasd="); + strcat(parms, ports); + dasd_parms[0] = parms; + simpleRemoveLoadedModule("dasd_eckd_mod", modLoaded, flags); + simpleRemoveLoadedModule("dasd_fba_mod", modLoaded, flags); + simpleRemoveLoadedModule("dasd_diag_mod", modLoaded, flags); + simpleRemoveLoadedModule("dasd_mod", modLoaded, flags); + reloadUnloadedModule("dasd_mod", modLoaded, dasd_parms, flags); + reloadUnloadedModule("dasd_eckd_mod", modLoaded, NULL, flags); + free(dasd_parms); + free(ports); + } + } +#endif +} + diff --git a/loader2/hardware.h b/loader2/hardware.h index 54dccff3b..4d7ec319e 100644 --- a/loader2/hardware.h +++ b/loader2/hardware.h @@ -4,6 +4,8 @@ #include "modules.h" #include "../isys/probe.h" +int canProbeDevices(void); + int agpgartInitialize(moduleList modLoaded, moduleDeps modDeps, moduleInfoSet modInfo, int flags); int scsiTapeInitialize(moduleList modLoaded, moduleDeps modDeps, @@ -21,5 +23,8 @@ void scsiSetup(moduleList modLoaded, moduleDeps modDeps, void ideSetup(moduleList modLoaded, moduleDeps modDeps, moduleInfoSet modInfo, int flags, struct knownDevices * kd); +void dasdSetup(moduleList modLoaded, moduleDeps modDeps, + moduleInfoSet modInfo, int flags, + struct knownDevices * kd); #endif diff --git a/loader2/init.c b/loader2/init.c index aa6f522b0..9a33cd326 100644 --- a/loader2/init.c +++ b/loader2/init.c @@ -744,6 +744,9 @@ int main(int argc, char **argv) { dup2(fd, 1); dup2(fd, 2); close(fd); +#else + dup2(0, 1); + dup2(0, 2); #endif setsid(); diff --git a/loader2/linuxrc.s390 b/loader2/linuxrc.s390 new file mode 100644 index 000000000..99ce5fd26 --- /dev/null +++ b/loader2/linuxrc.s390 @@ -0,0 +1,424 @@ +#! /bin/sh +# +# Copyright (C) 2000,2001,2002 by +# Bernhard Rosenkraenzer <bero@redhat.com> +# Oliver Paukstadt <opaukstadt@millenux.com> +# Karsten Hopp <karsten@redhat.de> +# Florian La Roche <laroche@redhat.com> +# Nils Philippsen <nils@redhat.de> +# Helge Deller <hdeller@redhat.de> +# David Sainty <dsainty@redhat.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +VERSION=1.01 + +export TEXTDOMAIN=s390installer +export TEXTDOMAINDIR=/usr/lib/locale + +debugshell() +{ + echo $"You have defined DEBUG, so here is a shell. You can use 'exit'" + echo $"to go on with the normal installation process." + /bin/sh +} + +startinetd() +{ + echo + echo $"Starting telnetd and sshd to allow login over the network." + echo $"Welcome to the Red Hat Linux install environment $VERSION for $S390ARCH" > /etc/issue.net + echo $"Welcome to the Red Hat Linux install environment $VERSION for $S390ARCH" > /etc/motd + echo >> /etc/motd + echo $"Now run 'loader' to install Red Hat Linux." >> /etc/motd + echo >> /etc/motd + + /sbin/xinetd -stayalive -reuse -pidfile /tmp/xinetd.pid + /sbin/sshd + while : ; do + echo + echo $"Please connect now to $IPADDR and start 'loader' from this shell." + ls -l /bin/sh | grep -q bash && /bin/sh --login || /bin/sh -l + done +} + +S390ARCH=`uname -m` +if [ "$S390ARCH" = "s390" ]; then + export S390ARCH="S/390" +else + export S390ARCH="zSeries" +fi + +echo $"Starting the $S390ARCH initrd to configure networking. Version is $VERSION" + + +# set up env vars as we do in init.c +if [ `uname -m` = "s390x" ]; then + LD_LIBRARY_PATH=/lib64:/usr/lib64:/usr/X11R6/lib64:/usr/kerberos/lib64:/lib:/usr/lib:/usr/X11R6/lib:/usr/kerberos/lib +else + LD_LIBRARY_PATH=/lib:/usr/lib:/usr/X11R6/lib:/usr/kerberos/lib +fi +export LD_LIBRARY_PATH + +PATH="PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin:/mnt/sysimage/usr/X11R6/bin" +export PATH +HOME=/ +export HOME +PYTHONPATH=/tmp/updates +export PYTHONPATH + +# limit output on x3270 console +mount -t proc none /proc +mount -t devpts /dev/pts /dev/pts +echo "1 4 1 1" > /proc/sys/kernel/printk + +mkdir /OCO +mount -t ext2 /dev/ram /OCO >/dev/null 2>&1 +# if there is no second initrd, remove mountpoint because +# anaconda checks for its existance: +if [ "$?" != "0" ]; then + rm -rf /OCO 2>/dev/null +fi + +ifconfig lo 127.0.0.1 netmask 255.0.0.0 +route add -host 127.0.0.1 dev lo 2>/dev/null + +[ -n "$DEBUG" ] && debugshell + +LO="" + +[ -L /sbin/insmod ] && LO=".o" + +# read in configuration as set by the parm file +if [ -n "$HOST" ]; then + set -- `echo $HOST |sed 's/:/ /g'` + HOSTNAME=$1 + DEVICE=$2 + NETTYPE=`echo $DEVICE |sed -e 's/[0-9].*//'` + IPADDR=$3 + if [ ":$NETTYPE" = ":iucv" ]; then + IUCV="iucv=$4" + GATEWAY=$5 + MTU=$6 + elif [ ":$NETTYPE" = ":ctc" -o ":$NETTYPE" = ":escon" ]; then + GATEWAY=$4 + MTU=$5 + else + echo $4 | grep -q "\." && MTU=$4 || echo "Invalid MTU $4, skipping" + fi +fi +if [ -n "$MTU" ]; then + MMTU="mtu $MTU" +else + if [ "$NETTYPE" = "ctc" ]; then + MMTU="mtu 4096" + MTU="4096" + IMTU="1" + fi +fi +if [ -n "$NETWORK" ]; then + set -- `echo $NETWORK | sed 's/:/ /g'` + NETWORKIP=$1 + NETMASK=$2 + BROADCAST=$3 + if [ ":$NETTYPE" != ":ctc" -a ":$NETTYPE" != ":iucv" -a ":$NETTYPE" != ":escon" ]; then + GATEWAY=$4 + fi +fi + + +# Parse configuration +# Check for missing parameters, prompt for them if necessary +while [ -z "$HOSTNAME" ]; do + echo $"Please enter the FQDN of your new Linux guest (e.g. s390.redhat.com):" + read HOSTNAME +done +while [ -z "$NETTYPE" ]; do + echo $"Please enter which kind of network device do you intend to use" + echo " (e.g. ctc, escon, iucv, eth, hsi, tr):" + read NETTYPE +done +DEVICE=${NETTYPE}0 +if [ ":$NETTYPE" != ":iucv" ]; then # iucv is the only interface without chandev config + while [ -z "$CHANDEV" ]; do + echo $"Please enter parameters you need to pass to the channel device layer." + echo $"This includes the I/O ports of your ctc, escon, qeth, hsi and lcs devices." + echo $"Additional parameters for QETH devices such as the portname" + echo $"should be entered at the next prompt, not here !" + echo $"(e.g. \"ctc0,0x600,0x601\" will activate the ctc0 interface at I/O" + echo $"ports 0x600,0x601):" + read CHANDEV + done + echo "$CHANDEV" |grep -q "qeth" + if [ "$?" = "0" ]; then + if [ -z "$QETHPARM" ]; then + echo $"Each OSA-Express feature in QDIO mode must be associated with a port name" + echo $"Please enter additional parameters for your QETH device" + echo $"(e.g. \"add_parms,0x10,{lo_devno,hi_devno},portname:port_name\")" + echo $"Press enter if you don't want to enter additional parameters" + read QETHPARM + if [ -z "$QETHPARM" ]; then + echo $"You have been warned, but this will not work without an associated portname" + fi + fi + fi + echo "$CHANDEV" |grep -q "hsi" + if [ "$?" = "0" ]; then + if [ -z "$QETHPARM" ]; then + echo $"Please enter additional parameters for your HSI device" + echo $"(e.g. \"add_parms,0x10,{lo_devno,hi_devno},portname:port_name\")" + echo $"Press enter if you don't want to enter additional parameters" + read QETHPARM + fi + fi + [ -n "$CHANDEV" ] && echo "$CHANDEV" >/proc/chandev + [ -n "$QETHPARM" ] && echo "$QETHPARM" >/proc/chandev + [ -n "$CHANDEV" ] && echo "reprobe" >/proc/chandev +fi +if [ ":$NETTYPE" = ":eth" ] || [ ":$NETTYPE" = ":tr" ] || [ ":$NETTYPE" = ":hsi" ]; then + while [ -z "$IPADDR" ]; do + echo $"Please enter the IP address of your new Linux guest:" + read IPADDR + done + while [ -z "$NETWORK" ]; do + echo $"Enter the network address of the new Linux guest:" + read NETWORK + done + while [ -z "$NETMASK" ]; do + echo $"Enter the netmask for the new Linux guest (e.g. 255.255.255.0):" + read NETMASK + done + while [ -z "$BROADCAST" ]; do + echo $"Enter the broadcast address for the new Linux guest:" + read BROADCAST + done +fi + +if [ ":$NETTYPE" = ":eth" ] || [ ":$NETTYPE" = ":tr" ] || [ ":$NETTYPE" = ":hsi" ]; then + while [ -z "$GATEWAY" ]; do + echo $"Please enter your default gateway:" + read GATEWAY + done + if echo "$CHANDEV" |grep -q "lcs"; then + LCS="on" + fi + # qeth and nettype!= eth is hipersockets ! + if echo "$CHANDEV" |grep -q "qeth"; then + if echo "$NETTYPE" |grep -q "eth"; then + QETH="on" + elif echo "$NETTYPE" |grep -q "hsi"; then + HSI="on" + elif echo "$NETTYPE" |grep -q "tr"; then + TR="on" + fi + fi +else # ctc0, escon0, iucv0 + while [ -z "$GATEWAY" ]; do + echo $"Enter the IP of your ctc/escon/iucv point-to-point partner:" + read GATEWAY + done + if [ "$NETTYPE" = "ctc" ]; then + MMTU="mtu 4096" + MTU="4096" + IMTU="1" + else + echo $"Enter the maximal transfer unit (MTU) for this connection or leave empty:" + read MTU + if [ -n "$MTU" ]; then + MMTU="mtu 4096" + fi + fi + + if [ ":$NETTYPE" = ":iucv" ]; then + while [ -z "$IUCV" ]; do + echo $"Enter iucv kernel module options (usually iucv=HOST," + echo $"where HOST is TCPIP for VM, \$TCPIP for VIF):" + read IUCV + done + fi +fi + +# configure network-interface +KERNELVERSION=`cat /proc/version | awk '{ print $3 }'` +if [ ":$NETTYPE" = ":ctc" -o ":$NETTYPE" = ":escon" ]; then + insmod ctc$LO $CTC + ifconfig $DEVICE $IPADDR $MMTU pointopoint $GATEWAY + route add -host $IPADDR dev $DEVICE 2>/dev/null +elif [ ":$NETTYPE" = ":iucv" ]; then + insmod netiucv$LO $IUCV + ifconfig $DEVICE $IPADDR $MMTU pointopoint $GATEWAY + route add -host $IPADDR dev $DEVICE 2>/dev/null +else # lcs, tr, qeth, hsi or older kernel without opensource-lcs + if [ "$DEVICE" = "eth0" -a "$HSI" = "on" ]; then + DEVICE="hsi0" + fi + insmod ipv6$LO + if [ -n "$LCS" ]; then + insmod -f lcs$LO + if [ "$?" = "1" ]; then + echo $"warning: no lcs module found in the first initrd, " + echo $" looking for second initrd" + else + ifconfig $DEVICE $IPADDR $MMTU netmask $NETMASK broadcast $BROADCAST + route add -net $NETWORK netmask $NETMASK dev $DEVICE 2>/dev/null + fi + fi + if [ -d "/OCO" ]; then + if [ -n "$LCS" ]; then + if [ -f /OCO/$KERNELVERSION/kernel/drivers/s390/net/lcs.o ]; then + insmod -f /OCO/$KERNELVERSION/kernel/drivers/s390/net/lcs$LO + else + echo $"error: no lcs module found" + fi + else # qeth or hsi + if [ -f /OCO/$KERNELVERSION/kernel/drivers/s390/qdio.o -a -f /OCO/$KERNELVERSION/kernel/drivers/s390/net/qeth.o ]; then + insmod -f /OCO/$KERNELVERSION/kernel/drivers/s390/qdio$LO + insmod -f /OCO/$KERNELVERSION/kernel/drivers/s390/net/qeth$LO + else + echo $"error: The qdio and the qeth modules are needed for this" + echo $"They cannot be found in /OCO/$KERNELVERSION/kernel/drivers/s390/, skipping..." + fi + fi + ifconfig $DEVICE $IPADDR $MMTU netmask $NETMASK broadcast $BROADCAST + route add -net $NETWORK netmask $NETMASK dev $DEVICE 2>/dev/null + fi +fi +route add default gw $GATEWAY dev $DEVICE 2>/dev/null + +if [ -z "$DNS" ]; then + echo $"Please enter your DNS server(s), separated by colons (:):" + read DNS +fi +if [ -z "$DNS" ]; then + echo $"You might encounter problems without a nameserver, especially" + echo $"with FTP installs" +fi + +if [ -n "$DNS" -a -z "$SEARCHDNS" ]; then + echo $"Please enter your DNS search domain(s) (if any), separated by colons (:):" + read SEARCHDNS +fi + +[ -n "$HOSTNAME" ] && hostname $HOSTNAME + +# show interfaces and routing table +ifconfig -a +route -n + +[ -n "$DEBUG" ] && debugshell + +echo $"Starting portmap." +portmap + +# convert to space-separated lists +if [ -n "$SEARCHDNS" ]; then + SEARCHDNS=`echo $SEARCHDNS |sed -e 's/:/ /g'` + for i in "$SEARCHDNS"; do echo "search $i"; done >> /etc/resolv.conf +fi +if [ -n "$DNS" ]; then + DNS=`echo $DNS |sed -e 's/:/ /g'` + for i in "$DNS"; do echo "nameserver $i"; done >> /etc/resolv.conf +fi + +grep -q ext3 /proc/filesystems +if [ "$?" != "0" ]; then + insmod jbd$LO + insmod ext3$LO +fi + + +# Don't add MTU to the installed system's config. It was +# set to 4096 for the installer only +if [ "$IMTU" = "1" ]; then + MTU= +fi + +# transfer options into install environment +cat > /tmp/install.cfg << EOF +LANG="$LANG" +S390ARCH="$S390ARCH" +TEXTDOMAIN="$TEXTDOMAIN" +TEXTDOMAINDIR="$TEXTDOMAINDIR" +CHANDEV="$CHANDEV" +QETHPARM="$QETHPARM" +HOSTNAME="$HOSTNAME" +DEVICE="$DEVICE" +NETTYPE="$NETTYPE" +IPADDR="$IPADDR" +GATEWAY="$GATEWAY" +MTU="$MTU" +NETWORK="$NETWORK" +NETMASK="$NETMASK" +BROADCAST="$BROADCAST" +INTERACTIVE="$INTERACTIVE" +DNS="$DNS" +SEARCHDNS="$SEARCHDNS" +FORCEDASDFORMAT="$FORCEDASDFORMAT" +LCS="$LCS" +QETH="$QETH" +HSI="$HSI" +TR="$TR" +IUCV="$IUCV" +CTC="$CTC" +ROOTPW="$ROOTPW" +CROOTPW="$CROOTPW" +ONBOOT="yes" +export LANG CHANDEV QETHPARM S390ARCH TEXTDOMAIN TEXTDOMAINDIR HSI +export HOSTNAME DEVICE NETTYPE IPADDR GATEWAY MTU +export NETWORK NETMASK BROADCAST DNS SEARCHDNS +export LCS QETH IUCV ROOTPW CROOTPW ONBOOT +export TR +EOF +# immediately read it in again to export these into the shell below +. /tmp/install.cfg +cat /tmp/install.cfg >> /etc/profile +cat > /tmp/netinfo << EOF +DEVICE=$DEVICE +ONBOOT=yes +BOOTPROTO=static +IPADDR=$IPADDR +NETMASK=$NETMASK +GATEWAY=$GATEWAY +BROADCAST=$BROADCAST +HOSTNAME=$HOSTNAME +DOMAIN= +MTU=$MTU +EOF + +# so that the vars get propagated into the sshd shells +cat >> /etc/profile <<EOF +LD_LIBRARY_PATH=$LD_LIBRARY_PATH +PATH=$PATH +HOME=$HOME +PYTHONPATH=$PYTHONPATH +export LD_LIBRARY_PATH PATH HOME PYTHONPATH +EOF + +echo $DEVICE | grep ctc && echo "REMIP=$GATEWAY" >> /tmp/netinfo +echo $DEVICE | grep ctc && echo "export REMIP=$GATEWAY" >> /etc/profile + +[ -n "$DEBUG" ] && debugshell + +startinetd + +umount -a +umount /proc + +exit 0 +# ;;; Local Variables: *** +# ;;; mode: sh *** +# ;;; tab-width:3 *** +# ;;; end: *** +# vim:ts=3:sw=3 diff --git a/loader2/loader.c b/loader2/loader.c index a68e7d301..f640560c1 100644 --- a/loader2/loader.c +++ b/loader2/loader.c @@ -839,6 +839,29 @@ static int manualDeviceCheck(moduleInfoSet modInfo, moduleList modLoaded, return 0; } +/* JKFIXME: I don't really like this, but at least it isolates the ifdefs */ +/* Either move dirname to %s_old or unlink depending on arch (unlink on all + * !s390{,x} arches). symlink to /mnt/runtime/dirname. dirname *MUST* start + * with a '/' */ +static void migrate_runtime_directory(char * dirname) { + char * runtimedir; + + runtimedir = sdupprintf("/mnt/runtime%s", dirname); + if (!access(runtimedir, X_OK)) { +#if !defined(__s390__) && !defined(__s390x__) + unlink(dirname); +#else + char * olddir; + + olddir = sdupprintf("%s_old", dirname); + rename(dirname, olddir); + free(olddir); +#endif + symlink(runtimedir, dirname); + } + free(runtimedir); +} + int main(int argc, char ** argv) { int flags = 0; @@ -954,6 +977,7 @@ int main(int argc, char ** argv) { /* now let's do some initial hardware-type setup */ ideSetup(modLoaded, modDeps, modInfo, flags, &kd); scsiSetup(modLoaded, modDeps, modInfo, flags, &kd); + dasdSetup(modLoaded, modDeps, modInfo, flags, &kd); /* Note we *always* do this. If you could avoid this you could get a system w/o USB keyboard support, which would be bad. */ @@ -962,17 +986,13 @@ int main(int argc, char ** argv) { /* now let's initialize any possible firewire. fun */ firewireInitialize(modLoaded, modDeps, modInfo, flags); - kdFindIdeList(&kd, 0); - kdFindScsiList(&kd, 0); - kdFindNetList(&kd, 0); + updateKnownDevices(&kd); /* explicitly read this to let libkudzu know we want to merge * in future tables rather than replace the initial one */ pciReadDrivers("/modules/pcitable"); - if ((access("/proc/bus/pci/devices", R_OK) && - access("/proc/openprom", R_OK) && - access("/proc/iSeries", R_OK)) || FL_MODDISK(flags)) { + if (!canProbeDevices() || FL_MODDISK(flags)) { startNewt(flags); loadDriverDisks(CLASS_UNSPEC, modLoaded, &modDeps, @@ -1011,14 +1031,10 @@ int main(int argc, char ** argv) { url = doLoaderMain("/mnt/source", &loaderData, &kd, modInfo, modLoaded, &modDeps, flags); if (!FL_TESTING(flags)) { - unlink("/usr"); - symlink("/mnt/runtime/usr", "/usr"); - unlink("/lib"); - symlink("/mnt/runtime/lib", "/lib"); - if (!access("/mnt/runtime/lib64", X_OK)) { - unlink("/lib64"); - symlink("/mnt/runtime/lib64", "/lib64"); - } + /* unlink dirs and link to the ones in /mnt/runtime */ + migrate_runtime_directory("/usr"); + migrate_runtime_directory("/lib"); + migrate_runtime_directory("/lib64"); } logMessage("getting ready to spawn shell now"); @@ -1045,10 +1061,8 @@ int main(int argc, char ** argv) { checkForHardDrives(&kd, &flags); - if (((access("/proc/bus/pci/devices", R_OK) && - access("/proc/openprom", R_OK) && - access("/proc/iSeries", R_OK)) || - FL_ISA(flags) || FL_NOPROBE(flags)) && !loaderData.ksFile) { + if ((!canProbeDevices() || FL_ISA(flags) || FL_NOPROBE(flags)) + && !loaderData.ksFile) { startNewt(flags); manualDeviceCheck(modInfo, modLoaded, &modDeps, &kd, flags); } diff --git a/loader2/modules.c b/loader2/modules.c index 2163dd702..0cc7c1b50 100644 --- a/loader2/modules.c +++ b/loader2/modules.c @@ -44,13 +44,6 @@ static struct extractedModule * extractModules (char * const * modNames, struct extractedModule * oldPaths, struct moduleBallLocation * location); - -static int simpleRemoveLoadedModule(const char * modName, moduleList modLoaded, - int flags); -static int reloadUnloadedModule(char * modName, moduleList modLoaded, - int flags); - - /* pass in the type of device (eth or tr) that you're looking for */ static int ethCount(const char * type) { int fd; @@ -517,7 +510,7 @@ static int doLoadModules(const char * origModNames, moduleList modLoaded, } if (reloadUsbStorage) { - reloadUnloadedModule("usb-storage", modLoaded, flags); + reloadUnloadedModule("usb-storage", modLoaded, NULL, flags); /* JKFIXME: here's the rest of the hacks. basically do the reverse * of what we did before. */ @@ -804,7 +797,7 @@ static struct extractedModule * extractModules (char * const * modNames, * but we do update the loadedModuleInfo to reflect the fact that its using * no devices anymore. */ -static int simpleRemoveLoadedModule(const char * modName, moduleList modLoaded, +int simpleRemoveLoadedModule(const char * modName, moduleList modLoaded, int flags) { int status, rc = 0; pid_t child; @@ -851,8 +844,8 @@ static int simpleRemoveLoadedModule(const char * modName, moduleList modLoaded, * if we think it was already loaded. we also update firstDevNum and * lastDevNum to be current */ -static int reloadUnloadedModule(char * modName, moduleList modLoaded, - int flags) { +int reloadUnloadedModule(char * modName, moduleList modLoaded, + char ** args, int flags) { char fileName[200]; int rc, status; pid_t child; @@ -890,7 +883,7 @@ static int reloadUnloadedModule(char * modName, moduleList modLoaded, dup2(fd, 2); close(fd); - rc = insmod(fileName, NULL, NULL); + rc = insmod(fileName, NULL, args); _exit(rc); } @@ -913,7 +906,7 @@ void loadKickstartModule(struct loaderData_s * loaderData, int argc, char * opts = NULL; char * module = NULL; char * type = NULL; - char ** args; + char ** args = NULL; poptContext optCon; int rc; int flags = *flagsPtr; diff --git a/loader2/modules.h b/loader2/modules.h index 3c4c6872e..7f43457c8 100644 --- a/loader2/modules.h +++ b/loader2/modules.h @@ -44,5 +44,9 @@ int mlLoadModuleSetLocation(const char * modNames, int mlModuleInList(const char * modName, moduleList list); void writeScsiDisks(moduleList list); +int simpleRemoveLoadedModule(const char * modName, moduleList modLoaded, + int flags); +int reloadUnloadedModule(char * modName, moduleList modLoaded, + char **, int flags); #endif diff --git a/loader2/net.c b/loader2/net.c index c331fa8c2..432da26d5 100644 --- a/loader2/net.c +++ b/loader2/net.c @@ -237,12 +237,13 @@ void setupNetworkDeviceConfig(struct networkDeviceConfig * cfg, } cfg->isDynamic = 1; + cfg->preset = 1; } else if (inet_aton(loaderData->ip, &addr)) { cfg->dev.ip = addr; cfg->dev.set |= PUMP_INTFINFO_HAS_IP; cfg->isDynamic = 0; + cfg->preset = 1; } - cfg->preset = 1; } if (loaderData->netmask && (inet_aton(loaderData->netmask, &addr))) { @@ -292,6 +293,8 @@ int readNetConfig(char * device, struct networkDeviceConfig * cfg, int flags) { char dhcpChoice; char * chptr; + memset(&c, 0, sizeof(c)); + /* JKFIXME: we really need a way to override this and be able to change * our network config */ if (!FL_TESTING(flags) && cfg->preset) { @@ -445,8 +448,12 @@ int readNetConfig(char * device, struct networkDeviceConfig * cfg, int flags) { #else /* s390 now */ char * env; - /* quick and dirty hack by opaukstadt@millenux.com for s390 */ - /* ctc stores remoteip in broadcast-field until pump.h is changed */ + + /* JKFIXME: this is something of a hack... will go away better once + * we start just reading this into the ip info in loaderdata */ + winStatus(50, 3, _("Setting up networking"), + _("Setting up networking for %s..."), device, 0); + memset(&newCfg, 0, sizeof(newCfg)); strcpy(newCfg.dev.device, device); newCfg.isDynamic = 0; @@ -477,18 +484,23 @@ int readNetConfig(char * device, struct networkDeviceConfig * cfg, int flags) { if(inet_aton((t? t : s), &newCfg.dev.dnsServers[0])) newCfg.dev.set |= PUMP_NETINFO_HAS_DNS; } - if (!strncmp(newCfg.dev.device, "ctc", 3)) { - env = getenv("REMIP"); - if (env && *env) { - if(inet_aton(env, &newCfg.dev.gateway)) - newCfg.dev.set |= PUMP_NETINFO_HAS_GATEWAY; - } - } env = getenv("BROADCAST"); if (env && *env) { if(inet_aton(env, &newCfg.dev.broadcast)) newCfg.dev.set |= PUMP_INTFINFO_HAS_BROADCAST; } + env = getenv("MTU"); + if (env && *env) { + newCfg.dev.mtu = atoi(env); + newCfg.dev.set |= PUMP_INTFINFO_HAS_MTU; + } + env = getenv("REMIP"); + if (env && *env) { + if (inet_aton(env, &newCfg.dev.ptpaddr)) + newCfg.dev.set |= PUMP_INTFINFO_HAS_PTPADDR; + } + + sleep(1); #endif /* s390 */ /* preserve extra dns servers for the sake of being nice */ @@ -504,23 +516,22 @@ int readNetConfig(char * device, struct networkDeviceConfig * cfg, int flags) { fillInIpInfo(cfg); -#if !defined(__s390__) && !defined(__s390x__) if (!(cfg->dev.set & PUMP_NETINFO_HAS_GATEWAY)) { - if (*c.gw && inet_aton(c.gw, &addr)) { + if (c.gw && *c.gw && inet_aton(c.gw, &addr)) { cfg->dev.gateway = addr; cfg->dev.set |= PUMP_NETINFO_HAS_GATEWAY; } } if (!(cfg->dev.numDns)) { - if (*c.ns && inet_aton(c.ns, &addr)) { + if (c.ns && *c.ns && inet_aton(c.ns, &addr)) { cfg->dev.dnsServers[0] = addr; cfg->dev.numDns = 1; } } newtPopWindow(); -#endif + if (!FL_TESTING(flags)) { configureNetwork(cfg); findHostAndDomain(cfg, flags); @@ -531,7 +542,6 @@ int readNetConfig(char * device, struct networkDeviceConfig * cfg, int flags) { } int configureNetwork(struct networkDeviceConfig * dev) { -#if !defined(__s390__) && !defined(__s390x__) char *rc; rc = pumpSetupInterface(&dev->dev); @@ -541,7 +551,6 @@ int configureNetwork(struct networkDeviceConfig * dev) { if (dev->dev.set & PUMP_NETINFO_HAS_GATEWAY) pumpSetupDefaultGateway(&dev->dev.gateway); -#endif return 0; } @@ -566,12 +575,8 @@ int writeNetInfo(const char * fn, struct networkDeviceConfig * dev, fprintf(f, "BOOTPROTO=static\n"); fprintf(f, "IPADDR=%s\n", inet_ntoa(dev->dev.ip)); fprintf(f, "NETMASK=%s\n", inet_ntoa(dev->dev.netmask)); - if (dev->dev.set & PUMP_NETINFO_HAS_GATEWAY) { - fprintf(f, "GATEWAY=%s\n", inet_ntoa(dev->dev.gateway)); - if (!strncmp(dev->dev.device, "ctc", 3) || \ - !strncmp(dev->dev.device, "iucv", 4)) - fprintf(f, "REMIP=%s\n", inet_ntoa(dev->dev.gateway)); - } + if (dev->dev.set & PUMP_NETINFO_HAS_GATEWAY) + fprintf(f, "GATEWAY=%s\n", inet_ntoa(dev->dev.gateway)); if (dev->dev.set & PUMP_INTFINFO_HAS_BROADCAST) fprintf(f, "BROADCAST=%s\n", inet_ntoa(dev->dev.broadcast)); } @@ -580,6 +585,10 @@ int writeNetInfo(const char * fn, struct networkDeviceConfig * dev, fprintf(f, "HOSTNAME=%s\n", dev->dev.hostname); if (dev->dev.set & PUMP_NETINFO_HAS_DOMAIN) fprintf(f, "DOMAIN=%s\n", dev->dev.domain); + if (dev->dev.set & PUMP_INTFINFO_HAS_MTU) + fprintf(f, "MTU=%d\n", dev->dev.mtu); + if (dev->dev.set & PUMP_INTFINFO_HAS_PTPADDR) + fprintf(f, "REMIP=%s\n", inet_ntoa(dev->dev.ptpaddr)); fclose(f); diff --git a/network.py b/network.py index 53e3e83ca..b59c947f0 100644 --- a/network.py +++ b/network.py @@ -20,6 +20,7 @@ import string import isys import socket import os +import re from rhpl.log import log from rhpl.translate import _, N_ @@ -51,6 +52,44 @@ def networkDeviceCheck(network, dispatch): if not devs: dispatch.skipStep("network") + +# return if the device is of a type that requires a ptpaddr to be specified +def isPtpDev(devname): + if (devname.startswith("ctc") or devname.startswith("escon") or + devname.startswith("iucv")): + return 1 + return 0 + +# determine whether any active at boot devices are using dhcp +def anyUsingDHCP(devices): + for dev in devices.keys(): + bootproto = devices[dev].get("bootproto") + if bootproto and bootproto == "dhcp": + onboot = devices[dev].get("onboot") + if onboot and onboot != "no": + return 1 + return 0 + +# sanity check an IP string. if valid, returns octets, if invalid, return None +def sanityCheckIPString(ip_string): + ip_re = re.compile('^([0-2]?[0-9]?[0-9])\\.([0-2]?[0-9]?[0-9])\\.([0-2]?[0-9]?[0-9])\\.([0-2]?[0-9]?[0-9])$') + + #Sanity check the string + m = ip_re.match (ip_string) + try: + if not m: + return None + octets = m.groups() + if len(octets) != 4: + return None + for octet in octets: + if (int(octet) < 0) or (int(octet) > 255): + return None + except TypeError: + return None + + return octets + class NetworkDevice(SimpleConfigFile): def __str__(self): s = "" @@ -113,7 +152,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", "MTU"): + for key in ("IPADDR", "NETMASK", "BOOTPROTO", "ONBOOT", "MTU", + "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 69ebae4e7..480ea30c7 100644 --- a/packages.py +++ b/packages.py @@ -531,8 +531,6 @@ def doPreInstall(method, id, intf, instPath, dir): if arch == "s390": if (string.find(os.uname()[2], "tape") > -1): select(id.hdList, 'kernel-tape') - else: - select(id.hdList, 'kernel') elif isys.smpAvailable() or isys.htavailable(): select(id.hdList, 'kernel-smp') diff --git a/partIntfHelpers.py b/partIntfHelpers.py index d1fdd32ff..96f67d252 100644 --- a/partIntfHelpers.py +++ b/partIntfHelpers.py @@ -143,12 +143,6 @@ def doDeletePartitionByRequest(intf, requestlist, partition, custom_icon="error") return 0 - if iutil.getArch() == "s390" and type(partition) != type("RAID"): - intf.messageWindow(_("Error"), - _("DASD partitions can only be deleted " - "with fdasd")) - return - if type(partition) == type("RAID"): device = partition elif partition.type & parted.PARTITION_FREESPACE: @@ -328,11 +322,6 @@ def doEditPartitionByRequest(intf, requestlist, part): return ("LVMLV", request) else: return (None, None) - elif iutil.getArch() == "s390": - intf.messageWindow(_("Error"), - _("You must go back and use fdasd to " - "inititalize this partition")) - return (None, None) elif part.type & parted.PARTITION_FREESPACE: request = partRequests.PartitionSpec(fsset.fileSystemTypeGetDefault(), start = partedUtils.start_sector_to_cyl(part.geom.dev, diff --git a/partedUtils.py b/partedUtils.py index 4885969a0..161eebb57 100644 --- a/partedUtils.py +++ b/partedUtils.py @@ -611,7 +611,7 @@ class DiskSet: del self.disks[disk] def dasdFmt (self, intf = None, drive = None): - "Format dasd devices (s390).""" + """Format dasd devices (s390).""" w = intf.progressWindow (_("Initializing"), _("Please wait while formatting drive %s...\n" ) % (drive,), 100) diff --git a/partitioning.py b/partitioning.py index 0d78ceb15..bb3b6dcf2 100644 --- a/partitioning.py +++ b/partitioning.py @@ -70,10 +70,7 @@ def partitionMethodSetup(partitions, dispatch): if dispatch.stepInSkipList("partition") and not partitions.useAutopartitioning: dispatch.skipStep("partition", skip = 0) - if iutil.getArch() == "s390": - dispatch.skipStep("fdasd", skip = not partitions.useFdisk) - else: - dispatch.skipStep("fdisk", skip = not partitions.useFdisk) + dispatch.skipStep("fdisk", skip = not partitions.useFdisk) partitions.setProtected(dispatch) diff --git a/scripts/mk-images b/scripts/mk-images index 9ab530c37..6b74c1849 100755 --- a/scripts/mk-images +++ b/scripts/mk-images @@ -95,11 +95,14 @@ TOPDIR=$(cd $TOPDIR; pwd) if [ -n "$dieLater" ]; then exit 1; fi - # go ahead and create the keymaps so we only have to do it once - $GETKEYMAPS $BUILDARCH $KEYMAPS $IMGPATH - if [ $? != 0 ]; then - echo "Unable to create keymaps and thus can't create initrd." - exit 1 + if [ "$BUILDARCH" != "s390" -a "$BUILDARCH" != "s390x" ]; then + # go ahead and create the keymaps so we only have to do it once + echo "Running: GETKEYMAPS $BUILDARCH $KEYMAPS $IMGPATH" + $GETKEYMAPS $BUILDARCH $KEYMAPS $IMGPATH + if [ $? != 0 ]; then + echo "Unable to create keymaps and thus can't create initrd." + exit 1 + fi fi findPackage() { @@ -314,7 +317,8 @@ makemainmodules() { if [ "$BUILDARCH" = "s390" -o "$BUILDARCH" = "s390x" ]; then mkdir -p $KERNELROOT/lib/modules/misc - cp -f $KERNELROOT/lib/modules/*/kernel/drivers/s390/*/* $KERNELROOT/lib/modules/misc + find $KERNELROOT/lib/modules/*/kernel/drivers/s390/ -name "*.o" \ + -exec cp -f {} $KERNELROOT/lib/modules/misc \; fi makemoduleball $extraargs $FULLMODPATH "$modlist" cp -ar $FULLMODPATH $FINALFULLMODPATH @@ -426,8 +430,10 @@ EOF install -s -m 755 $LOADERBINDIR/$LOADERBIN $MBD_DIR/sbin/loader install -s -m 755 $LOADERBINDIR/$INITBIN $MBD_DIR/sbin - install -m 644 $KEYMAPS $MBD_DIR/etc/keymaps.gz - install -m 644 $SCREENFONT $MBD_DIR/etc/screenfont.gz + if [ "$BUILDARCH" != "s390" -a "$BUILDARCH" != "s390x" ]; then + install -m 644 $KEYMAPS $MBD_DIR/etc/keymaps.gz + install -m 644 $SCREENFONT $MBD_DIR/etc/screenfont.gz + fi install -m 644 $MYLANGTABLE $MBD_DIR/etc/lang-table install -m 644 $LOADERBINDIR/$MYLOADERTR $MBD_DIR/etc/loader.tr @@ -507,7 +513,7 @@ EOF ln -s fb0 $MBD_DIR/dev/fb dd if=/dev/zero of=$MBD_DIR/etc/ramfs.img.big bs=1k count=16000 - mke2fs -Fq $MBD_DIR/etc/ramfs.img.big + mke2fs -F -q $MBD_DIR/etc/ramfs.img.big gzip -9 < $MBD_DIR/etc/ramfs.img.big > $MBD_DIR/etc/ramfs.img rm -f $MBD_DIR/etc/ramfs.img.big @@ -518,7 +524,7 @@ EOF rm -f $MBD_FSIMAGE dd if=/dev/zero of=$MBD_FSIMAGE bs=1k count=$INITRDSIZE 2> /dev/null - echo y | /sbin/mke2fs -i 1024 -q $MBD_FSIMAGE $INITRDSIZE > /dev/null 2>/dev/null + /sbin/mke2fs -F -i 1024 -q $MBD_FSIMAGE $INITRDSIZE > /dev/null 2>/dev/null rm -rf $MBD_MNTPOINT mkdir $MBD_MNTPOINT @@ -633,7 +639,7 @@ makeImage () { mkdir -p $MI_MNTPOINT dd if=/dev/zero of=$MI_TMPIMAGE bs=1k count=$MI_SIZE 2>/dev/null - echo y | /sbin/mke2fs -i 4096 $MI_TMPIMAGE > /dev/null 2>/dev/null + /sbin/mke2fs -F -i 4096 $MI_TMPIMAGE > /dev/null 2>/dev/null mount -o loop $MI_TMPIMAGE $MI_MNTPOINT (cd $MI_FROM; find . | cpio --quiet -p $MI_MNTPOINT) @@ -662,7 +668,8 @@ makeinstimage () { (cd $INSTIMGTEMPLATE; find . | cpio --quiet -p $tmpdir) if [ "$BUILDARCH" = "s390" -o "$BUILDARCH" = "s390x" ]; then mkdir -p $KERNELROOT/lib/modules/misc - cp -f $KERNELROOT/lib/modules/*/kernel/drivers/s390/*/* $KERNELROOT/lib/modules/misc + find $KERNELROOT/lib/modules/*/kernel/drivers/s390/ -name "*.o" \ + -exec cp -f {} $KERNELROOT/lib/modules/misc \; fi makemoduleball $tmpdir/modules "$modlist" makeproductfile $tmpdir @@ -702,7 +709,7 @@ makemainimage () { SIZE=$(expr $SIZE - $ERROR) fi dd if=/dev/zero bs=1k count=${SIZE} of=$mmi_tmpimage - echo y | mke2fs $mmi_tmpimage > /dev/null + mke2fs -F $mmi_tmpimage > /dev/null mount -o loop $mmi_tmpimage $mmi_mntpoint (cd $IMGPATH; find . | fgrep -v "./usr/lib/anaconda-runtime" | @@ -754,7 +761,7 @@ makedriverdisk () { fi dd if=/dev/zero of=/tmp/$diskname.img bs=1k count=$size 2> /dev/null - echo y | /sbin/mke2fs -i 4096 /tmp/$diskname.img > /dev/null 2>/dev/null + /sbin/mke2fs -F -i 4096 /tmp/$diskname.img > /dev/null 2>/dev/null mkdir -p /tmp/mkdd.$$ mount -t ext2 -o loop /tmp/$diskname.img /tmp/mkdd.$$ rmdir /tmp/mkdd.$$/lost+found @@ -801,7 +808,7 @@ for kernelvers in $vertag; do if [ ! -f "$kpackage" ]; then echo 'kernel-$kernelvers does not exist -- using kernel package' kpackage=$($LATEST $KERNELPATH kernel) - vertag="" + kernelvers="" fi ppackage=$($LATEST $KERNELPATH hwdata) @@ -809,7 +816,7 @@ for kernelvers in $vertag; do ppackage="" fi - version=$(rpm --qf '%{VERSION}-%{RELEASE}' -qp $kpackage)${vertag} + version=$(rpm --qf '%{VERSION}-%{RELEASE}' -qp $kpackage)${kernelvers} echo "unpacking $kpackage" rpm2cpio $kpackage | (cd $KERNELROOT; cpio --quiet -iumd) @@ -839,7 +846,12 @@ for kernelvers in $vertag; do rundepmod "$allmods" $MODDEPS rm -f $MODDEPS.foo -. $TOPDIR/mk-images.${BUILDARCH} + # this is a bad hack, but better than copying for now + if [ ${BUILDARCH} = s390x ]; then + . $TOPDIR/mk-images.s390 + else + . $TOPDIR/mk-images.${BUILDARCH} + fi rm -rf $KERNELROOT done diff --git a/scripts/mk-images.s390 b/scripts/mk-images.s390 index 4c180fef1..6cd826a7a 100644 --- a/scripts/mk-images.s390 +++ b/scripts/mk-images.s390 @@ -34,6 +34,367 @@ prepareBootImage() { fi } +makeS390initrd() { + EXTRAINITRDPATH="" + PCMCIA="" + INITRDSIZE="" + KEEP="" + PADSIZE="" + LOADERBIN="" + INITRDMODULES="" + MODULEBALLNAME="modules.cgz" + MYLANGTABLE=$LANGTABLE + MYLOADERTR=loader.tr + while [ x$(echo $1 | cut -c1-2) = x"--" ]; do + if [ $1 = "--initrdto" ]; then + EXTRAINITRDPATH=$2 + shift; shift + continue + elif [ $1 = "--pcmcia" ]; then + PCMCIA=yes + shift + continue + elif [ $1 = "--keep" ]; then + KEEP=yes + shift + continue + elif [ $1 = "--initrdsize" ]; then + INITRDSIZE=$2 + shift; shift + continue + elif [ $1 = "--padsize" ]; then + PADSIZE=$2 + shift; shift + continue + elif [ $1 = "--loaderbin" ]; then + LOADERBIN=$2 + shift; shift + continue + elif [ $1 = "--modules" ]; then + LOADERMODULES=$2 + shift; shift + continue + elif [ $1 = "--moduleballname" ]; then + MODULEBALLNAME=$2 + shift; shift + continue + fi + echo "Unknown option passed to makeS390initrd" + exit 1 + done + if [ -z "$LOADERBIN" ]; then + echo "no loader binary specified!" >&2 + exit 1 + fi + if [ -z "$LOADERMODULES" ]; then + echo "warning: no loader modules specified!" >&2 + fi + if [ -z "$INITRDSIZE" ]; then + echo "I don't know how big to make the initrd image!" >&2 + exit 1 + fi + + MBD_DIR=/tmp/makebootdisk.dir.$$ + MBD_FSIMAGE=/tmp/makebootdisk.initrdimage.$$ + MBD_MNTPOINT=/tmp/makebootdisk.mount.$$ + MBD_TMPIMAGE=/tmp/makebootdisk.image.$$ + MBD_BOOTTREE=/tmp/makebootdisk.tree.$$ + INITBIN=init + + rm -rf $MBD_DIR MBD_FSIMAGE + mkdir -p $MBD_DIR/modules + mkdir -p $MBD_DIR/sbin + mkdir -p $MBD_DIR/dev/pts + mkdir -p $MBD_DIR/dev/input + mkdir -p $MBD_DIR/etc + mkdir -p $MBD_DIR/proc + mkdir -p $MBD_DIR/tmp + mkdir -p $MBD_DIR/etc/terminfo/{a,d,k,l,s,v,x} + mkdir -p $MBD_DIR/var/state + ln -s /tmp $MBD_DIR/var/state/xkb + + if [ -n "$LOADERMODULES" ]; then + MODSET=`expandModuleSet "$LOADERMODULES"` + makemoduleball --name $MODULEBALLNAME $MBD_DIR/modules "$MODSET" + fi + + cat > $MBD_DIR/etc/passwd << EOF +root::0:0:root:/:/bin/bash +sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin +EOF + echo "sshd:x:74:" >> $MBD_DIR/etc/group + mkdir -p $MBD_DIR/var/empty/sshd $MBD_DIR/etc/pam.d $MBD_DIR/lib/security \ + $MBD_DIR/etc/security $MBD_DIR/$LIBDIR/security + chmod 111 $MBD_DIR/var/empty/sshd + for i in pam_stack.so pam_nologin.so pam_limits.so pam_console.so \ + pam_securetty.so pam_env.so pam_unix.so pam_deny.so pam_cracklib.so \ + pam_limits.so; do + cp -f $IMGPATH/$LIBDIR/security/$i $MBD_DIR/$LIBDIR/security + done + cp -f $IMGPATH/$LIBDIR/libpam_misc.so* $IMGPATH/$LIBDIR/libpam.so* $MBD_DIR/$LIBDIR + for i in sshd login system-auth other; do + cp -f $IMGPATH/etc/pam.d/$i $MBD_DIR/etc/pam.d + done + cp -f $IMGPATH/etc/security/{limits.conf,pam_env.conf} $MBD_DIR/etc/security/ + cp -f $IMGPATH/usr/bin/login $MBD_DIR/sbin/login + cp -f $IMGPATH/usr/sbin/sshd $MBD_DIR/sbin/sshd + + install -s -m 755 $LOADERBINDIR/$LOADERBIN $MBD_DIR/sbin/loader + #install -s -m 755 $LOADERBINDIR/load_anaconda $MBD_DIR/sbin/loader + # install -m 644 $KEYMAPS $MBD_DIR/etc/keymaps.gz + # install -m 644 $FONTS $MBD_DIR/etc/fonts.cgz + install -m 644 $MYLANGTABLE $MBD_DIR/etc/lang-table + + install -m 644 $LOADERBINDIR/$MYLOADERTR $MBD_DIR/etc/loader.tr + for i in a/ansi d/dumb k/kterm l/linux s/screen v/vt100 v/vt102 x/xterm x/xterm-color; do + install -m 644 $IMGPATH/usr/share/terminfo/$i $MBD_DIR/etc/terminfo/$i + done + makeproductfile $MBD_DIR + + if [ -f $LOADERBINDIR/kon.cfg ]; then + mkdir -p $MBD_DIR/etc/terminfo/k + install -m 644 $IMGPATH/usr/share/terminfo/k/kon $MBD_DIR/etc/terminfo/k/kon + install -m 644 $LOADERBINDIR/kon.cfg $MBD_DIR/etc + + install -m 644 $LOADERBINDIR/minikon.fnt $MBD_DIR/etc + ln -s loader $MBD_DIR/sbin/continue + fi + + for n in insmod rmmod modprobe; do + ln -s loader $MBD_DIR/sbin/$n + done + + mkdir -p $MBD_DIR/$LIBDIR $MBD_DIR/usr/kerberos/$LIBDIR $MBD_DIR/mnt1 \ + $MBD_DIR/mnt/runtime $MBD_DIR/etc/ssh $MBD_DIR/mnt/source \ + $MBD_DIR/usr/$LIBDIR/gconv/ $MBD_DIR/lib $MBD_DIR/etc/xinetd.d + for links in X11R6 bin sbin share; do + ln -sf /mnt/runtime/usr/$links $MBD_DIR/usr/$links + done + cp -f $IMGPATH/usr/lib/anaconda-runtime/loader/linuxrc.s390 $MBD_DIR/linuxrc + ln -s ../linuxrc $MBD_DIR/sbin/init + cp -f $IMGPATH/usr/bin/bash $MBD_DIR/sbin/bash + ln -sf bash $MBD_DIR/sbin/sh + cp -f $IMGPATH/usr/bin/gawk $MBD_DIR/sbin/awk + cp -f $IMGPATH/usr/bin/sort_save $MBD_DIR/sbin/sort + cp -f $IMGPATH/usr/sbin/chroot $MBD_DIR/sbin/chroot + cp -f $IMGPATH/usr/sbin/consoletype $MBD_DIR/sbin/consoletype + cp -f $IMGPATH/usr/sbin/mke2fs $MBD_DIR/sbin/mke2fs + cp -f $IMGPATH/usr/bin/busybox $MBD_DIR/sbin/busybox + for i in cp uname tee rm ps mv more mkdir ls ln hostname head \ + gzip grep dd chmod cat; do + ln -sf busybox $MBD_DIR/sbin/$i + done + cp -f $IMGPATH/usr/X11R6/bin/xauth $MBD_DIR/sbin/xauth + cp -f $IMGPATH/usr/bin/sed_save $MBD_DIR/sbin/sed + cp -f $IMGPATH/usr/bin/mount $MBD_DIR/sbin/mount + cp -f $IMGPATH/usr/bin/umount $MBD_DIR/sbin/umount + ln -s gzip $MBD_DIR/sbin/zcat + cp -f $IMGPATH/usr/bin/ldd $MBD_DIR/sbin/ldd + cp -f $IMGPATH/usr/bin/strace $MBD_DIR/sbin/strace + cp -f $IMGPATH/usr/bin/mknod $MBD_DIR/sbin/mknod + cp -df $IMGPATH/$LIBDIR/libtermcap* $MBD_DIR/$LIBDIR/ + cp -df $IMGPATH/usr/X11R6/$LIBDIR/libX11* $MBD_DIR/$LIBDIR/ + cp -df $IMGPATH/usr/X11R6/$LIBDIR/libXmuu* $MBD_DIR/$LIBDIR/ + cp -df $IMGPATH/usr/X11R6/$LIBDIR/libXext* $MBD_DIR/$LIBDIR/ + install -m 755 $IMGPATH/usr/sbin/dasdfmt $MBD_DIR/sbin/dasdfmt + install -m 755 $IMGPATH/usr/sbin/fdasd $MBD_DIR/sbin/fdasd + install -m 755 $IMGPATH/usr/sbin/ldconfig $MBD_DIR/sbin/ldconfig + cp -f $IMGPATH/usr/sbin/ifconfig $MBD_DIR/sbin/ifconfig + cp -f $IMGPATH/usr/sbin/xinetd $MBD_DIR/sbin/xinetd + cp -f $IMGPATH/usr/sbin/in.telnetd $MBD_DIR/sbin/in.telnetd + cp -f $IMGPATH/usr/sbin/route $MBD_DIR/sbin/route + cp -f $IMGPATH/usr/sbin/portmap $MBD_DIR/sbin/portmap + cp -f $IMGPATH/etc/xinetd.conf $MBD_DIR/etc/xinetd.conf + # key generation takes ages on s390, you really don't want this for every + # installation attempt. These are NOT the keys of the installed system! + echo -n "Generating SSH1 RSA host key: " + /usr/bin/ssh-keygen -q -t rsa1 -f $MBD_DIR/etc/ssh/ssh_host_key \ + -C '' -N '' >&/dev/null + chmod 600 $MBD_DIR/etc/ssh/ssh_host_key + chmod 644 $MBD_DIR/etc/ssh/ssh_host_key.pub + echo + echo -n "Generating SSH2 RSA host key: " + /usr/bin/ssh-keygen -q -t rsa -f $MBD_DIR/etc/ssh/ssh_host_rsa_key \ + -C '' -N '' >&/dev/null + chmod 600 $MBD_DIR/etc/ssh/ssh_host_rsa_key + chmod 644 $MBD_DIR/etc/ssh/ssh_host_rsa_key.pub + echo + echo -n "Generating SSH2 DSA host key: " + /usr/bin/ssh-keygen -q -t dsa -f $MBD_DIR/etc/ssh/ssh_host_dsa_key \ + -C '' -N '' >&/dev/null + chmod 600 $MBD_DIR/etc/ssh/ssh_host_dsa_key + chmod 644 $MBD_DIR/etc/ssh/ssh_host_dsa_key.pub + echo + cat > $MBD_DIR/etc/ssh/sshd_config <<EOF +Port 22 +HostKey /etc/ssh/ssh_host_key +HostKey /etc/ssh/ssh_host_rsa_key +HostKey /etc/ssh/ssh_host_dsa_key +PermitRootLogin yes +IgnoreRhosts yes +StrictModes yes +X11Forwarding yes +X11DisplayOffset 10 +PrintMotd yes +XAuthLocation /sbin/xauth +KeepAlive yes +SyslogFacility AUTHPRIV +RhostsAuthentication no +RSAAuthentication yes +PasswordAuthentication yes +PermitEmptyPasswords yes +EOF + + for file in ISO8859-15.so EUC-JP.so libJIS.so gconv-modules; do + cp -f $IMGPATH/usr/$LIBDIR/gconv/$file $MBD_DIR/usr/$LIBDIR/gconv/$file + done + cp -f $IMGPATH/etc/services $MBD_DIR/etc/ + cp -df $IMGPATH/$LIBDIR/libpam.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libdl.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libdl-*.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libnsl.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libnsl-*.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libnss_compat* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libnss_dns* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libnss_files* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libutil.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libutil-*.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libcrypt*so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/usr/$LIBDIR/libwrap*.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libc.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libc-*.so* $MBD_DIR/$LIBDIR + if [ "$BUILDARCH" = "s390" ]; then + cp -df $IMGPATH/$LIBDIR/ld.so* $MBD_DIR/lib + else # (s390x) + cp -df $IMGPATH/$LIBDIR/ld64.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/lib/ld64.so* $MBD_DIR/lib + fi + cp -df $IMGPATH/$LIBDIR/ld-*.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libresolv.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libresolv-*.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libvtoc*.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libm.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libm-*.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/usr/$LIBDIR/libz.so* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libssl* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libext2* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libcom_err* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libcrack* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/usr/kerberos/$LIBDIR/libgssapi_krb5* $MBD_DIR/usr/kerberos/$LIBDIR + cp -df $IMGPATH/usr/kerberos/$LIBDIR/libkrb5.so* $MBD_DIR/usr/kerberos/$LIBDIR + cp -df $IMGPATH/usr/kerberos/$LIBDIR/libk5crypto.so* $MBD_DIR/usr/kerberos/$LIBDIR + cp -df $IMGPATH/usr/kerberos/$LIBDIR/libcom_err.so* $MBD_DIR/usr/kerberos/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libe2p* $MBD_DIR/$LIBDIR + cp -df $IMGPATH/$LIBDIR/libuuid* $MBD_DIR/$LIBDIR + cat >>$MBD_DIR/etc/ld.so.conf <<EOF +/usr/kerberos/$LIBDIR +/usr/X11R6/$LIBDIR +/mnt/runtime/$LIBDIR +/mnt/runtime/usr/$LIBDIR +EOF + (/usr/sbin/chroot $MBD_DIR /sbin/ldconfig ) + ln -s /proc/mounts $MBD_DIR/etc/mtab + ln -s sbin $MBD_DIR/bin + + awk '{ printf("mknod %s/dev/%s %s %s %s\n", $1, $2, $3, $4, $5); + printf("chmod %s %s/dev/%s\n", $6, $1, $2); + printf("chown %s %s/dev/%s\n", $7, $1, $2); + }' <<EOF | sh + $MBD_DIR console c 4 64 600 root:root + $MBD_DIR random c 1 8 644 root:root + $MBD_DIR ram0 b 1 1 640 root:root + $MBD_DIR ram1 b 1 2 640 root:root + $MBD_DIR ram2 b 1 3 640 root:root + $MBD_DIR ram3 b 1 4 640 root:root + $MBD_DIR loop0 b 7 0 640 root:disk + $MBD_DIR loop1 b 7 1 640 root:disk + $MBD_DIR loop2 b 7 2 640 root:disk + $MBD_DIR loop3 b 7 3 640 root:disk + $MBD_DIR urandom c 1 9 644 root:root + $MBD_DIR xpram0 b 35 0 600 root:root + $MBD_DIR xpram1 b 35 1 600 root:root + $MBD_DIR xpram2 b 35 2 600 root:root + $MBD_DIR tty c 5 0 666 root:root + $MBD_DIR null c 1 3 666 root:root + $MBD_DIR zero c 1 5 666 root:root + $MBD_DIR md0 b 9 0 644 root:root + $MBD_DIR mem c 1 1 600 root:root + $MBD_DIR ptmx c 5 2 666 root:root + $MBD_DIR tty0 c 4 0 600 root:tty + $MBD_DIR tty1 c 4 1 600 root:tty + $MBD_DIR openprom c 10 139 644 root:root + $MBD_DIR ptyp0 c 2 0 644 root:root + $MBD_DIR ttyp1 c 3 1 644 root:root + $MBD_DIR ttyp2 c 3 2 644 root:root + $MBD_DIR ttyp3 c 3 3 644 root:root + $MBD_DIR ttyp4 c 3 4 644 root:root + $MBD_DIR ttyp5 c 3 5 644 root:root + $MBD_DIR ttyp6 c 3 6 644 root:root + $MBD_DIR ttyp7 c 3 7 644 root:root + $MBD_DIR ttyp8 c 3 8 644 root:root + $MBD_DIR ttyp9 c 3 9 644 root:root + $MBD_DIR fd0 b 2 0 644 root:root + $MBD_DIR fd1 b 2 1 644 root:root +EOF + ln -s ram1 $MBD_DIR/dev/ram + for i in `seq 2 9`; do + ln -s console $MBD_DIR/dev/tty$i + done + + dd if=/dev/zero of=$MBD_DIR/etc/ramfs.img.big bs=1k count=17000 + mke2fs -F -q $MBD_DIR/etc/ramfs.img.big + gzip -9 < $MBD_DIR/etc/ramfs.img.big > $MBD_DIR/etc/ramfs.img + rm -f $MBD_DIR/etc/ramfs.img.big + +cat > $MBD_DIR/.profile <<EOF +PATH=/bin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/mnt/sbin:/mnt/usr/sbin:/mnt/bin:/mnt/usr/bin +export PATH +EOF + + rm -f $MBD_FSIMAGE + dd if=/dev/zero of=$MBD_FSIMAGE bs=1k count=$INITRDSIZE 2> /dev/null + /sbin/mke2fs -F -i 1024 -q $MBD_FSIMAGE $INITRDSIZE #> /dev/null 2>/dev + rm -rf $MBD_MNTPOINT + mkdir $MBD_MNTPOINT + mount -o loop -t ext2 $MBD_FSIMAGE $MBD_MNTPOINT + (cd $MBD_DIR; find . | cpio --quiet -p $MBD_MNTPOINT) + + left=$(df $MBD_MNTPOINT | tail +2) + left=$(echo $left | awk '{print $4'}) + + umount $MBD_MNTPOINT + + mv -f $MBD_FSIMAGE $MBD_FSIMAGE.uncompressed + gzip -9 < $MBD_FSIMAGE.uncompressed > $MBD_FSIMAGE + rm -rf $MBD_FSIMAGE.uncompressed $MBD_DIR + + size=$(du $MBD_FSIMAGE | awk '{ print $1 }') + + echo "Wrote $MBD_BOOTTREE (${size}k compressed, ${left}k free)" + + rm -rf $MBD_TMPIMAGE $MBD_BOOTTREE + + if [ -n "$PADSIZE" ]; then + padfile $MBD_FSIMAGE $PADSIZE + fi + + if [ -n "$EXTRAINITRDPATH" ]; then + mkdir -p `dirname $EXTRAINITRDPATH` + cp -a $MBD_FSIMAGE $EXTRAINITRDPATH + fi + + if [ -z "$KEEP" ]; then + rm -rf $MBD_TMPIMAGE $MBD_FSIMAGE $MBD_MNTPOINT $MBD_BOOTTREE + fi +} + +if [ $BUILDARCH = "s390x" ]; then + LIBDIR=lib64 +else + LIBDIR=lib +fi + + IDEMODS="" SCSIMODS="" @@ -45,16 +406,16 @@ NETWORKMODULES="$COMMONMODULES nfs ctc netiucv ipv6" echo "In mk-images.s390: kernelvers is $kernelvers" if [ "$kernelvers" = "BOOT" ]; then - makeinitrd --initrdto $TOPDESTPATH/images/initrd.img \ - --initrdsize 8192 \ + makeS390initrd --initrdto $TOPDESTPATH/images/initrd.img \ + --initrdsize 15000 \ --loaderbin loader \ --modules "$NETWORKMODULES" cp -vf $KERNELROOT/boot/${KERNELNAME}-${version} $TOPDESTPATH/images/kernel.img fi if [ "$kernelvers" = "BOOTtape" ]; then - makeinitrd --initrdto $TOPDESTPATH/images/tapeinrd.img \ - --initrdsize 8192 \ + makeS390initrd --initrdto $TOPDESTPATH/images/tapeinrd.img \ + --initrdsize 15000 \ --loaderbin loader \ --modules "$NETWORKMODULES" cp -vf $KERNELROOT/boot/${KERNELNAME}-${version} $TOPDESTPATH/images/tapekrnl.img @@ -70,11 +431,6 @@ for I in `find $BOOTDISKDIR -type d`; do fi done -#makebootdisk --kernelto $TOPDESTPATH/boot/vmlinuz \ -# --bootdisksize 1440 \ -# --imagename $BOOTDIR/kernel.img #\ -# #--initrd $TOPDESTPATH//autoboot/initrd.img - unset BOOTLANG unset BOOTDIR diff --git a/scripts/pythondeps b/scripts/pythondeps index 52f8de9bf..e82719768 100644 --- a/scripts/pythondeps +++ b/scripts/pythondeps @@ -10,7 +10,7 @@ DIR=$1 ARCH=`uname -m | sed -e 's/i.86/i386/'` -if [ "$ARCH" = "x86_64" ]; then +if [ "$ARCH" = "x86_64" -o $ARCH = s390x ]; then LIBDIR=lib64 else LIBDIR=lib diff --git a/scripts/scrubtree b/scripts/scrubtree index 10ed1a81a..3e3b20f33 100755 --- a/scripts/scrubtree +++ b/scripts/scrubtree @@ -14,7 +14,7 @@ if [ $ARCH = ia64 ]; then STRIP="strip --strip-debug" fi -if [ $ARCH = x86_64 ]; then +if [ $ARCH = x86_64 -o $ARCH = s390x ]; then LIBDIR=lib64 else LIBDIR=lib diff --git a/scripts/upd-instroot b/scripts/upd-instroot index 50ecdb51e..064dcdc33 100755 --- a/scripts/upd-instroot +++ b/scripts/upd-instroot @@ -28,7 +28,7 @@ if [ -z "$ARCH" ]; then ARCH=`rpm -qp --qf "%{ARCH}" $PACKAGEDIR/anaconda-runtime*.rpm` fi -if [ $ARCH = x86_64 ]; then +if [ $ARCH = x86_64 -o $ARCH = s390x ]; then LIBDIR=lib64 else LIBDIR=lib @@ -115,10 +115,11 @@ if [ $ARCH = ia64 ]; then fi if [ $ARCH = s390 -o $ARCH = s390x ]; then - PACKAGES="$PACKAGES s390utils oco binutils s390installer pdksh wget - net-tools inetd openssh openssh-server coreutils modutils - initscripts gawk xauth - portmap telnet-server login ssh_keys" + PACKAGES="$PACKAGES s390utils binutils libgcc tcp_wrappers + sed net-tools xinetd openssl openssh openssh-server coreutils + login initscripts XFree86-xauth bash portmap pam + libcrack telnet-server login mount grep modutils gawk + XFree86-libs" fi # xpm is missing @@ -181,16 +182,6 @@ if [ $ARCH = ia64 ]; then PACKAGESGR="$PACKAGESGR elilo" fi -# -# special packages for particular arches -# -if [ $ARCH = s390 -o $ARCH = s390x ]; then - PACKAGESGR="$PACKAGESGR s390utils oco binutils s390installer pdksh - net-tools inetd openssh openssh-server coreutils login - wget initscripts xauth - modutils portmap openssl telnet-server strace ssh_keys" -fi - if [ $ARCH = ppc ]; then PACKAGESGR="$PACKAGESGR fbset" fi @@ -362,7 +353,6 @@ EOF if [ $ARCH = s390 -o $ARCH = s390x ]; then cat >> $KEEPFILE <<EOF -linuxrc usr/share/terminfo/a/ansi usr/share/terminfo/d/dumb usr/share/terminfo/s/screen @@ -384,8 +374,8 @@ usr/bin/pkgsrc usr/sbin/chroot usr/sbin/sshd usr/sbin/glibc_post_upgrade -usr/sbin/inetd usr/sbin/in.telnetd +usr/sbin/xinetd sbin/busybox.anaconda sbin/consoletype sbin/rhsetup @@ -398,11 +388,13 @@ sbin/swapon sbin/swapoff sbin/mkswap sbin/tune2fs +bin/bash bin/dd -bin/gawk-3.1.0 +bin/gawk +bin/mount +bin/umount bin/mknod bin/login -bin/ksh bin/cat bin/chmod bin/sort @@ -419,16 +411,27 @@ $LIBDIR/libutil-*.so* $LIBDIR/libcrypt* $LIBDIR/libc.so* $LIBDIR/libc-*so* -$LIBDIR/ld.so* -$LIBDIR/ld-*.so* +lib/ld*.so* +$LIBDIR/ld*.so* $LIBDIR/libresolv.so* $LIBDIR/libresolv-*.so* $LIBDIR/libvtoc*.so* -$LIBDIR/modules/ibm* -etc/inetd.conf -etc/ssh/* -etc/motd -etc/issue.net +lib/modules/ibm/* +etc/xinetd.conf +etc/xinetd.d/telnet +etc/pam.d/sshd +etc/pam.d/login +etc/pam.d/system-auth +etc/pam.d/other +etc/security/limits.conf +etc/security/pam_env.conf +lib/security +$LIBDIR/security/pam_* +usr/$LIBDIR/libcrack.so* +usr/$LIBDIR/libwrap.so* +usr/X11R6/$LIBDIR/libXmuu.so* +usr/X11R6/$LIBDIR/libX11.so* +usr/X11R6/$LIBDIR/libXext.so* usr/X11R6/bin/xauth EOF fi @@ -752,28 +755,26 @@ chown -R root:root $DEST $DESTGR chmod -R a+rX-w $DEST $DESTGR if [ $ARCH = s390 -o $ARCH = s390x ]; then for i in $DEST $DESTGR; do - (cd $i/etc/ssh; chmod og-r ssh_host*key primes sshd_config) mv $i/bin/sed $i/bin/sed_save mv $i/bin/sort $i/bin/sort_save - mv $i/bin/mknod $i/bin/mknod_save done fi # Remove locales unused during the install cat $DESTGR/usr/lib/anaconda/lang-table* | awk ' -{ gsub("-", "", $5); - print $5; - print gensub(/\..*$/,"","",$5); - print gensub(/_.*$/,"","",$5); - if (split ($5, a, "\.") > 1) { - print gensub(/\..*$/,tolower("." a[2]),"",$5); +{ gsub("-", "", $4); + print $4; + print gensub(/\..*$/,"","",$4); + print gensub(/_.*$/,"","",$4); + if (split ($4, a, "\.") > 1) { + print gensub(/\..*$/,tolower("." a[2]),"",$4); }; - gsub("-", "", $8); - print $8; - print gensub(/\..*$/,"","",$8); - print gensub(/_.*$/,"","",$8); - if (split ($8, a, "\.") > 1) { - print gensub(/\..*$/,tolower("." a[2]),"",$8); + gsub("-", "", $7); + print $7; + print gensub(/\..*$/,"","",$7); + print gensub(/_.*$/,"","",$7); + if (split ($7, a, "\.") > 1) { + print gensub(/\..*$/,tolower("." a[2]),"",$7); }; } ' | LC_ALL=C sort -u > $DESTGR/locales @@ -842,8 +843,7 @@ fi echo "Getting pango modules" if [ -n "$NEEDGR" ]; then if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then - REALPATH=`(cd $DESTGR; /bin/pwd | sed 's,/md1/,/,g')` - runroot $COMPONENT --onlyone --arch $ARCH "LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $REALPATH /usr/bin/pango-querymodules 2> $REALPATH/etc/pango/pango.modules" + runroot $COMPONENT --onlyone --arch $ARCH "LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/pango-querymodules 2> $DESTGR/etc/pango/pango.modules" else LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/pango-querymodules > $DESTGR/etc/pango/pango.modules fi @@ -853,8 +853,7 @@ fi echo "Getting gtk2 input method modules" if [ -n "$NEEDGR" ]; then if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then - REALPATH=`(cd $DESTGR; /bin/pwd | sed 's,/md1/,/,g')` - runroot $COMPONENT --onlyone --arch $ARCH "LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $REALPATH /usr/bin/gtk-query-immodules-2.0 2> $REALPATH/etc/gtk-2.0/gtk.immodules" + runroot $COMPONENT --onlyone --arch $ARCH "LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/gtk-query-immodules-2.0 2> $DESTGR/etc/gtk-2.0/gtk.immodules" else LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/gtk-query-immodules-2.0 > $DESTGR/etc/gtk-2.0/gtk.immodules fi @@ -864,12 +863,11 @@ fi echo "Getting gtk2 gdk-pixbuf loaders" if [ -n "$NEEDGR" ]; then if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then - runroot $COMPONENT --onlyone --arch $ARCH "LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $REALPATH /usr/bin/gdk-pixbuf-query-loaders 2> $REALPATH/etc/gtk-2.0/gdk-pixbuf.loaders" + runroot $COMPONENT --onlyone --arch $ARCH "LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/gdk-pixbuf-query-loaders 2> $DESTGR/etc/gtk-2.0/gdk-pixbuf.loaders" else LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/gdk-pixbuf-query-loaders > $DESTGR/etc/gtk-2.0/gdk-pixbuf.loaders fi rm -f $DESTGR/usr/bin/gdk-pixbuf-query-loaders - fi # make the changes we want to fonts.conf for anaconda (#65913) @@ -950,8 +948,7 @@ for p in $DEST $DESTGR; do gzip -9) > $p/usr/$LIBDIR/timezones.gz if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then - REALPATH=`(cd $p; /bin/pwd | sed 's,/md1/,/,g')` - runroot $COMPONENT --onlyone --arch $ARCH "cd $REALPATH\; usr/lib/anaconda-runtime/scrubtree $REALPATH" + runroot $COMPONENT --onlyone --arch $ARCH "cd $p\; usr/lib/anaconda-runtime/scrubtree $p" else $p/usr/lib/anaconda-runtime/scrubtree $p fi @@ -969,8 +966,7 @@ fi echo "Creating fontconfig cache" if [ -n "$NEEDGR" ]; then if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then - REALPATH=`(cd $DESTGR; /bin/pwd | sed 's,/md1/,/,g')` - runroot $COMPONENT --onlyone --arch $ARCH "LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $REALPATH /usr/bin/fc-cache -v" + runroot $COMPONENT --onlyone --arch $ARCH "LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/fc-cache -v" else LD_LIBRARY_PATH=/usr/X11R6/$LIBDIR:$LD_LIBRARY_PATH /usr/sbin/chroot $DESTGR /usr/bin/fc-cache -v fi @@ -1011,8 +1007,7 @@ cd - echo -n -e "Removing unused python files in hdimage... " if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then - REALPATH=`(cd $DEST; /bin/pwd | sed 's,/md1/,/,g')` - runroot $COMPONENT --onlyone --arch $ARCH "cd $REALPATH\; usr/lib/anaconda-runtime/pythondeps $REALPATH" + runroot $COMPONENT --onlyone --arch $ARCH "cd $DEST\; usr/lib/anaconda-runtime/pythondeps $DEST" else $DEST/usr/lib/anaconda-runtime/pythondeps $DEST fi @@ -1030,9 +1025,10 @@ done # do some stripping of debugging symbols if [ -x /usr/bin/runroot -a -n "$COMPONENT" ]; then - REALPATH=`(cd $DEST; /bin/pwd | sed 's,/md1/,/,g')` - runroot $COMPONENT --onlyone --arch $ARCH "cd $REALPATH; find $DESTGR -type f -name '*.so' -exec strip -g '{}' ';'" + runroot $COMPONENT --onlyone --arch $ARCH "\"find $DEST -type f -name '*.so' -exec strip -g '{}' ';'\"" + runroot $COMPONENT --onlyone --arch $ARCH "\"find $DESTGR -type f -name '*.so' -exec strip -g '{}' ';'\"" else + find $DEST -type f -name '*.so' |xargs strip -g find $DESTGR -type f -name '*.so' |xargs strip -g fi @@ -43,7 +43,6 @@ 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", @@ -55,7 +54,8 @@ stepToClasses = { "BootloaderPasswordWindow")), "bootloaderadvanced" : ("bootloader_text", ("BootloaderImagesWindow", "BootloaderLocationWindow")), - "network" : ("network_text", ("NetworkWindow", "HostnameWindow")), + "network" : ("network_text", ("NetworkDeviceWindow", "NetworkGlobalWindow", + "HostnameWindow")), "firewall" : ("firewall_text", "FirewallWindow"), "languagesupport" : ("language_text", ("LanguageSupportWindow", "LanguageDefaultWindow")), @@ -380,7 +380,7 @@ class InstallInterface: if DEBUG: self.screen.suspendCallback(debugSelf, self.screen) - if flags.serial: + if flags.serial or isys.isPsudoTTY(0): self.screen.suspendCallback(spawnShell, self.screen) # clear out the old root text by writing spaces in the blank @@ -389,13 +389,6 @@ class InstallInterface: #(self.screen.width - len(_(self.welcomeText))) * " ") #self.screen.drawRootText (0 - len(_(step[0])), 0, _(step[0])) lang = id.instLanguage.getCurrent() - # if we don't have any way to display the preselected language, - # fall back to English. - if ((id.instLanguage.getFontFile(lang) == "Kon" and not - isys.isPsudoTTY(0)) or - id.instLanguage.getFontFile(lang) == "None"): - lang = "English" - id.instLanguage.setRuntimeLanguage(lang) lang = id.instLanguage.getLangNick(lang) self.langSearchPath = expandLangs(lang) + ['C'] self.instLanguage = id.instLanguage diff --git a/textw/network_text.py b/textw/network_text.py index b9305475a..1419fb806 100644 --- a/textw/network_text.py +++ b/textw/network_text.py @@ -1,7 +1,10 @@ # # network_text.py: text mode network configuration dialogs # -# Copyright 2000-2002 Red Hat, Inc. +# Jeremy Katz <katzj@redhat.com> +# Michael Fulbright <msf@redhat.com> +# +# Copyright 2000-2003 Red Hat, Inc. # # This software may be freely redistributed under the terms of the GNU # library public license. @@ -14,174 +17,149 @@ import iutil import os import isys +import string +from network import isPtpDev, anyUsingDHCP, sanityCheckIPString +from network import sanityCheckHostname from snack import * from constants_text import * from rhpl.translate import _ -class NetworkWindow: - def setsensitive (self): - if self.cb.selected (): + +def badIPDisplay(screen, the_ip): + ButtonChoiceWindow(screen, _("Invalid IP string"), + _("The entered IP '%s' is not a valid IP.") %(the_ip,), + buttons = [ _("OK") ]) + return + +class NetworkDeviceWindow: + def setsensitive(self): + if self.dhcpCb.selected (): sense = FLAGS_SET else: sense = FLAGS_RESET - for n in self.ip, self.nm, self.gw, self.ns, self.ns2, self.ns3: + for n in self.entries.values(): n.setFlags (FLAG_DISABLED, sense) - def calcNM (self): - ip = self.ip.value () - if ip and not self.nm.value (): + def calcNM(self): + ip = self.entries["ipaddr"].value() + if ip and not self.entries["netmask"].value (): try: mask = "255.255.255.0" except ValueError: return - self.nm.set (mask) - - def calcGW (self): - ip = self.ip.value () - nm = self.nm.value () - if ip and nm: - try: - (net, bcast) = isys.inet_calcNetBroad (ip, nm) - except ValueError: - return - - if not self.gw.value (): - gw = isys.inet_calcGateway (bcast) - self.gw.set (gw) - if not self.ns.value (): - ns = isys.inet_calcNS (net) - self.ns.set (ns) - + self.entries["netmask"].set (mask) + def runScreen(self, screen, network, dev): - - firstg = Grid (1, 3) - boot = dev.get ("bootproto") - onboot = dev.get('onboot') + boot = dev.get("bootproto") + onboot = dev.get("onboot") onbootIsOn = ((dev == network.available().values()[0] and not onboot) - or onboot == 'yes') - + or onboot == "yes") if not boot: boot = "dhcp" - firstg.setField (Label (_("Network Device: %s") % - (dev.info['DEVICE'],)), - 0, 0, padding = (0, 0, 0, 1), anchorLeft = 1) - self.cb = Checkbox (_("Use bootp/dhcp"), - isOn = (boot == "dhcp")) - firstg.setField (self.cb, 0, 1, anchorLeft = 1) - self.onboot = Checkbox(_("Activate on boot"), isOn = onbootIsOn) - firstg.setField (self.onboot, 0, 2, anchorLeft = 1) - - 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 (_("Tertiary nameserver:")), 0, 5, - anchorLeft = 1) - if ask_ptp: - secondg.setField (Label (_("Point to Point (IP):")), 0, 6, - anchorLeft = 1) + + options = [(_("IP Address"), "ipaddr"), + (_("Netmask"), "netmask")] + if (isPtpDev(dev.info["DEVICE"])): + newopt = (_("Point to Point (IP)"), "remip") + options.append(newopt) + + thegrid = Grid(2, 3 + len(options)) + + thegrid.setField(Label (_("Network Device: %s") + %(dev.info['DEVICE'],)), + 0, 0, padding = (0, 0, 0, 1), anchorLeft = 1, + growx = 1) + + self.dhcpCb = Checkbox(_("Configure using DHCP"), + isOn = (boot == "dhcp")) + thegrid.setField(self.dhcpCb, 0, 1, anchorLeft = 1, growx = 1) - self.ip = Entry (16) - self.ip.set (dev.get ("ipaddr")) - self.nm = Entry (16) - self.nm.set (dev.get ("netmask")) - self.gw = Entry (16) - self.gw.set (network.gateway) - self.ns = Entry (16) - self.ns.set (network.primaryNS) - self.ns2 = Entry (16) - 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.onbootCb = Checkbox(_("Activate on boot"), isOn = onbootIsOn) + thegrid.setField(self.onbootCb, 0, 2, anchorLeft = 1, growx = 1, + padding = (0, 0, 0, 1)) - - self.cb.setCallback (self.setsensitive) - self.ip.setCallback (self.calcNM) - self.nm.setCallback (self.calcGW) - - secondg.setField (self.ip, 1, 0, (1, 0, 0, 0)) - secondg.setField (self.nm, 1, 1, (1, 0, 0, 0)) - secondg.setField (self.gw, 1, 2, (1, 0, 0, 0)) - 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)) + row = 3 + self.entries = {} + for (name, opt) in options: + thegrid.setField(Label(name), 0, row, anchorLeft = 1) - bb = ButtonBar (screen, (TEXT_OK_BUTTON, TEXT_BACK_BUTTON)) + entry = Entry (16) + entry.set(dev.get(opt)) + thegrid.setField(entry, 1, row, padding = (1, 0, 0, 0)) - toplevel = GridFormHelp (screen, _("Network Configuration for %s") % - (dev.info['DEVICE']), - "network", 1, 3) - toplevel.add (firstg, 0, 0, (0, 0, 0, 1), anchorLeft = 1) - toplevel.add (secondg, 0, 1, (0, 0, 0, 1)) - toplevel.add (bb, 0, 2, growx = 1) + self.entries[opt] = entry + + row = row + 1 + + self.dhcpCb.setCallback(self.setsensitive) + self.entries["ipaddr"].setCallback(self.calcNM) + + bb = ButtonBar(screen, (TEXT_OK_BUTTON, TEXT_BACK_BUTTON)) - self.setsensitive () + toplevel = GridFormHelp(screen, _("Network Configuration for %s") % + (dev.info['DEVICE']), + "networkdev", 1, 3) + toplevel.add(thegrid, 0, 0, (0, 0, 0, 1), anchorLeft = 1) + toplevel.add(bb, 0, 2, growx = 1) + self.setsensitive() + while 1: - result = toplevel.run () - if self.onboot.selected() != 0: - dev.set (('onboot', 'yes')) + result = toplevel.run() + rc = bb.buttonPressed (result) + screen.popWindow() + + if rc == TEXT_BACK_CHECK: + return INSTALL_BACK + + if self.onbootCb.selected() != 0: + dev.set(("onboot", "yes")) else: - dev.unset ('onboot') - if self.cb.selected (): - dev.set (("bootproto", "dhcp")) - dev.unset ("ipaddr", "netmask", "network", "broadcast", "remip") + dev.unset("onboot") + + if self.dhcpCb.selected() != 0: + dev.set(("bootproto", "dhcp")) + dev.unset("ipaddr", "netmask", "network", "broadcast", "remip") else: + ip = self.entries["ipaddr"].value() + nm = self.entries["netmask"].value() try: - (net, bc) = isys.inet_calcNetBroad (self.ip.value (), - self.nm.value ()) + (net, bc) = isys.inet_calcNetBroad(ip, nm) except: - ButtonChoiceWindow(screen, _("Invalid information"), - _("You must enter valid IP information to continue"), - buttons = [ _("OK") ]) - continue + if self.onbootCb.selected() != 0: + ButtonChoiceWindow(screen, _("Invalid information"), + _("You must enter valid IP " + "information to continue"), + buttons = [ _("OK") ]) + continue + else: + net = "" + bc = "" - dev.set (("bootproto", "static")) - dev.set (("ipaddr", self.ip.value ()), ("netmask", - self.nm.value ()), - ("network", net), ("broadcast", bc)) - if ask_ptp: - dev.set (("remip", self.ptp.value())) - network.gateway = self.gw.value () - network.primaryNS = self.ns.value () - network.secondaryNS = self.ns2.value() - network.ternaryNS = self.ns3.value() + dev.set(("bootproto", "static")) + + for val in self.entries.keys(): + if self.entries[val].value(): + dev.set((val, self.entries[val].value())) + + if bc and net: + dev.set(("broadcast", bc), ("network", net)) - screen.popWindow() break - - rc = bb.buttonPressed (result) - if rc == TEXT_BACK_CHECK: - return INSTALL_BACK return INSTALL_OK + def __call__(self, screen, network, dir, intf): - devices = network.available () + devices = network.available() if not devices: return INSTALL_NOOP - list = devices.keys () - list.sort() + list = devices.keys() + list.sort() devLen = len(list) if dir == 1: currentDev = 0 @@ -200,33 +178,202 @@ class NetworkWindow: else: return INSTALL_OK -class HostnameWindow: +class NetworkGlobalWindow: + def getFirstGatewayGuess(self, devices): + list = devices.keys() + list.sort() + for dev in list: + thedev = devices[dev] + bootproto = thedev.get("bootproto") + if bootproto and bootproto == "dhcp": + continue + onboot = thedev.get("onboot") + if onboot and onboot == "no": + continue + bcast = thedev.get("broadcast") + if not bcast: + continue + return isys.inet_calcGateway(bcast) + return "" + def __call__(self, screen, network, dir, intf): - devices = network.available () + devices = network.available() if not devices: return INSTALL_NOOP - list = devices.keys () - list.sort() - dev = devices[list[0]] - if dev.get ("bootproto") == "dhcp": + # we don't let you set gateway/dns if you've got any interfaces + # using dhcp (for better or worse) + if anyUsingDHCP(devices): return INSTALL_NOOP + + thegrid = Grid(2, 4) + + thegrid.setField(Label(_("Gateway:")), 0, 0, anchorLeft = 1) + gwEntry = Entry(16) + # if it's set already, use that... otherwise, get the first + # non-dhcp and active device and use it to guess the gateway + if network.gateway: + gwEntry.set(network.gateway) + else: + gwEntry.set(self.getFirstGatewayGuess(devices)) + thegrid.setField(gwEntry, 1, 0, padding = (1, 0, 0, 0)) + + thegrid.setField(Label(_("Primary DNS:")), 0, 1, anchorLeft = 1) + ns1Entry = Entry(16) + ns1Entry.set(network.primaryNS) + thegrid.setField(ns1Entry, 1, 1, padding = (1, 0, 0, 0)) + + thegrid.setField(Label(_("Secondary DNS:")), 0, 2, anchorLeft = 1) + ns2Entry = Entry(16) + ns2Entry.set(network.secondaryNS) + thegrid.setField(ns2Entry, 1, 2, padding = (1, 0, 0, 0)) + + thegrid.setField(Label(_("Tertiary DNS:")), 0, 3, anchorLeft = 1) + ns3Entry = Entry(16) + ns3Entry.set(network.ternaryNS) + thegrid.setField(ns3Entry, 1, 3, padding = (1, 0, 0, 0)) + + bb = ButtonBar (screen, (TEXT_OK_BUTTON, TEXT_BACK_BUTTON)) + + toplevel = GridFormHelp (screen, _("Miscellaneous Network Settings"), + "miscnetwork", 1, 3) + toplevel.add (thegrid, 0, 0, (0, 0, 0, 1), anchorLeft = 1) + toplevel.add (bb, 0, 2, growx = 1) + + while 1: + result = toplevel.run() + rc = bb.buttonPressed (result) + screen.popWindow() + + if rc == TEXT_BACK_CHECK: + return INSTALL_BACK + + val = gwEntry.value() + if val and sanityCheckIPString(val) is None: + badIPDisplay(screen, val) + continue + network.gateway = val + + val = ns1Entry.value() + if val and sanityCheckIPString(val) is None: + badIPDisplay(screen, val) + continue + network.primaryNS = val + + val = ns2Entry.value() + if val and sanityCheckIPString(val) is None: + badIPDisplay(screen, val) + continue + network.secondaryNS = val + + val = ns3Entry.value() + if val and sanityCheckIPString(val) is None: + badIPDisplay(screen, val) + continue + network.ternaryNS = val + break + + return INSTALL_OK - entry = Entry (24) +class HostnameWindow: + def hostTypeCb(self, (radio, hostEntry)): + if radio.getSelection() != "manual": + sense = FLAGS_SET + else: + sense = FLAGS_RESET + + hostEntry.setFlags(FLAG_DISABLED, sense) + + def __call__(self, screen, network, dir, intf): + devices = network.available () + if not devices: + return INSTALL_NOOP + + # figure out if the hostname is currently manually set + if anyUsingDHCP(devices): + if (network.hostname != "localhost.localdomain" and + network.overrideDHCPhostname): + manual = 1 + else: + manual = 0 + else: + manual = 1 + + thegrid = Grid(2, 2) + radio = RadioGroup() + autoCb = radio.add(_("automatically via DHCP"), "dhcp", + not manual) + thegrid.setField(autoCb, 0, 0, growx = 1, anchorLeft = 1) + + manualCb = radio.add(_("manually"), "manual", manual) + thegrid.setField(manualCb, 0, 1, anchorLeft = 1) + hostEntry = Entry(24) if network.hostname != "localhost.localdomain": - entry.set (network.hostname) + hostEntry.set(network.hostname) + thegrid.setField(hostEntry, 1, 1, padding = (1, 0, 0, 0), + anchorLeft = 1) - rc, values = EntryWindow(screen, _("Hostname Configuration"), - _("The hostname is the name of your computer. If your " - "computer is attached to a network, this may be " - "assigned by your network administrator."), - [(_("Hostname"), entry)], buttons = [ TEXT_OK_BUTTON, TEXT_BACK_BUTTON], - help = "hostname") + # disable the dhcp if we don't have any dhcp + if anyUsingDHCP(devices): + autoCb.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_RESET) + else: + autoCb.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_SET) - if rc == TEXT_BACK_CHECK: - return INSTALL_BACK + self.hostTypeCb((radio, hostEntry)) + + autoCb.setCallback(self.hostTypeCb, (radio, hostEntry)) + manualCb.setCallback(self.hostTypeCb, (radio, hostEntry)) + + toplevel = GridFormHelp(screen, _("Hostname Configuration"), + "hostname", 1, 4) + text = TextboxReflowed(55, + _("If your system is part of a larger network " + "where hostnames are assigned by DHCP, " + "select automatically via DHCP. Otherwise, " + "select manually and enter in a hostname for " + "your system. If you do not, your system " + "will be known as 'localhost.'")) + toplevel.add(text, 0, 0, (0, 0, 0, 1)) + + bb = ButtonBar(screen, (TEXT_OK_BUTTON, TEXT_BACK_BUTTON)) + toplevel.add(thegrid, 0, 1, padding = (0, 0, 0, 1)) + toplevel.add(bb, 0, 2, growx = 1) + + while 1: + result = toplevel.run() + rc = bb.buttonPressed(result) + screen.popWindow() + + if rc == TEXT_BACK_CHECK: + return INSTALL_BACK - network.hostname = entry.value () + if radio.getSelection != "manual": + network.overrideDHCPhostname = 0 + network.hostname = "localhost.localdomain" + else: + hname = string.strip(hostEntry.value()) + if len(hname) == 0: + ButtonChoiceWindow(_("Invalid Hostname"), + _("You have not specified a hostname."), + buttons = [ _("OK") ]) + continue + neterrors = sanityCheckHostname(hname) + if neterrors is not None: + ButtonChoiceWindow(_("Invalid Hostname"), + _("The hostname \"%s\" is not valid " + "for the following reason:\n\n%s") + %(hname, neterrors), + buttons = [ _("OK") ]) + continue + + network.overrideDHCPhostname = 1 + network.hostname = hname + break return INSTALL_OK + + + + + diff --git a/textw/partition_text.py b/textw/partition_text.py index a0e70bd8e..a963ac9c2 100644 --- a/textw/partition_text.py +++ b/textw/partition_text.py @@ -1074,22 +1074,13 @@ class PartitionWindow: if type == "RAID": self.editRaidRequest(request) elif type == "NEW": - if iutil.getArch() == "s390": - self.intf.messageWindow(_("Error"), - _("You must go back and use fdasd to initialize this partition")) - else: - self.editPartitionRequest(request, isNew = 1) + self.editPartitionRequest(request, isNew = 1) else: self.editPartitionRequest(request) def deleteCb(self): partition = self.lb.current() - if iutil.getArch() == "s390" 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() @@ -1127,20 +1118,13 @@ class PartitionWindow: col_label_align=[CENTER, CENTER,CENTER,CENTER,CENTER,CENTER]) self.g.add(self.lb, 0, 1) - if iutil.getArch() == "s390": - 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.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") diff --git a/textw/zipl_text.py b/textw/zipl_text.py index 69a85f7f8..7503c5cf4 100644 --- a/textw/zipl_text.py +++ b/textw/zipl_text.py @@ -12,6 +12,8 @@ # import iutil +import isys +import string from snack import * from constants_text import * from rhpl.translate import _ @@ -25,12 +27,16 @@ class ZiplWindow: "chandev parameters which your machine or your " "setup may require.")) + kernelparms = "" kernelentry = Entry(48, scroll = 1, returnExit = 1) chandeventry1 = Entry(48, scroll = 1, returnExit = 1) chandeventry2 = Entry(48, scroll = 1, returnExit = 1) if bl.args and bl.args.get(): - kernelentry.set(bl.args.get()) + kernelparms = bl.args.get() + if isys.getDasdPorts(): + kernelparms = kernelparms + " dasd=" + isys.getDasdPorts() + kernelentry.set(kernelparms) if bl.args and bl.args.chandevget(): cdevs = bl.args.chandevget() @@ -51,14 +57,15 @@ class ZiplWindow: sg.setField(Label(_("Kernel Parameters") + ": "), 0, 0, anchorLeft=1) sg.setField(kernelentry, 1, 0, anchorLeft=1) grid.add(sg, 0, 1, padding = (0, 1, 0, 1)) + sg = Grid(2, 1) sg.setField(Label(_("Chandev line ") + "1: "), 0, 0, anchorLeft=1) sg.setField(chandeventry1, 1, 0, anchorLeft=1) + grid.add(sg, 0, 2, padding = (0, 1, 0, 1)) sg = Grid(2, 1) sg.setField(Label(_("Chandev line ") + "2: "), 0, 0, anchorLeft=1) sg.setField(chandeventry2, 1, 0, anchorLeft=1) grid.add(sg, 0, 3, padding = (0, 1, 0, 1)) grid.add(buttons, 0, 4, growx = 1) - sg = Grid(2, 1) result = grid.runOnce () button = buttons.buttonPressed(result) @@ -16,6 +16,7 @@ # # should probably go in rhpl # +import iutil import rhpl.xserver as xserver from rhpl.translate import _ @@ -62,6 +63,11 @@ class XSetup: self.xhwstate.set_monitor_name(monname) def writeKS(self, f, desktop=None): + # FIXME: we really should have at least teh startxonboot and + # defaultdesktop bits on s390 + if iutil.getArch() == "s390": + return + if self.skipx: f.write("skipx\n") return |