summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2009-03-24 10:55:47 -0400
committerChris Lumens <clumens@redhat.com>2009-03-24 10:55:47 -0400
commit49933eafe930a8b55db4d1eb7fd9701d79332a3a (patch)
tree3d528dcf469b0c935ec1fb782bbbd69088c930e9
parented2883f06e20d2beda75e1f3fbdb5b827c31a9b0 (diff)
downloadanaconda-49933eafe930a8b55db4d1eb7fd9701d79332a3a.tar.gz
anaconda-49933eafe930a8b55db4d1eb7fd9701d79332a3a.tar.xz
anaconda-49933eafe930a8b55db4d1eb7fd9701d79332a3a.zip
Move protectedPartition setup into storageInitialize (#491781).
-rw-r--r--instdata.py25
-rw-r--r--storage/__init__.py31
2 files changed, 29 insertions, 27 deletions
diff --git a/instdata.py b/instdata.py
index e9a66245d..0b6df52f6 100644
--- a/instdata.py
+++ b/instdata.py
@@ -88,31 +88,6 @@ class InstallData:
# XXX I still expect this to die when kickstart is the data store.
self.ksdata = None
- # We don't have install methods anymore, but put things that depend on
- # the methodstr here.
- if os.path.exists("/dev/live") and \
- stat.S_ISBLK(os.stat("/dev/live")[stat.ST_MODE]):
- target = os.readlink("/dev/live")
- self.storage.protectedPartitions = [target]
- elif self.anaconda.methodstr and self.anaconda.methodstr.startswith("hd:"):
- method = self.anaconda.methodstr[3:]
- devspec = method.split(":", 3)[0]
-
- # XXX might as well move resolveDevice into DeviceTree
- device = storage.resolveDevice(self.storage.devicetree, devspec)
- if device is None:
- if self.getUpgrade():
- return
- else:
- self.anaconda.intf.messageWindow(_("Unknown Device"),
- _("The installation source given by device %s "
- "could not be found. Please check your "
- "parameters and try again.") % device,
- type="custom", custom_buttons = [_("_Exit installer")])
- sys.exit(1)
-
- self.storage.protectedPartitions = [device.name]
-
def setInstallProgressClass(self, c):
self.instProgress = c
diff --git a/storage/__init__.py b/storage/__init__.py
index 3c1394c73..9532f8830 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -54,14 +54,41 @@ import logging
log = logging.getLogger("storage")
def storageInitialize(anaconda):
- anaconda.id.storage.shutdown()
+ storage = anaconda.id.storage
+
+ storage.shutdown()
if anaconda.dir == DISPATCH_BACK:
return
# XXX I don't understand why I have to do this
udev_trigger(subsystem="block")
- anaconda.id.storage.reset()
+
+ # Set up the protected partitions list now.
+ if os.path.exists("/dev/live") and \
+ stat.S_ISBLK(os.stat("/dev/live")[stat.ST_MODE]):
+ target = os.readlink("/dev/live")
+ storage.protectedPartitions = [target]
+ elif anaconda.methodstr and anaconda.methodstr.startswith("hd:"):
+ method = anaconda.methodstr[3:]
+ devspec = method.split(":", 3)[0]
+
+ # XXX might as well move resolveDevice into DeviceTree
+ device = storage.resolveDevice(storage.devicetree, devspec)
+ if device is None:
+ if self.getUpgrade():
+ return
+ else:
+ anaconda.intf.messageWindow(_("Unknown Device"),
+ _("The installation source given by device %s "
+ "could not be found. Please check your "
+ "parameters and try again.") % devspec,
+ type="custom", custom_buttons = [_("_Exit installer")])
+ sys.exit(1)
+
+ storage.protectedPartitions = [device.name]
+
+ storage.reset()
# dispatch.py helper function
def storageComplete(anaconda):