summaryrefslogtreecommitdiffstats
path: root/image.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2008-07-09 15:12:05 -0400
committerChris Lumens <clumens@redhat.com>2008-07-09 15:12:05 -0400
commit158334437e70d9d889e9954cb481dcec7fd00741 (patch)
tree600607e4311b8c44dc5de2f45268999c363c5e57 /image.py
parent46b1409314abee674cbc51c9c64a0663d928dff2 (diff)
downloadanaconda-158334437e70d9d889e9954cb481dcec7fd00741.tar.gz
anaconda-158334437e70d9d889e9954cb481dcec7fd00741.tar.xz
anaconda-158334437e70d9d889e9954cb481dcec7fd00741.zip
Reorganize to make it easier to reset the "base" repository.
This has the side effect of making it possible to switch from a URL installation repo to a CD and back during stage2.
Diffstat (limited to 'image.py')
-rw-r--r--image.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/image.py b/image.py
index 45779ef21..4c3708b6e 100644
--- a/image.py
+++ b/image.py
@@ -242,6 +242,27 @@ def presentRequiredMediaMessage(anaconda):
type="custom", custom_icon="warning",
custom_buttons=[_("_Reboot"), _("_Back"), _("_Continue")])
+# Find an attached CD/DVD drive with media in it that contains packages,
+# and return that device name.
+def scanForMedia(tree):
+ drive = None
+
+ for cdr in map(lambda d: "/dev/%s" % d, isys.cdromList()):
+ try:
+ if isys.mount(cdr, tree, fstype="iso9660", readOnly=1):
+ continue
+ except:
+ continue
+
+ if not verifyMedia(tree, 1):
+ isys.umount(tree)
+ continue
+
+ drive = cdr
+ break
+
+ return drive
+
def umountImage(tree, currentMedia):
if currentMedia is not None:
isys.umount(tree, removeDir=0)