[PATCH 2/3] Fix initramfs generation for disk image installations. (#1018925)

David Lehman dlehman at redhat.com
Mon Oct 14 17:41:03 UTC 2013


Host-only makes no sense for this use case. Similarly, we have to tell
dracut to maintain references to block devices using /dev/disk/by-uuid/
symlinks instead of resolving them to paths in the installation runtime
since the disk names during installation will never match those in the
installed system.
---
 pyanaconda/packaging/__init__.py | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py
index 7b602ab..26488f1 100644
--- a/pyanaconda/packaging/__init__.py
+++ b/pyanaconda/packaging/__init__.py
@@ -581,10 +581,21 @@ class Payload(object):
 
         for kernel in self.kernelVersionList:
             log.info("recreating initrd for %s", kernel)
-            iutil.execWithRedirect("new-kernel-pkg",
-                                   ["--mkinitrd", "--dracut",
-                                    "--depmod", "--update", kernel],
-                                   root=ROOT_PATH)
+            if not flags.imageInstall:
+                iutil.execWithRedirect("new-kernel-pkg",
+                                       ["--mkinitrd", "--dracut",
+                                        "--depmod", "--update", kernel],
+                                       root=ROOT_PATH)
+            else:
+                # hostonly is not sensible for disk image installations
+                # using /dev/disk/by-uuid/ is necessary due to disk image naming
+                iutil.execWithRedirect("dracut",
+                                       ["-N",
+                                        "--persistent-policy", "by-uuid",
+                                        "-f", "/boot/initramfs-%s.img" % kernel,
+                                        kernel],
+                                        root=ROOT_PATH)
+
         self._createdInitrds = True
 
 
-- 
1.8.1.4



More information about the anaconda-patches mailing list