[PATCH] driver-updates: accept burned driver discs (#1073719)

Will Woods wwoods at redhat.com
Tue Mar 11 15:54:52 UTC 2014


On Tue, 2014-03-11 at 16:35 +0100, Martin Kolman wrote:
> On Tue, 2014-03-11 at 00:05 -0400, Will Woods wrote:
> > 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).
> > 
> > Leaving the mountpoint as None is valid, as our umount() will simply
> > ignore that.
> > 
> > Bonus: remove a debugging "print" statement that was never supposed to
> > be there. MY BAD Y'ALL.
> > 
> > Resolves: rhbz#1073719
> > ---
> >  dracut/driver-updates | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/dracut/driver-updates b/dracut/driver-updates
> > index 4701adc..9c19140 100755
> > --- a/dracut/driver-updates
> > +++ b/dracut/driver-updates
> > @@ -672,7 +672,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 +683,12 @@ def select_iso():
> >          print("===Cannot mount the chosen device!===\n")
> >          return select_iso()
> >  
> > +    # is this device a Driver Update Disc?
> > +    if is_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
> LGTM

You'd think that, except is_dd() rejects all the driver disks I've
tried, for a pretty obvious reason:

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)
-------^^^

So it *rejects* anything that contains RPMs for the current arch. Huh?

Is this just a typo or have I misunderstood something about the layout
of driver discs? Does anyone know? There's no commit message or
comment..

Unless I hear otherwise I'm gonna assume it's a mistake, and send a new
version of this patch that fixes is_dd().

-w



More information about the anaconda-patches mailing list