handleKernelModule patch

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

 



Date: Tue, 9 May 2006 15:27:56 -0300
From: Andre Murbach Maidl <andre.maidl@xxxxxxxxxxxx>
To: anaconda-devel-list@xxxxxxxxxx
Subject: handleKernelModule patch
Message-ID: <20060509182756.GA4292@xxxxxxxxxxxxxxxxxxxxx>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="ZGiS0Q5IWpPtfppv"
Content-Disposition: inline
User-Agent: Mutt/1.4.2.1i


--ZGiS0Q5IWpPtfppv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi folks,

We are trying to create a Fedora Core 5 customized distro.
But, when we added a package called kernel-module-ntfs
anaconda broke because it couldn't solve the dependencies.

I looked for it and found that it was happening because
the function handleKernelModule was missing.

This function was in depsolve.py, in early versions, but this
file was removed from the anaconda-11.1.0.4.

At some point in yuminstall.py we have some functions
taken from depsolve.py, but handleKernelModule wasn't
there. I fix the problem adding the function in
yuminstall.py with the other functions from depsolve.py.

I hope I have helped.

Best regards
Andre


--ZGiS0Q5IWpPtfppv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="anaconda-11.1.0.4-kernel-module.patch"

--- anaconda-11.1.0.4/yuminstall.py.orig	2006-04-27 16:50:34.000000000 -0300
+++ anaconda-11.1.0.4/yuminstall.py	2006-04-27 16:51:36.000000000 -0300
@@ -498,6 +498,37 @@
             rpm.addMacro(key, val)
 
 #From yum depsolve.py
+    def handleKernelModule(self, txmbr):
+        """Figure out what special magic needs to be done to install/upgrade
+           this kernel module."""
+
+        def getKernelReqs(hdr):
+            kernels = ["kernel-%s" % a for a in rpmUtils.arch.arches.keys()]
+            reqs = []
+            names = hdr[rpm.RPMTAG_REQUIRENAME]
+            flags = hdr[rpm.RPMTAG_REQUIREFLAGS]
+            ver =   hdr[rpm.RPMTAG_REQUIREVERSION]
+            if names is not None:
+                reqs = zip(names, flags, ver)
+            return filter(lambda r: r[0] in kernels, reqs)
+
+        kernelReqs = getKernelReqs(txmbr.po.returnLocalHeader())
+        instPkgs = self.rpmdb.returnTupleByKeyword(name=txmbr.po.name)
+        for pkg in instPkgs:
+            hdr = self.rpmdb.returnHeaderByTuple(pkg)[0]
+            instKernelReqs = getKernelReqs(hdr)
+            
+            for r in kernelReqs:
+                if r in instKernelReqs:
+                    # we know that an incoming kernel module requires the
+                    # same kernel as an already installed module of the
+                    # same name.  "Upgrade" this module instead of install
+                    po = packages.YumInstalledPackage(hdr)
+                    self.tsInfo.addErase(po)
+                    self.log(4, 'Removing kernel module %s upgraded to %s' %
+                             (po, txmbr.po))
+                    break
+
     def populateTs(self, test=0, keepold=1):
         """take transactionData class and populate transaction set"""
 

--ZGiS0Q5IWpPtfppv--


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux