diff options
author | Erik Troan <ewt@redhat.com> | 2000-06-18 16:58:56 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 2000-06-18 16:58:56 +0000 |
commit | 0607c025bebd8e7020959639f1f26f7eb1f99223 (patch) | |
tree | 0e0b74601e23f13d984b76911b5fb263af03e580 | |
parent | 097ac8a87977c7f42e603c5776bc1f4bd9cd3549 (diff) | |
download | anaconda-0607c025bebd8e7020959639f1f26f7eb1f99223.tar.gz anaconda-0607c025bebd8e7020959639f1f26f7eb1f99223.tar.xz anaconda-0607c025bebd8e7020959639f1f26f7eb1f99223.zip |
support alternate floppy devices (gulp)
-rwxr-xr-x | anaconda | 3 | ||||
-rw-r--r-- | fstab.py | 10 | ||||
-rw-r--r-- | todo.py | 50 |
3 files changed, 51 insertions, 12 deletions
@@ -443,8 +443,7 @@ except: intf.__del__ () os._exit(1) - todo.setFdDevice() - device = todo.fdDevice[5:] + device = todo.fdDevice file = "/tmp/floppy" isys.makeDevInode(device, file) try: @@ -666,7 +666,7 @@ class Fstab: isys.mount('/proc', instPath + '/proc', 'proc') - def write(self, prefix, fdDevice = "/dev/fd0"): + def write(self, prefix, fdDevice = None): format = "%-23s %-23s %-7s %-15s %d %d\n"; f = open (prefix + "/etc/fstab", "w") @@ -696,9 +696,13 @@ class Fstab: f.write (format % ( devName, mntpoint, fs, 'noauto,owner', 0, 0)) else: f.write (format % ( devName, mntpoint, fs, 'defaults', 0, 0)) - f.write (format % (fdDevice, "/mnt/floppy", 'auto', 'noauto,owner', 0, 0)) + if fdDevice: + f.write (format % ("/dev/" + fdDevice, "/mnt/floppy", 'auto', + 'noauto,owner', 0, 0)) + f.write (format % ("none", "/proc", 'proc', 'defaults', 0, 0)) - f.write (format % ("none", "/dev/pts", 'devpts', 'gid=5,mode=620', 0, 0)) + f.write (format % ("none", "/dev/pts", 'devpts', 'gid=5,mode=620', + 0, 0)) if self.loopbackSwapSize: f.write(format % ("/initrd/loopfs/rh-swap.img", 'swap', @@ -341,6 +341,7 @@ class ToDo: self.expert = expert self.progressWindow = None self.fdDevice = None + self.setFdDevice() if (not instClass): raise TypeError, "installation class expected" if x: @@ -355,15 +356,53 @@ class ToDo: def setFdDevice(self): if self.fdDevice: return - self.fdDevice = "/dev/fd0" + + self.fdDevice = "fd0" if iutil.getArch() == "sparc": try: f = open(self.fdDevice, "r") except IOError, (errnum, msg): if errno.errorcode[errnum] == 'ENXIO': - self.fdDevice = "/dev/fd1" + self.fdDevice = "fd1" else: f.close() + elif iutil.getArch() == "alpha": + pass + elif iutil.getArch() == "ia64": + fdDevice = "hda" + elif iutil.getArch() == "i386": + # Look for the first IDE floppy device + drives = isys.hardDriveDict().keys() + + # We don't need to be picky about sort order as we toss + # items that aren't hd* anyway + drives.sort() + floppyDrive = None + for drive in drives: + if drives[0:2] != 'hd': continue + f = open("/proc/ide/%s/media" % floppyDevice, "r") + type = f.readline() + f.close() + if type == "floppy\n": + floppyDrive = drive + break + + # No IDE floppy's -- we're fine w/ /dev/fd0 + if not floppyDrive: return + + # Look in syslog for a real fd0 (which would take precedence) + f = open("/tmp/syslog", "r") + for line in f.readlines(): + # chop off the loglevel (which init's syslog leaves behind) + line = line[1:] + match = "Floppy drive(s): " + if match == line[:len(match)]: + # Good enough + return + + self.fdDevice = "%s" % floppyDevice + else: + raise SystemError, "cannot determine floppy device for this arch" def writeTimezone(self): if (self.timezone): @@ -428,8 +467,7 @@ class ToDo: def makeBootdisk (self): # this is faster then waiting on mkbootdisk to fail - self.setFdDevice() - device = self.fdDevice[5:] + device = self.fdDevice file = "/tmp/floppy" isys.makeDevInode(device, file) try: @@ -442,12 +480,11 @@ class ToDo: kernelTag = "-%s-%s" % (kernel['version'], kernel['release']) w = self.intf.waitWindow (_("Creating"), _("Creating boot disk...")) - self.setFdDevice () rc = iutil.execWithRedirect("/sbin/mkbootdisk", [ "/sbin/mkbootdisk", "--noprompt", "--device", - self.fdDevice, + "/dev/" + self.fdDevice, kernelTag[1:] ], stdout = None, stderr = None, searchPath = 1, root = self.instPath) @@ -1413,7 +1450,6 @@ class ToDo: self.createRemovable("zip") self.createRemovable("jaz") self.copyExtraModules() - self.setFdDevice() self.fstab.write (self.instPath, fdDevice = self.fdDevice) self.writeConfiguration () self.writeDesktop () |