Handle the new udev world; don't try and make devices. Adjust calls as necessary.
--- anaconda | 12 ------ dmraid.py | 6 +-- fsset.py | 32 +++-------------- image.py | 2 - installmethod.py | 2 +- isys/dasd.c | 1 - isys/eddsupport.c | 7 +--- isys/isys.py | 100 ++++++++++++----------------------------------------- partedUtils.py | 27 ++++++-------- partitions.py | 7 +--- raid.py | 3 +- 11 files changed, 46 insertions(+), 153 deletions(-) diff --git a/anaconda b/anaconda index 79a619a..4bbdfc5 100755 --- a/anaconda +++ b/anaconda @@ -667,9 +667,6 @@ if __name__ == "__main__": import rescue, instdata - iutil.makeDriveDeviceNodes() - iutil.makeCharDeviceNodes() - anaconda.id = instdata.InstallData(anaconda, [], anaconda.methodstr, opts.display_mode) rescue.runRescue(anaconda, instClass) @@ -730,11 +727,6 @@ if __name__ == "__main__": checkMemory(opts) - # create character device nodes if we're not running in test mode - have - # to do this early sine it's used for Synaptics, etc. - if not flags.test: - iutil.makeCharDeviceNodes() - # this lets install classes force text mode instlls if instClass.forceTextMode: stdoutLog.info(_("Install class forcing text mode installation")) @@ -841,10 +833,6 @@ if __name__ == "__main__": else: anaconda.intf.messageWindow("Unknown monitor", msg) - # create device nodes for detected devices if we're not running in test mode - if not flags.test and flags.setupFilesystems: - iutil.makeDriveDeviceNodes() - # imports after setting up the path if anaconda.methodstr: anaconda.setMethod(instClass) diff --git a/dmraid.py b/dmraid.py index 82f5f8e..95cc6b2 100644 --- a/dmraid.py +++ b/dmraid.py @@ -122,8 +122,7 @@ def scanForRaid(drives, degradedOk=False): probeDrives = [] for d in drives: - dp = isys.makeDevInode(d) - probeDrives.append(dp) + probeDrives.append(d) dmsets = [] def nonDegraded(rs): @@ -237,8 +236,7 @@ def scanForMPath(drives): probeDrives = [] for d in drives: - dp = isys.makeDevInode(d) - probeDrives.append(dp) + probeDrives.append(d) import block as _block oldPath = _block.getBdevidPath() diff --git a/fsset.py b/fsset.py index 5dee46f..ec03c97 100644 --- a/fsset.py +++ b/fsset.py @@ -552,8 +552,6 @@ class extFileSystem(FileSystemType): def getMinimumSize(self, device): """Return the minimum filesystem size in megabytes""" devicePath = "/dev/%s" % (device,) - if not os.path.exists(devicePath): - isys.makeDevInode(device, devicePath) # FIXME: it'd be nice if we didn't have to parse this out ourselves buf = iutil.execWithCapture("dumpe2fs", @@ -634,7 +632,7 @@ class extFileSystem(FileSystemType): devicePath = entry.device.setupDevice(chroot) # if no journal, don't turn off the fsck - if not isys.ext2HasJournal(devicePath, makeDevNode = 0): + if not isys.ext2HasJournal(devicePath): return rc = iutil.execWithRedirect("tune2fs", @@ -661,7 +659,7 @@ class ext2FileSystem(extFileSystem): "than ext3") # if journal already exists skip - if isys.ext2HasJournal(devicePath, makeDevNode = 0): + if isys.ext2HasJournal(devicePath): log.info("Skipping migration of %s, has a journal already. " % devicePath) return @@ -676,7 +674,7 @@ class ext2FileSystem(extFileSystem): # XXX this should never happen, but appears to have done # so several times based on reports in bugzilla. # At least we can avoid leaving them with a system which won't boot - if not isys.ext2HasJournal(devicePath, makeDevNode = 0): + if not isys.ext2HasJournal(devicePath): log.warning("Migration of %s attempted but no journal exists after " "running tune2fs. " % (devicePath)) if message: @@ -965,8 +963,6 @@ class NTFSFileSystem(FileSystemType): def getMinimumSize(self, device): """Return the minimum filesystem size in megabytes""" devicePath = "/dev/%s" % (device,) - if not os.path.exists(devicePath): - isys.makeDevInode(device, devicePath) buf = iutil.execWithCapture("ntfsresize", ["--info", devicePath], stderr = "/dev/tty5") @@ -1420,8 +1416,6 @@ MAILADDR root def mkDevRoot(self, instPath): root = self.getEntryByMountPoint("/") dev = "%s/dev/%s" % (instPath, root.device.getDevice()) - if not os.path.exists(dev): - isys.makeDevInode(root.device.getDevice(), dev) rdev = os.stat(dev).st_rdev if not os.path.exists("%s/dev/root" %(instPath,)): @@ -2202,7 +2196,7 @@ class Device: def getLabel(self): try: - return isys.readFSLabel(self.setupDevice(), makeDevNode = 0) + return isys.readFSLabel(self.setupDevice()) except: return "" @@ -2232,7 +2226,6 @@ class DevDevice(Device): def setupDevice(self, chroot='/', devPrefix='/dev'): #We use precreated device but we have to make sure that the device exists path = '/dev/%s' % (self.getDevice(),) - isys.makeDevInode(self.getDevice(), path) return path class RAIDDevice(Device): @@ -2353,9 +2346,6 @@ class RAIDDevice(Device): def devify(x): return "/dev/%s" %(x,) - node = "%s/%s" % (devPrefix, self.device) - isys.makeDevInode(self.device, node) - if not self.isSetup: for device in self.members: pd = PartitionDevice(device) @@ -2500,7 +2490,6 @@ class PartitionDevice(Device): def setupDevice(self, chroot="/", devPrefix='/dev'): path = '%s/%s' % (devPrefix, self.device) - isys.makeDevInode(self.device, path) if self.crypto: self.crypto.formatDevice() self.crypto.openDevice() @@ -2584,7 +2573,6 @@ class LoopbackDevice(Device): path = '%s/%s' % (devPrefix, self.getDevice()) else: path = '%s/%s' % (devPrefix, self.getDevice()) - isys.makeDevInode(self.getDevice(), path) path = os.path.normpath(path) return path @@ -2760,11 +2748,7 @@ def getDevFD(device): try: fd = os.open(device, os.O_RDONLY) except: - try: - file = isys.makeDevInode(device) - fd = os.open(file, os.O_RDONLY) - except: - return -1 + return -1 return fd def isValidExt2(device): @@ -2867,11 +2851,7 @@ def getFStoTry(device): rc.append("jfs") if isValidExt2(device): - if os.access(device, os.O_RDONLY): - create = 0 - else: - create = 1 - if isys.ext2HasJournal(device, makeDevNode = create): + if isys.ext2HasJournal(device): rc.append("ext3") rc.append("ext2") diff --git a/image.py b/image.py index 5cfaa54..4089ba1 100644 --- a/image.py +++ b/image.py @@ -269,8 +269,6 @@ class CdromInstallMethod(ImageInstallMethod): needed in discNum): done = 1 self.currentMedia = discNum - # make /tmp/cdrom again so cd gets ejected - isys.makeDevInode(self.device, "/tmp/cdrom") if not done: self.messageWindow(_("Wrong Disc"), diff --git a/installmethod.py b/installmethod.py index 368b018..914fdc9 100644 --- a/installmethod.py +++ b/installmethod.py @@ -86,7 +86,7 @@ def doMethodComplete(anaconda): anaconda.method.filesDone() if not anaconda.isKickstart: - isys.ejectCdrom(anaconda.method.device, makeDevice=1) + isys.ejectCdrom(anaconda.method.device) mtab = "/dev/root / ext3 ro 0 0 " for ent in anaconda.id.fsset.entries: diff --git a/isys/dasd.c b/isys/dasd.c index a32d031..74a679e 100644 --- a/isys/dasd.c +++ b/isys/dasd.c @@ -58,7 +58,6 @@ int isUsableDasd(char *device) { memset(&dasd_info, 0, sizeof(dasd_info)); strcpy(devname, "/dev/"); strcat(devname, device); - devMakeInode(device, devname); if ((f = open(devname, O_RDONLY)) == -1) return 0; diff --git a/isys/eddsupport.c b/isys/eddsupport.c index 230bf06..7d3698b 100644 --- a/isys/eddsupport.c +++ b/isys/eddsupport.c @@ -103,11 +103,7 @@ static struct device ** createDiskList(){ static int readDiskSig(char *device, uint32_t *disksig) { int fd, rc; - if (devMakeInode(device, "/tmp/biosdev")){ - return -1; - } - - fd = open("/tmp/biosdev", O_RDONLY); + fd = open(device, O_RDONLY); if (fd < 0) { #ifdef STANDALONE fprintf(stderr, "Error opening device %s: %s ", device, @@ -138,7 +134,6 @@ static int readDiskSig(char *device, uint32_t *disksig) { } close(fd); - unlink("/tmp/biosdev"); return 0; } diff --git a/isys/isys.py b/isys/isys.py index c36febf..663bc1b 100755 --- a/isys/isys.py +++ b/isys/isys.py @@ -150,7 +150,6 @@ def raidstop(mdDevice): devInode = "/dev/%s" % mdDevice - makeDevInode(mdDevice, devInode) try: _stopRaid(devInode) except: @@ -177,9 +176,6 @@ def raidstart(mdDevice, aMember): mdInode = "/dev/%s" % mdDevice mbrInode = "/dev/%s" % aMember - makeDevInode(mdDevice, mdInode) - makeDevInode(aMember, mbrInode) - minor = os.minor(os.stat(mdInode).st_rdev) try: info = _getRaidInfo(mbrInode) @@ -209,7 +205,6 @@ def wipeRaidSB(device): # need to exist to begin with. # @return A RAID superblock in its raw on-disk format. def raidsb(mdDevice): - makeDevInode(mdDevice, "/dev/%s" % mdDevice) return raidsbFromDevice("/dev/%s" % mdDevice) ## Get the superblock from a RAID device. @@ -311,14 +306,6 @@ def mount(device, location, fstype = "ext2", readOnly = 0, bindMount = 0, remoun # mount without making a device node. If that still fails, the caller # will have to deal with the exception. # We note whether or not we created a node so we can clean up later. - createdNode = 0 - if device and device != "none" and device[0] != "/": - - try: - makeDevInode (device) - createdNode = 1 - except SystemError: - pass if mountCount.has_key(location) and mountCount[location] > 0: mountCount[location] = mountCount[location] + 1 @@ -330,10 +317,6 @@ def mount(device, location, fstype = "ext2", readOnly = 0, bindMount = 0, remoun if not rc: mountCount[location] = 1 - # did we create a node, if so remove - if createdNode: - os.unlink(device) - return rc ## Unmount a filesystem, similar to the umount system call. @@ -768,13 +751,8 @@ def _readXFSLabel_int(device): return xfslabel -def readXFSLabel(device, makeDevNode = 1): - if makeDevNode: - makeDevInode(device, "/tmp/disk") - label = _readXFSLabel_int("/tmp/disk") - os.unlink("/tmp/disk") - else: - label = _readXFSLabel_int(device) +def readXFSLabel(device): + label = _readXFSLabel_int(device) return label def _readJFSLabel_int(device): @@ -801,13 +779,8 @@ def _readJFSLabel_int(device): return jfslabel -def readJFSLabel(device, makeDevNode = 1): - if makeDevNode: - makeDevInode(device, "/tmp/disk") - label = _readJFSLabel_int("/tmp/disk") - os.unlink("/tmp/disk") - else: - label = _readJFSLabel_int(device) +def readJFSLabel(device): + label = _readJFSLabel_int(device) return label def _readSwapLabel_int(device): @@ -833,22 +806,12 @@ def _readSwapLabel_int(device): label = string.rstrip(buf[1052:1068], " |