summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2000-06-18 16:58:56 +0000
committerErik Troan <ewt@redhat.com>2000-06-18 16:58:56 +0000
commit0607c025bebd8e7020959639f1f26f7eb1f99223 (patch)
tree0e0b74601e23f13d984b76911b5fb263af03e580
parent097ac8a87977c7f42e603c5776bc1f4bd9cd3549 (diff)
downloadanaconda-0607c025bebd8e7020959639f1f26f7eb1f99223.tar.gz
anaconda-0607c025bebd8e7020959639f1f26f7eb1f99223.tar.xz
anaconda-0607c025bebd8e7020959639f1f26f7eb1f99223.zip
support alternate floppy devices (gulp)
-rwxr-xr-xanaconda3
-rw-r--r--fstab.py10
-rw-r--r--todo.py50
3 files changed, 51 insertions, 12 deletions
diff --git a/anaconda b/anaconda
index 527256088..6cd389729 100755
--- a/anaconda
+++ b/anaconda
@@ -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:
diff --git a/fstab.py b/fstab.py
index 753d3cb4b..e5de74285 100644
--- a/fstab.py
+++ b/fstab.py
@@ -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',
diff --git a/todo.py b/todo.py
index cb1756f0b..9abd99e85 100644
--- a/todo.py
+++ b/todo.py
@@ -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 ()