[PATCHv2 master/rhel7-branch] driver-updates: accept burned driver discs (#1073719)

Will Woods wwoods at redhat.com
Tue Mar 11 16:09:50 UTC 2014


driver-updates was written with the assumption that the interactive menu
would always involve choosing a device which contained multiple updates
images.

This is not really the case - that's not how it worked in RHEL6, for
example - so we need to handle the case where the selected device is
itself a driver update disc.

This patch just checks the chosen device - if it is, in fact, a driver
update disc, then we unmount it (so the later functions can re-mount
it) and return that device name.

(Leaving the mountpoint as None is valid, as our subsequent umount()
will simply ignore that.)

Also, for the sake of sanity, remove is_dd(). A previous version of this
patch tried to use it, and it's a) otherwise unused and b) doesn't work.

Bonus: remove a debugging "print" statement that was never supposed to
be there. MY BAD Y'ALL.

Resolves: rhbz#1073719
---
 dracut/driver-updates | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/dracut/driver-updates b/dracut/driver-updates
index 4701adc..5e0a562 100755
--- a/dracut/driver-updates
+++ b/dracut/driver-updates
@@ -96,19 +96,6 @@ def oemdrv_list():
         return outlines.splitlines()
 
 
-def is_dd(dd_path):
-    """ Determine if a path is a valid DD for the current arch
-
-        :param dd_path: Path to the DD directory to test
-        :type dd_path:  string
-        :returns:       True if it is a valid DD
-        :rtype:         bool
-    """
-    arch = os.uname()[4]
-    return os.path.exists(dd_path+"/rhdd3") and \
-       not os.path.isdir(dd_path+"/rpms/%s" % arch)
-
-
 def get_dd_args():
     """ Get the dd arguments from /tmp/dd_args or /tmp/dd_args_ks
 
@@ -672,7 +659,6 @@ def select_iso():
         iso_dev = selection_menu(devices,
                                  "Driver disk device selection\n" + header,
                                  str, multi_choice=False, refresh=True)
-        print iso_dev
 
     if not iso_dev:
         return (None, None)
@@ -684,6 +670,12 @@ def select_iso():
         print("===Cannot mount the chosen device!===\n")
         return select_iso()
 
+    # is this device a Driver Update Disc?
+    if find_dd(mnt):
+        umount(mnt) # BLUH. unmount it first so select_dd can mount it OK
+        return (iso_dev.device, None)
+
+    # maybe it's a device containing multiple DUDs - let the user pick one
     isos = list()
     for dir_path, _dirs, files in os.walk(mnt):
         # trim the mount point path
-- 
1.8.5.3



More information about the anaconda-patches mailing list