[elrepo] Questions about rebuilding kmod-nvidia RPM for new kernel

Phil Perry phil at elrepo.org
Thu Aug 29 15:38:40 EDT 2013


On 29/08/13 16:46, Rob Spearman wrote:
>
> I installed a 3.9.7-4 kernel on CentOS 6 (via the kernel's 'make rpm')
> and am running this kernel.  When I try to rebuild the proprietary
> nvidia driver RPMs using the 319.32 src RPM from elrepo, I have a number
> of issues.
>
> 1. I have to specify kversion as "3.9.7-4" on the rpmbuild command
> line.  This does not match the format in the spec file, which includes
> repo and arch.  Why the discrepancy?  Full command line is:
>
> rpmbuild -bb nvidia-kmod.spec --define "kernels $(uname -r)" --define
> "kversion $(uname -r)" --target $(uname -m)
>
>
> 2. I can build the RPM, but it will not install.  It complains of what
> looks like kabi mismatch errors.  Examples:
>
> kernel(__bitmap_weight) = 0x4cbbd171 is needed by
> kmod-nvidia-319.32-3.el6.x86_64
>
> kernel(__const_udelay) = 0xeae3dfd6 is needed by
> kmod-nvidia-319.32-3.el6.x86_64
>
> kernel(__get_free_pages) = 0x93fca811 is needed by
> kmod-nvidia-319.32-3.el6.x86_64
>
> kernel(__init_waitqueue_head) = 0x68dfc59f is needed by
> kmod-nvidia-319.32-3.el6.x86_64
>
>
> If I install anyway, the module will not load.  So it appears to be
> built incorrectly but I can not determine how this could be happening.
>
> I can easily install the same nvidia driver version through the nvidia
> .run process, so it is not an nvidia problem.
>
> Shouldn't this process work?  Any suggestions?
>
> Thanks,
>
> Rob
>

Our 'kmod' drivers are somewhat special RPM packages that package and 
deliver kernel modules (kmods) that track the kABI of the RHEL kernel. 
They are not intended nor will they work with non-RHEL kernels. As 
hinted in the SPEC file, the "magic" is hidden in the kmodtool script.

Hence it's rather pointless trying to rebuild our kmod packages against 
a non-RHEL kernel.

The main advantage of a kmod package for providing a kernel module is 
that the module will seamlessly work against further RHEL kernel updates 
bacause RHEL uses a stable kABI in their kernels hence you don't need to 
recompile the module for each new kernel.

If you are using a non-RHEL kernel then there is no escaping the fact 
that the module will need to be build against each kernel. If you are 
not likely to update your kernel often then this is not such an issue, 
but if you do then you might want to look at other options such as 
DKMS-based solutions that automatically rebuild the module against each 
new kernel for you.

You can certainly use our packages as a base for developing your own 
packages if you wish. You could use the existing nvidia-x11-drv package 
and you would probably only need to tweak the RPM scripts; it would 
probably be easier to throw away kmod-nvidia and write a regular RPM 
package from scratch to prep, build and install the kernel module.

However, unless you are an experienced packager I would suggest the 
nvidia installer which, although a far from perfect solution, is 
probably your easiest option (have a good read of the NVIDIA 
documentation if you go this route).

One question, which could potentially complicate issues - are you 
planning on mixing booting of RHEL and non-RHEL kernels?

Regards,

Phil



More information about the elrepo mailing list