[master/rhel7] driverdisk: Show selection menu for network driver isos (#1075918)

Brian C. Lane bcl at redhat.com
Tue Mar 18 21:48:59 UTC 2014


This shows the driver selection menu for network driver disks. It also
adds killing Plymouth which interferes with using the console, and
suppresses running the device selection menu when processing network
drivers since it will have been run earlier (at pre-trigger).

Resolves: rhbz#1075918
---
 dracut/driver-updates          | 11 +++++++----
 dracut/driver-updates.sh       |  1 -
 dracut/driver-updates at .service |  1 +
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/dracut/driver-updates b/dracut/driver-updates
index 5f03f3b..876d32c 100755
--- a/dracut/driver-updates
+++ b/dracut/driver-updates
@@ -516,6 +516,8 @@ def select_drivers(drivers):
         :type drivers:  list of Driver objects
         :returns:       None
     """
+    if not drivers:
+        return
 
     selection_menu(drivers, "Select drivers to install",
                    lambda driver: driver.source)
@@ -593,7 +595,7 @@ def network_driver(dd_path):
     # TODO: May need to add new drivers to /tmp/dd_modules to prevent them from being unloaded
 
     # Scan for new OEMDRV devices and ignore dd_args
-    dd_scan(skip_dds, False)
+    dd_scan(skip_dds, scan_dd_args=False, skip_device_menu=True)
 
 class DeviceInfo(object):
     def __init__(self, **kwargs):
@@ -707,7 +709,7 @@ def select_iso():
 
     return (os.path.join(mnt, dd_iso), "/media/DD-search")
 
-def dd_scan(skip_dds=set(), scan_dd_args=True):
+def dd_scan(skip_dds=set(), scan_dd_args=True, skip_device_menu=False):
     """ Scan the system for OEMDRV devices and and specified by dd=/dev/<device>
 
         :param skip_dds:     devices to skip when checking for OEMDRV label
@@ -735,7 +737,7 @@ def dd_scan(skip_dds=set(), scan_dd_args=True):
     skip_dds.update(dd_finished)
 
     # Skip interactive selection of an iso if OEMDRV was found
-    if skip_dds or not is_interactive():
+    if skip_dds or skip_device_menu or not is_interactive():
         return
 
     # Handle interactive driver selection
@@ -796,9 +798,10 @@ if __name__ == '__main__':
         # process cmdline dd entries. This will process any OEMDRV that
         # appear after loading the other drivers.
         skip_dds = set(oemdrv_list())
-        dd_scan(skip_dds)
+        dd_scan(skip_dds, skip_device_menu=True)
     else:
         # Process /tmp/dd_args and OEMDRV devices
+        # Show device selection menu when inst.dd passed and no OEMDRV devices
         dd_scan()
 
     sys.exit(0)
diff --git a/dracut/driver-updates.sh b/dracut/driver-updates.sh
index e2cc887..fca0b83 100755
--- a/dracut/driver-updates.sh
+++ b/dracut/driver-updates.sh
@@ -20,5 +20,4 @@ if [ -n "$dd_args" -o $blkid_rc -eq 0 ]; then
     sleep 5
     echo "$dd_args" > /tmp/dd_args
     start_driver_update "Driver Update Disk"
-    rm /tmp/dd_args
 fi
diff --git a/dracut/driver-updates at .service b/dracut/driver-updates at .service
index 52cd6ca..210bcd5 100644
--- a/dracut/driver-updates at .service
+++ b/dracut/driver-updates at .service
@@ -8,6 +8,7 @@ Type=oneshot
 RemainAfterExit=no
 WorkingDirectory=/tmp
 Environment=LANG=en_US.UTF-8
+ExecStartPre=-/bin/plymouth quit
 ExecStart=/bin/driver-updates
 StandardInput=tty-force
 StandardOutput=inherit
-- 
1.8.5.3



More information about the anaconda-patches mailing list