diff options
-rw-r--r-- | fstab.py | 35 | ||||
-rwxr-xr-x | gui.py | 4 | ||||
-rw-r--r-- | isys/isys.c | 34 | ||||
-rw-r--r-- | isys/isys.py | 7 | ||||
-rw-r--r-- | iw/congrats_gui.py | 2 | ||||
-rw-r--r-- | iw/format_gui.py | 1 | ||||
-rw-r--r-- | iw/installpath_gui.py | 28 | ||||
-rw-r--r-- | iw/lilo_gui.py | 3 | ||||
-rw-r--r-- | iw/rootpartition_gui.py | 60 | ||||
-rw-r--r-- | lilo.py | 10 | ||||
-rw-r--r-- | text.py | 7 | ||||
-rw-r--r-- | textw/partitioning_text.py | 35 |
12 files changed, 193 insertions, 33 deletions
@@ -129,6 +129,41 @@ class Fstab: else: return None + def getBootPartitionMaxCyl(self): + bootpart = self.getBootDevice() + boothd = self.getMbrDevice() + + + maxcyl = None + + try: + bootgeom = isys.getGeometry(boothd) + except: + bootgeom = None + + log("Boot drive is %s, geometry is %s" % (boothd, bootgeom)) + if bootgeom != None: + isys.makeDevInode(boothd, '/tmp/' + boothd) + + try: + table = _balkan.readTable ('/tmp/' + boothd) + except SystemError: + pass + else: + for i in range (len (table)): + part = "%s%d" % (boothd, i+1) + if part == bootpart: + (type, sector, size) = table[i] + maxcyl = (sector+size) / string.atoi(bootgeom[2]) + maxcyl = maxcyl / string.atoi(bootgeom[1]) + + log("Boot part ends on cyl %s" % maxcyl) + + os.remove ('/tmp/' + boothd) + + return maxcyl + + def getMbrDevice(self): return self.driveList()[0] @@ -442,11 +442,13 @@ class InstallControlWindow: self.stateListIndex = pos def prevClicked (self, *args): - self.currentScreen.getPrev () + prev = self.currentScreen.getPrev () self.prevList.pop () (self.currentScreen, self.stateListIndex) = self.prevList[-1] + self.setScreen (self.currentScreen, self.prevClicked) + def nextClicked (self, *args): next = self.currentScreen.getNext () if next: diff --git a/isys/isys.c b/isys/isys.c index 92cc538df..82530b12b 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -28,6 +28,7 @@ #include <scsi/scsi_ioctl.h> #include <sys/vt.h> #include <sys/types.h> +#include <linux/hdreg.h> #include "Python.h" @@ -87,6 +88,7 @@ static PyObject * doVtActivate(PyObject * s, PyObject * args); static PyObject * doisPsudoTTY(PyObject * s, PyObject * args); static PyObject * doSync(PyObject * s, PyObject * args); static PyObject * doisIsoImage(PyObject * s, PyObject * args); +static PyObject * dogetGeometry(PyObject * s, PyObject * args); static PyMethodDef isysModuleMethods[] = { { "ejectcdrom", (PyCFunction) doEjectCdrom, METH_VARARGS, NULL }, @@ -134,6 +136,7 @@ static PyMethodDef isysModuleMethods[] = { { "isPsudoTTY", (PyCFunction) doisPsudoTTY, METH_VARARGS, NULL}, { "sync", (PyCFunction) doSync, METH_VARARGS, NULL}, { "isisoimage", (PyCFunction) doisIsoImage, METH_VARARGS, NULL}, + { "getGeometry", (PyCFunction) dogetGeometry, METH_VARARGS, NULL}, { NULL } } ; @@ -1383,3 +1386,34 @@ static PyObject * doisIsoImage(PyObject * s, PyObject * args) { return Py_BuildValue("i", rc); } int fileIsIso(const char * file); + +static PyObject * dogetGeometry(PyObject * s, PyObject * args) { + int fd; + int rc; + char *dev; + char cylinders[16], heads[16], sectors[16]; + char errstr[200]; + struct hd_geometry g; + + if (!PyArg_ParseTuple(args, "s", &dev)) return NULL; + + fd = open(dev, O_RDONLY); + if (fd < 0) { + snprintf(errstr, sizeof(errstr), "could not open device %s", dev); + PyErr_SetString(PyExc_ValueError, errstr); + return NULL; + } + + if (ioctl(fd, HDIO_GETGEO, &g)) { + close(fd); + snprintf(errstr, sizeof(errstr), "HDTIO_GETGEO ioctl() failed on device %s", dev); + PyErr_SetString(PyExc_ValueError, errstr); + return NULL; + } + + snprintf(cylinders, sizeof(cylinders), "%d", g.cylinders); + snprintf(heads, sizeof(heads), "%d", g.heads); + snprintf(sectors, sizeof(sectors), "%d", g.sectors); + + return Py_BuildValue("(sss)", cylinders, heads, sectors); +} diff --git a/isys/isys.py b/isys/isys.py index f076555d1..a7956825f 100644 --- a/isys/isys.py +++ b/isys/isys.py @@ -342,3 +342,10 @@ def sync (): def isIsoImage(file): return _isys.isisoimage(file) + +def getGeometry(device): + makeDevInode(device, "/tmp/disk") + rc = _isys.getGeometry("/tmp/disk") + os.unlink("/tmp/disk") + return rc + diff --git a/iw/congrats_gui.py b/iw/congrats_gui.py index 0075550ad..db758877e 100644 --- a/iw/congrats_gui.py +++ b/iw/congrats_gui.py @@ -33,7 +33,7 @@ class CongratulationWindow (InstallWindow): label = GtkLabel( _("Congratulations, installation is complete.\n\n" "Press return to reboot, and be sure to remove your " - "boot medium as the system reboots, or your system " + "boot medium after the system reboots, or your system " "will rerun the install. For information on fixes which " "are available for this release of Red Hat Linux, " "consult the " diff --git a/iw/format_gui.py b/iw/format_gui.py index 6a0526bb4..3595b4386 100644 --- a/iw/format_gui.py +++ b/iw/format_gui.py @@ -3,6 +3,7 @@ from iw_gui import * from thread import * import isys from translate import _ +from rootpartition_gui import AutoPartitionWindow class FormatWindow (InstallWindow): def __init__ (self, ics): diff --git a/iw/installpath_gui.py b/iw/installpath_gui.py index 0342c32a1..558c5f729 100644 --- a/iw/installpath_gui.py +++ b/iw/installpath_gui.py @@ -53,6 +53,7 @@ class InstallPathWindow (InstallWindow): ( AutoPartitionWindow, "partition" ), FDiskWindow, ( PartitionWindow, "partition" ), + ( LBA32WarningWindow, "lba32warning"), ( FormatWindow, "format" ), ( BootloaderWindow, BootloaderSkipname ), ( NetworkWindow, "network" ), @@ -135,17 +136,6 @@ class InstallPathWindow (InstallWindow): self.todo.expert, self.todo.upgrade) -### -### msf - 05-11-2000 - need to move this code!!!!!! -### -# # set state of disk druid to be read-only if needed -# if (InstallPathWindow.fdisk.get_active()): -# self.todo.fstab.setReadonly(1) -# else: -# self.todo.fstab.setReadonly(0) -# -# self.todo.fstab.setRunDruid(InstallPathWindow.fdisk.get_active()) - def toggled (self, widget, type): if not widget.get_active (): return if type == INSTALL: @@ -220,11 +210,6 @@ class InstallPathWindow (InstallWindow): spacer = GtkLabel("") spacer.set_usize(60, 1) -### -### msf - 05-11-2000 need to move!!! -### -# InstallPathWindow.fdisk = GtkCheckButton (_("Use fdisk")) -# align.add (InstallPathWindow.fdisk) align = GtkAlignment () align.set (0.0, 0.0, 0.0, 0.0) @@ -240,17 +225,6 @@ class InstallPathWindow (InstallWindow): hbox = GtkHBox (FALSE) - -### -### msf - 05-11-2000 need to move!!! -### -# if not InstallPathWindow.__dict__.has_key("fdisk"): -# fdiskState = 0 -# else: -# fdiskState = InstallPathWindow.fdisk.get_active() -# -# InstallPathWindow.fdisk.set_active(fdiskState) - self.toggled (installButton, INSTALL) self.toggled (self.upgradeButton, UPGRADE) box.set_border_width (5) diff --git a/iw/lilo_gui.py b/iw/lilo_gui.py index 4342cde6a..640af3ab7 100644 --- a/iw/lilo_gui.py +++ b/iw/lilo_gui.py @@ -268,8 +268,7 @@ class LiloWindow (InstallWindow): _("Use linear mode (needed for some SCSI drives)")) self.linearCheck.set_active(self.todo.lilo.getLinear()) - if not edd.detect(): - self.radioBox.attach(self.linearCheck, 0, 2, 4, 5) + self.radioBox.attach(self.linearCheck, 0, 2, 4, 5) if not self.todo.lilo.allowLiloLocationConfig(self.todo.fstab): self.liloLocationBox.set_sensitive(0) diff --git a/iw/rootpartition_gui.py b/iw/rootpartition_gui.py index f145e5ec4..742522a89 100644 --- a/iw/rootpartition_gui.py +++ b/iw/rootpartition_gui.py @@ -371,3 +371,63 @@ class AutoPartitionWindow(InstallWindow): +class LBA32WarningWindow(InstallWindow): + def __init__ (self, ics): + InstallWindow.__init__ (self, ics) + ics.setTitle (_("Boot Partition Location Warning")) + ics.readHTML ("lba32warning") + self.showing = 0 + + def proceedChanged(self, widget, *args): + if self.proceed.get_active(): + self.ics.setNextEnabled (TRUE) + else: + self.ics.setNextEnabled (FALSE) + + def getScreen (self): + + # check if boot partition is above 1023 cyl limit + if iutil.getArch() != "i386": + return INSTALL_NOOP + + if self.todo.fstab.getBootPartitionMaxCyl() > 1023 and not self.todo.fstab.edd: + vbox = GtkVBox (FALSE, 5) + + label = GtkLabel ( + _("You have put the partition containing the kernel (the " + "boot partition) above the 1023 cylinder limit, and " + "it appears that this systems BIOS does not support " + "booting from above this limit. Proceeding will " + "most likely make the system unable to reboot into " + "Linux.\n\n" + "Are you sure you want to proceed?")) + + label.set_usize (400, -1) + label.set_line_wrap (TRUE) + label.set_alignment(0.0, 0.0) + vbox.pack_start (label, FALSE, FALSE) + + vbox2 = GtkVBox (FALSE, 5) + + self.proceed = GtkRadioButton (None, _("Yes")) + self.proceed.connect("toggled", self.proceedChanged) + self.dontproceed = GtkRadioButton (self.proceed, _("No")) + self.dontproceed.set_active() + self.dontproceed.connect("toggled", self.proceedChanged) + + vbox2.pack_start (self.proceed, FALSE) + vbox2.pack_start (self.dontproceed, FALSE) + vbox2.set_border_width (25) + + vbox.pack_start (vbox2, TRUE) + vbox.set_border_width (5) + + self.ics.setNextEnabled (FALSE) + + return vbox + else: + return None + + + + @@ -272,6 +272,14 @@ class LiloConfiguration: bootpart = fstab.getBootDevice() boothd = fstab.getMbrDevice() + useLBA32 = 0 + if self.edd: + from log import log + maxcyl = fstab.getBootPartitionMaxCyl() + if maxcyl > 1023: + log("Using lba32") + useLBA32 = 1 + if (self.liloDevice == "mbr"): liloTarget = boothd elif (type(self.liloDevice) == type((1,)) and @@ -290,7 +298,7 @@ class LiloConfiguration: # # test to see if one of these already in lilo.conf, use if so if not lilo.testEntry('lba32') and not lilo.testEntry('linear'): - if self.edd: + if self.edd and useLBA32: lilo.addEntry("lba32", replace = 0) elif self.liloLinear: lilo.addEntry("linear", replace = 0) @@ -31,6 +31,7 @@ from partitioning_text import AutoPartitionWindow from partitioning_text import PartitionWindow from partitioning_text import TurnOnSwapWindow from partitioning_text import FormatWindow +from partitioning_text import LBA32WarningWindow from packages_text import PackageGroupWindow from packages_text import IndividualPackageWindow from packages_text import PackageDepWindow @@ -630,7 +631,7 @@ class FinishedWindow: rc = ButtonChoiceWindow (screen, _("Complete"), _("Congratulations, installation is complete.\n\n" "Press return to reboot, and be sure to remove your " - "boot medium as the system reboots, or your system " + "boot medium after the system reboots, or your system " "will rerun the install. For information on fixes which " "are available for this release of Red Hat Linux, " "consult the " @@ -1066,6 +1067,8 @@ class InstallInterface: "partition" ], [N_("Swap"), TurnOnSwapWindow, (self.screen, todo), "partition" ], + [N_("Boot Partition Warning"), LBA32WarningWindow, (self.screen, todo), + "lba32warning" ], [N_("Filesystem Formatting"), FormatWindow, (self.screen, todo), "format" ], [BootloaderConfiguration, BootloaderAppendWindow, @@ -1156,6 +1159,8 @@ class InstallInterface: # This is *disgusting* (ewt) if step[1] == UpgradeExamineWindow: rc = apply (step[1](), (dir,) + step[2]) + elif step[1] == LBA32WarningWindow: + rc = apply (step[1](), (dir,) + step[2]) else: rc = apply (step[1](), step[2]) diff --git a/textw/partitioning_text.py b/textw/partitioning_text.py index 714c25b5e..e0230b367 100644 --- a/textw/partitioning_text.py +++ b/textw/partitioning_text.py @@ -341,3 +341,38 @@ class LoopSizeWindow: return INSTALL_NOOP +class LBA32WarningWindow: + def __call__(self, dir, screen, todo): + + if dir == -1: + return INSTALL_NOOP + + # check if boot partition is above 1023 cyl limit + if iutil.getArch() != "i386": + return INSTALL_NOOP + + ButtonChoiceWindow(screen, "", "%s" % todo.fstab.getBootPartitionMaxCyl(), + buttons = [ _("OK") ]) + + if todo.fstab.getBootPartitionMaxCyl() > 1023 and not todo.fstab.edd: + rc = ButtonChoiceWindow(screen, _("Boot Partition Warning"), + _("You have put the partition containing the kernel (the " + "boot partition) above the 1023 cylinder limit, and " + "it appears that this systems BIOS does not support " + "booting from above this limit. Proceeding will " + "most likely make the system unable to reboot into " + "Linux.\n\n" + "Are you sure you want to proceed?"), + [ (_("Yes"), "yes") , (_("No"), "no") ], width = 50, + help = "lba32warning") + + if rc == "no": + return INSTALL_BACK + else: + return INSTALL_OK + else: + return INSTALL_NOOP + + + + |