summaryrefslogtreecommitdiffstats
path: root/storage/__init__.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2009-03-18 17:01:12 -0400
committerChris Lumens <clumens@redhat.com>2009-03-23 13:46:12 -0400
commit47dcbbcaaa1f5e026de61df887143fa119ed5da2 (patch)
tree2840cd038c3e068ce3adad001dd24f863283d3b4 /storage/__init__.py
parente08ace84f10b9eb9acb6d71326359ce42ff69477 (diff)
downloadanaconda-47dcbbcaaa1f5e026de61df887143fa119ed5da2.tar.gz
anaconda-47dcbbcaaa1f5e026de61df887143fa119ed5da2.tar.xz
anaconda-47dcbbcaaa1f5e026de61df887143fa119ed5da2.zip
Add a fake device for bind mounting /dev.
Diffstat (limited to 'storage/__init__.py')
-rw-r--r--storage/__init__.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/storage/__init__.py b/storage/__init__.py
index 0600268d1..526500ae8 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -1120,6 +1120,7 @@ class FSSet(object):
self.cryptTab = None
self.blkidTab = None
self.active = False
+ self._dev = None
self._devpts = None
self._sysfs = None
self._proc = None
@@ -1134,6 +1135,17 @@ class FSSet(object):
return self._sysfs
@property
+ def dev(self):
+ if not self._dev:
+ self._dev = DirectoryDevice("/dev", format=getFormat("bind",
+ device="/dev",
+ mountpoint="/dev",
+ exists=True),
+ exists=True)
+
+ return self._dev
+
+ @property
def devpts(self):
if not self._devpts:
self._devpts = NoDevice(format=getFormat("devpts",
@@ -1397,8 +1409,9 @@ class FSSet(object):
skipRoot=False):
intf = anaconda.intf
devices = self.mountpoints.values() + self.swapDevices
- devices.extend([self.devshm, self.devpts, self.sysfs, self.proc])
+ devices.extend([self.dev, self.devshm, self.devpts, self.sysfs, self.proc])
devices.sort(key=lambda d: getattr(d.format, "mountpoint", None))
+
for device in devices:
if not device.format.mountable or not device.format.mountpoint:
continue
@@ -1486,12 +1499,8 @@ class FSSet(object):
self.active = True
def umountFilesystems(self, instPath, ignoreErrors=True, swapoff=True):
- # XXX if we tracked the /dev bind mount this wouln't be necessary
- if os.path.ismount("%s/dev" % instPath):
- isys.umount("%s/dev" % instPath, removeDir=False)
-
devices = self.mountpoints.values() + self.swapDevices
- devices.extend([self.devshm, self.devpts, self.sysfs, self.proc])
+ devices.extend([self.dev, self.devshm, self.devpts, self.sysfs, self.proc])
devices.sort(key=lambda d: getattr(d.format, "mountpoint", None))
devices.reverse()
for device in devices: