On Wed, 2003-07-16 at 14:35, Lars Damerow wrote: > Hello! > > We're trying to find a way to distribute kernel modules using yum. It's trivial > if all of the machines syncing to the repository run the same kernel, but > that's not true in our case. > > We could build single RPM that contains copies of the module built for each of > our kernels, but that could get pretty ugly. We'd have to manually build the > module on each kernel and then move the resulting .o file into our RPM by hand. > > What we'd like to do is have one SRPM that we'd rebuild on each kernel, > resulting in an RPM specifically versioned for that kernel. We'd put all of > those RPMs into our yum repository. Then, when a client updates, it'd only > install the RPM for its kernel. > > Is there some requires/provides magic we can use to get this behavior, or any > better approaches for the same result? So we've heard a lot of suggestions on this and other lists now. So I'll put my 2cents in too. there are two ways that I know of that might work ok - and they are based on the following assumptions: 1. that you want to have more than one kernel rpm installed at a time 2. that you want to have more than one kernel-module rpm installed at a time. so you can either: make the kernel-module rpms not have any conflicting files with one another and install them and just have name-duplicates in your rpmdb (fine, same as how kernels are done now) make the kernel-module rpms different names (include the kernel ver-rel in the name, for example) and then you can install them separately w/o having to worry with one 'updating' over the other one. Here is what I would think could make sense for kernel-modules. 1. have kernel modules provide something specific - or just compile a list of their pkg names 2. don't put them in a yum repository or anything like that just put them in another location where you can get to them. 3. have a program/script that looks for kernel updates and looks to make sure that if you have any extra kernel modules installed that you have the matching kernel modules version necessary for matching your kernel installed. ex: rpm -ivh kernel-2.4.21-12.i686.rpm installs. time passes cron job runs: (output is just made up) looking at rpmdb..... oh you have kernel modules foo, bar and baz installed. you have 3 kernels installed: 2.4.21-12, 2.4.20-18.9 and 2.4.20-13.9 you don't seem to have kernel-modules matching kernel 2.4.21-12 for foo, bar and baz, installing: kernel-module-foo-2.4.21-12.i686.rpm, kernel-module-bar-2.4.21-12.i686.rpm, kernel-module-foo-2.4.21-12.i686.rpm This way you can add things like: Requires: kernel-2.4.21-12 to your kernel-modules specs so when you remove a kernel the module will go away with it. kernel-modules are so weird when you're not building your own kernels that you have to be very careful of them. So I figured an external script that handled it would be the most easy. One thing on my middling-distance todo list is have a way of letting yum maintain a list of scripts to run based upon the packages and the actions taken on the packages. so if a kernel were to be installed after the transaction were over yum would immediately run 'kernel-module-magic' and it would grab the right kernel modules that you need. That's my take on things. -sv