summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2007-12-06 17:19:06 -0500
committerBill Nottingham <notting@redhat.com>2007-12-07 13:27:43 -0500
commited7c89428ab7a5dfec6c6e9f7add0e2c20ae644d (patch)
tree2ba78909498d92d3024605eec38f22fe93dab225
parent5863d19efb90b03fc2e3b59500586c4e8083d6b6 (diff)
downloadanaconda-ed7c89428ab7a5dfec6c6e9f7add0e2c20ae644d.tar.gz
anaconda-ed7c89428ab7a5dfec6c6e9f7add0e2c20ae644d.tar.xz
anaconda-ed7c89428ab7a5dfec6c6e9f7add0e2c20ae644d.zip
Don't try and make devices. Adjust calls as necessary.
-rwxr-xr-xanaconda12
-rw-r--r--dmraid.py6
-rw-r--r--fsset.py20
-rw-r--r--installmethod.py2
-rw-r--r--isys/dasd.c1
-rw-r--r--isys/eddsupport.c7
-rwxr-xr-xisys/isys.py47
-rw-r--r--partedUtils.py29
-rw-r--r--partitions.py7
-rw-r--r--raid.py3
10 files changed, 26 insertions, 108 deletions
diff --git a/anaconda b/anaconda
index bca8c5ef7..9503d4959 100755
--- a/anaconda
+++ b/anaconda
@@ -719,9 +719,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)
@@ -782,11 +779,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"))
@@ -891,10 +883,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()
-
anaconda.setBackend(instClass)
anaconda.id = instClass.installDataClass(anaconda, extraModules, anaconda.methodstr, opts.display_mode, anaconda.backend)
diff --git a/dmraid.py b/dmraid.py
index 82f5f8e36..95cc6b2e4 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 518aa344d..30e660e38 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.\n" % 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.\n" % (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
diff --git a/installmethod.py b/installmethod.py
index f47e6fa9d..d1cf8bdc8 100644
--- a/installmethod.py
+++ b/installmethod.py
@@ -39,7 +39,7 @@ def doMethodComplete(anaconda):
pass
if not anaconda.isKickstart and anaconda.mediaDevice:
- isys.ejectCdrom(anaconda.mediaDevice, makeDevice=1)
+ isys.ejectCdrom(anaconda.mediaDevice)
mtab = "/dev/root / ext3 ro 0 0\n"
for ent in anaconda.id.fsset.entries:
diff --git a/isys/dasd.c b/isys/dasd.c
index a32d03167..74a679e91 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 230bf0625..7d3698b39 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\n ", 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 170d5e126..9c53e0ee9 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.
@@ -430,7 +413,6 @@ def driveDict(klassArg):
continue
try:
devName = "/dev/%s" % (device,)
- makeDevInode(device, devName)
if not mediaPresent (device):
new[device] = dev
@@ -745,13 +727,8 @@ def dhcpNetDevice(device):
return _isys.dhcpnetdevice(devname, v4, v4method, v6, v6method, klass)
-def readFSLabel(device, makeDevNode = 1):
- if makeDevNode:
- makeDevInode(device, "/tmp/disk")
- device = "/tmp/disk"
+def readFSLabel(device):
label = _isys.getblkid(device, "LABEL")
- if makeDevNode:
- os.unlink("/tmp/disk")
return label
def readFSType(device):
@@ -780,7 +757,7 @@ def readFSType(device):
return "physical volume (LVM)"
return fstype
-def ext2Clobber(device, makeDevNode = 1):
+def ext2Clobber(device):
_isys.e2fsclobber(device)
def ext2IsDirty(device):
@@ -789,21 +766,12 @@ def ext2IsDirty(device):
os.unlink("/tmp/disk")
return label
-def ext2HasJournal(device, makeDevNode = 1):
- if makeDevNode:
- makeDevInode(device, "/tmp/disk")
- hasjournal = _isys.e2hasjournal("/tmp/disk");
- os.unlink("/tmp/disk")
- else:
- hasjournal = _isys.e2hasjournal(device);
+def ext2HasJournal(device):
+ hasjournal = _isys.e2hasjournal(device);
return hasjournal
-def ejectCdrom(device, makeDevice = 1):
- if makeDevice:
- makeDevInode(device, "/tmp/cdrom")
- fd = os.open("/tmp/cdrom", os.O_RDONLY|os.O_NONBLOCK)
- else:
- fd = os.open(device, os.O_RDONLY|os.O_NONBLOCK)
+def ejectCdrom(device):
+ fd = os.open(device, os.O_RDONLY|os.O_NONBLOCK)
# this is a best effort
try:
@@ -814,9 +782,6 @@ def ejectCdrom(device, makeDevice = 1):
os.close(fd)
- if makeDevice:
- os.unlink("/tmp/cdrom")
-
def driveUsesModule(device, modules):
"""Returns true if a drive is using a prticular module. Only works
for SCSI devices right now."""
diff --git a/partedUtils.py b/partedUtils.py
index 57f1edabe..e99fd0278 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -457,14 +457,8 @@ def isLinuxNativeByNumtype(numtype):
def sniffFilesystemType(device):
"""Sniff to determine the type of fs on device.
- device - name of device to sniff. we try to create it if it doesn't exist.
+ device - name of device to sniff.
"""
-
- if os.access(device, os.O_RDONLY):
- dev = device
- else:
- dev = isys.makeDevInode(device)
-
return isys.readFSType(device)
def getReleaseString(mountpoint):
@@ -708,7 +702,7 @@ class DiskSet:
if lvorigin:
continue
node = "%s/%s" % (vg, lv)
- label = isys.readFSLabel("/dev/" + node, makeDevNode=0)
+ label = isys.readFSLabel("/dev/" + node)
if label:
labels[node] = label
@@ -747,7 +741,7 @@ class DiskSet:
if ((upgradeany == 1) or
(productMatches(relstr, productName))):
try:
- label = isys.readFSLabel(dev, makeDevNode=0)
+ label = isys.readFSLabel(dev)
except:
label = None
@@ -779,7 +773,7 @@ class DiskSet:
if ((upgradeany == 1) or
(productMatches(relstr, productName))):
try:
- label = isys.readFSLabel(dev, makeDevNode=0)
+ label = isys.readFSLabel(dev)
except:
label = None
@@ -827,7 +821,7 @@ class DiskSet:
if ((upgradeany == 1) or
(productMatches(relstr, productName))):
try:
- label = isys.readFSLabel("/dev/%s" % node, makeDevNode=0)
+ label = isys.readFSLabel("/dev/%s" % node)
except:
label = None
@@ -920,10 +914,6 @@ class DiskSet:
w = self.anaconda.intf.progressWindow (_("Initializing"),
_("Please wait while formatting drive %s...\n"
) % (drive,), 100)
- try:
- dev = isys.makeDevInode(drive)
- except:
- pass
argList = [ "/sbin/dasdfmt",
"-y",
@@ -932,7 +922,7 @@ class DiskSet:
"-F",
"-P",
"-f",
- dev]
+ "/dev/%s" % (dev,)]
fd = os.open("/dev/null", os.O_RDWR | os.O_CREAT | os.O_APPEND)
p = os.pipe()
@@ -1044,7 +1034,7 @@ class DiskSet:
def _labelDevice(self, drive):
log.info("Reinitializing label for drive %s" % (drive,))
- deviceFile = isys.makeDevInode(drive, "/dev/" + drive)
+ deviceFile = "/dev/" + drive
try:
try:
@@ -1095,7 +1085,6 @@ class DiskSet:
drive not in DiskSet.exclusiveDisks:
continue
- deviceFile = isys.makeDevInode(drive, "/dev/" + drive)
if not isys.mediaPresent(drive):
DiskSet.skippedDisks.append(drive)
continue
@@ -1106,7 +1095,7 @@ class DiskSet:
if self.initializedDisks.has_key(drive):
if not self.disks.has_key(drive):
try:
- dev = parted.PedDevice.get(deviceFile)
+ dev = parted.PedDevice.get("/dev/%s" % (drive,))
disk = parted.PedDisk.new(dev)
self._addDisk(drive, disk)
except parted.error, msg:
@@ -1145,7 +1134,7 @@ class DiskSet:
try:
if not dev:
- dev = parted.PedDevice.get(deviceFile)
+ dev = parted.PedDevice.get("/dev/%s" % (drive,))
disk = None
except parted.error, msg:
log.debug("parted error: %s" % (msg,))
diff --git a/partitions.py b/partitions.py
index a2de28971..2b399d12b 100644
--- a/partitions.py
+++ b/partitions.py
@@ -69,9 +69,6 @@ def partitionObjectsInitialize(anaconda):
anaconda.id.partitions.setFromDisk(anaconda.id.diskset)
anaconda.id.partitions.setProtected(anaconda.dispatch)
- # make sure we have all the device nodes we'll want
- iutil.makeDriveDeviceNodes()
-
# dispatch.py helper function
def partitioningComplete(anaconda):
if anaconda.dir == DISPATCH_BACK and anaconda.id.fsset.isActive():
@@ -266,7 +263,7 @@ class Partitions:
else:
fsystem = fsset.fileSystemTypeGet(fs)
try:
- fslabel = isys.readFSLabel(theDev, makeDevNode=0)
+ fslabel = isys.readFSLabel(theDev)
except:
fslabel = None
@@ -336,7 +333,7 @@ class Partitions:
else:
fsystem = fsset.fileSystemTypeGet(fs)
try:
- fslabel = isys.readFSLabel(theDev, makeDevNode=0)
+ fslabel = isys.readFSLabel(theDev)
except:
fslabel = None
diff --git a/raid.py b/raid.py
index 73842dafc..990aeee9b 100644
--- a/raid.py
+++ b/raid.py
@@ -65,9 +65,8 @@ def scanForRaid(drives):
for d in drives:
parts = []
- dp = isys.makeDevInode(d)
try:
- dev = parted.PedDevice.get(dp)
+ dev = parted.PedDevice.get(d)
disk = parted.PedDisk.new(dev)
raidParts = partedUtils.get_raid_partitions(disk)