[PATCH] Fix three bugs discovered by driverdisk-disk.ks

Chris Lumens clumens at redhat.com
Wed Jul 29 20:58:42 UTC 2015


(1) Get rid of the else branch in addDriverRepos.  Driver disk RPMs may be
stored under /run/install/DD-* directly, not necessarily in any arch-specific
directory.  If no RPMs are found, we'll fail out at the createrepo step anyway
so this branch is unnecessary.

(2) preInstall runs after addDriverRepos, which means the requiredPackages
list gets blanked out by preInstall.  Thus we do not actually install any RPMs
from any driver disks.  Append to the list instead of resetting it.

(3) In the installer environment, driver disk kernel modules end up in an
arch-specific directory, not a kernel version-specific directory.
---
 pyanaconda/packaging/__init__.py         | 6 ++----
 pyanaconda/packaging/dnfpayload.py       | 2 +-
 tests/kickstart_tests/driverdisk-disk.ks | 2 +-
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py
index 6d9e8b7..a260d7b 100644
--- a/pyanaconda/packaging/__init__.py
+++ b/pyanaconda/packaging/__init__.py
@@ -1018,14 +1018,12 @@ class PackagePayload(Payload):
             if not os.path.isdir(repo):
                 break
 
-            # Drivers are under /<arch>/ or /DD-net/
+            # Drivers may be under /<arch>/ or /DD-net/, but they can also be
+            # in the top level of the DD repo.
             if os.path.isdir(repo+"DD-net"):
                 repo += "DD-net"
             elif os.path.isdir(repo+blivet.arch.getArch()):
                 repo += blivet.arch.getArch()
-            else:
-                log.debug("No driver repo in %s", repo)
-                continue
 
             # Run createrepo if there are rpms and no repodata
             if not os.path.isdir(repo+"/repodata"):
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
index 3a5ee87..608a636 100644
--- a/pyanaconda/packaging/dnfpayload.py
+++ b/pyanaconda/packaging/dnfpayload.py
@@ -715,7 +715,7 @@ class DNFPayload(packaging.PackagePayload):
 
     def preInstall(self, packages=None, groups=None):
         super(DNFPayload, self).preInstall(packages, groups)
-        self.requiredPackages = ["dnf"]
+        self.requiredPackages += ["dnf"]
         if packages:
             self.requiredPackages += packages
         self.requiredGroups = groups
diff --git a/tests/kickstart_tests/driverdisk-disk.ks b/tests/kickstart_tests/driverdisk-disk.ks
index e8025cd..9603b37 100644
--- a/tests/kickstart_tests/driverdisk-disk.ks
+++ b/tests/kickstart_tests/driverdisk-disk.ks
@@ -26,7 +26,7 @@ RESULTFILE=$SYSROOT/root/RESULT
 fail() { echo "*** $*" >> $RESULTFILE; }
 
 # check the installer environment
-[ -f /lib/modules/`uname -r`/updates/fake-dd.ko ] || fail "kmod not loaded"
+[ -f /lib/modules/`uname -m`/updates/fake-dd.ko ] || fail "kmod not loaded"
 [ -f /usr/bin/fake-dd-bin ] || fail "installer-enhancement not loaded"
 
 # check the installed system
-- 
2.4.3



More information about the anaconda-patches mailing list