[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH 7/7] Install the driver discs according to what was loaded in stage1



> +        #copy modules and firmware
> +        try:
> +          shutil.copytree(DD_EXTRACTED, "/root/DD")
> +        except IOError, e:
> +          pass
> +
>          storage.writeEscrowPackets(anaconda)
>  
>          sys.stdout.flush()

You've got two spaces of indent there unlike four everywhere else.

Also, I must have missed something.  What's the reason for copying
driver disk stuff into /root/DD?  That's the /root of installation, not
/mnt/sysimage/root.  This is probably in another patch and I just
missed it.

> diff --git a/yuminstall.py b/yuminstall.py
> index accf452..4eac19c 100644
> --- a/yuminstall.py
> +++ b/yuminstall.py
> @@ -649,16 +649,18 @@ class AnacondaYum(YumSorter):
>  
>          extraRepos = []
>  
> -        if self.anaconda.id.extraModules:
> -            for d in glob.glob("/tmp/DD-*/rpms"):
> -                dirname = os.path.basename(os.path.dirname(d))
> -                rid = "anaconda-%s" % dirname
> -
> -                repo = AnacondaYumRepo(rid)
> -                repo.baseurl = [ "file:///%s" % d ]
> -                repo.name = "Driver Disk %s" % dirname.split("-")[1]
> -                repo.enable()
> -                extraRepos.append(repo)
> +        (_, _, _, _, ddArch) = os.uname()

You could use rpmUtils.arch.canonArch here.

> @@ -1292,6 +1294,23 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
>                  log.info("selecting package %s for module %s" % (pkg.name, name))
>                  self.ayum.install(po=pkg)
>  
> +        #We need to install the packages which contain modules from DriverDiscs
> +        for modPath in isys.modulesWithPaths():
> +            if modPath.startswith(DD_EXTRACTED):
> +                moduleProvides = modPath[len(DD_EXTRACTED):]
> +            else:
> +                continue
> +
> +            pkgs = self.ayum.returnPackagesByDep(moduleProvides)
> +
> +            if not pkgs:
> +                log.warning("Didn't find any package providing %s" % (modPath,))
> +
> +            for pkg in pkgs:
> +                log.info("selecting package %s for %s" % (pkg.name, modPath))
> +                self.ayum.install(po=pkg)
> +
> +
>      def selectBestKernel(self, anaconda):
>          """Find the best kernel package which is available and select it."""

This loop could probably be combined a little bit with the other one in
selectModulePackages to avoid duplicating the "returnPackagesByDep" line
and all the ones that follow it.

I'm thining something along the lines of:

   provides = []
   for (path, name) in anaconda.id.extraModules:
      <add stuff to provides>

   for modPath in isys.modulesWithPaths():
      <add stuff to provides>

   for moduleProvides in provides:
      pkgs = self.ayum.returnPackagesByDep(moduleProvides)
      ...

That seems a little more concise to me.  Not a big deal, though.  And
everything else looks fine.

- Chris


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]