[PATCH 5/6] driver-updates: add DoRefresh loop to select_iso()

Will Woods wwoods at redhat.com
Tue Mar 4 15:53:58 UTC 2014


This allows the user to hit 'r' to refresh the contents of the device
menu and get a refreshed set of devices.

This is handy if, say, you want to eject the installer DVD and insert a
driver DVD, and load drivers from that.
---
 dracut/driver-updates | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/dracut/driver-updates b/dracut/driver-updates
index 34fb55a..e58b7ca 100755
--- a/dracut/driver-updates
+++ b/dracut/driver-updates
@@ -654,20 +654,26 @@ def select_iso():
                   or (None, None) if no ISO file is selected
         :rtype: (str, str)
     """
-    try:
-        _ret, out = run_cmd(["blkid"])
-    except (OSError, RunCmdError):
-        return (None, None)
+    header = "      %-10s %-20s %-15s %s" % ("DEVICE", "TYPE", "LABEL", "UUID")
 
-    devices = []
-    for line in out.splitlines():
-        dev = parse_blkid(line)
-        if dev:
-            devices.append(DeviceInfo(**dev))
+    iso_dev = DoRefresh
+    while iso_dev is DoRefresh:
+        try:
+            _ret, out = run_cmd(["blkid"])
+        except (OSError, RunCmdError):
+            return (None, None)
+
+        devices = []
+        for line in out.splitlines():
+            dev = parse_blkid(line)
+            if dev:
+                devices.append(DeviceInfo(**dev))
+
+        iso_dev = selection_menu(devices,
+                                 "Driver disk device selection\n" + header,
+                                 str, multi_choice=False, refresh=True)
+        print iso_dev
 
-    header = "      %-10s %-20s %-15s %s" % ("DEVICE", "TYPE", "LABEL", "UUID")
-    iso_dev = selection_menu(devices, "Driver disk device selection\n" + header,
-                             str, multi_choice=False)
     if not iso_dev:
         return (None, None)
 
-- 
1.8.5.3



More information about the anaconda-patches mailing list