[rhel6-branch] Use install tree from repo=hd (#818233)

Brian C. Lane bcl at redhat.com
Sat Jul 13 01:20:17 UTC 2013


From: "Brian C. Lane" <bcl at redhat.com>

This adds the ability to use an install tree with repo=hd:... which is
helpful for dd'd DVD iso's on USB drives. The first bit allows storage
to be initialized when a USB device has been skipped because it doesn't
have partitions, just an iso9660 image.

The other part checks the hd: path to see if repodata/repomd.xml exists,
and if so sets that up as the baserepo. Otherwise it falls back to
looking for iso images in the directory as it would normally.

Resolves: rhbz#818233
---
 storage/__init__.py | 3 ++-
 yuminstall.py       | 9 +++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/storage/__init__.py b/storage/__init__.py
index 1e32d9d..a9bbe81 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -94,7 +94,8 @@ def storageInitialize(anaconda, examine_all=True):
         storage.protectedDevSpecs.extend(anaconda.protected)
         storage.reset(examine_all=examine_all)
 
-        if not flags.livecdInstall and not storage.protectedDevices:
+        if not flags.livecdInstall and not storage.protectedDevices and \
+          not anaconda.protected:
             if anaconda.id.getUpgrade():
                 return
             else:
diff --git a/yuminstall.py b/yuminstall.py
index ea3e496..08ed4b8 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -476,9 +476,18 @@ class AnacondaYum(YumSorter):
             if m.startswith("hd:"):
                 if m.count(":") == 2:
                     (device, path) = m[3:].split(":")
+                    fstype = "auto"
                 else:
                     (device, fstype, path) = m[3:].split(":")
 
+                # First check for an installable tree
+                isys.mount(device, self.tree, fstype=fstype)
+                if os.path.exists("%s/%s/repodata/repomd.xml" % (self.tree, path)):
+                    self._baseRepoURL = "file://%s/%s" % (self.tree, path)
+                    return
+                isys.umount(self.tree, removeDir=False)
+
+                # Look for .iso images
                 self.isodir = "/mnt/isodir/%s" % path
 
                 # This takes care of mounting /mnt/isodir first.
-- 
1.8.3.1



More information about the anaconda-patches mailing list