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

Vratislav Podzimek vpodzime at redhat.com
Wed Mar 19 07:52:14 UTC 2014


On Tue, 2014-03-18 at 14:48 -0700, Brian C. Lane wrote:
> 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
I think the comment right above the changed line needs updating.

>  
>      # 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
These two comments probably deserve squashing and rewording so that they
are not partially opposite to each other.

Other than that this looks good to me. Thanks for such patient
DD-fighting!

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list