Fedora Linux Support Community & Resources Center
  #1  
Old 21st June 2010, 10:14 AM
nguyenkims Offline
Registered User
 
Join Date: Jun 2010
Posts: 4
windows_xp_2003firefox
Packaging kernel modules

Hello,

I'd like to package a kernel module for my company repository ( I know that fedora doesn't accept kernel module for official repo). I have followed the link
http://rpmfusion.org/Packaging/KernelModules/Kmods2
But when I build the spec file, there are always some errors like:
kernel-devel-uname-r = 2.6.32.14-127.fc12.i686.PAEdebug.PAE is needed by mymodule-kmod-0.0-1{?dist}.1.src
that I don't have any idea about.

Actually, I don't really understand this mechanism: if for example, I want to install foo on my machine with kernel 2.6.32.14 but there is only kmod-foo-2.6.32.12 avaiable, does yum take this package automatically? Or do I need to make a package for kernel 2.6.32.14? What kmod does exactly?
I know that there is a lot of questions, but I can't find many documentation about that. Answers from someone with experience with kernel packaging would be very appreciated.

Thank you in advance,
Son.
Reply With Quote
  #2  
Old 21st June 2010, 10:46 AM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
linuxfedorafirefox
Re: Packaging kernel modules

You probably using the wrong command to build, try

Quote:
rpmbuild -ba packagename.spec --define "kernels $(uname -r)" --target $(uname -m)
or

Quote:
rpmbuild -ba packagename.spec --define "kernels 2.6.32.14-127.fc12.i686" --target $(uname -m)

Post your spec file or srpm for more help.
Reply With Quote
  #3  
Old 21st June 2010, 12:19 PM
nguyenkims Offline
Registered User
 
Join Date: Jun 2010
Posts: 4
linuxfedoramozilla
Re: Packaging kernel modules

After adding these options, it works !
So I suppose what kmodtool does is just automate the process of creating the package corresponding to a kernel ( like finding the kernel version to change in spec fille)? We can't decide, for example, a package for kernel 2.6.32.12 can be used for kernel 2.6.32.14?
I have uploaded my spec file but it is not very different from the template file.
Attached Files
File Type: spec mymodule-kmod.spec (2.4 KB, 61 views)
Reply With Quote
  #4  
Old 21st June 2010, 12:55 PM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
linuxfedorafirefox
Re: Packaging kernel modules

Quote:
Originally Posted by nguyenkims View Post
After adding these options, it works !
So I suppose what kmodtool does is just automate the process of creating the package corresponding to a kernel ( like finding the kernel version to change in spec fille)? We can't decide, for example, a package for kernel 2.6.32.12 can be used for kernel 2.6.32.14?
I have uploaded my spec file but it is not very different from the template file.
You need to rebuild for every kernel update.


The src URL isn't valid so I couldn't find the source code to test.

http://mymodule.com/downloads/%{kmodname}-%{version}.tar.bz2
Reply With Quote
  #5  
Old 21st June 2010, 02:06 PM
nguyenkims Offline
Registered User
 
Join Date: Jun 2010
Posts: 4
linuxfedoramozilla
Re: Packaging kernel modules

It's just a module I wrote for testing. It does nothing (except writing "My testing module" after insmoding).
I have managed to rpmbuild the two packages: mymodule and mymodule-kmod. But apparently, the mymodule-kmod file doesn't provide a good package ( even I have explicitly added
Provides:%{kmodname}-kmod = %{version}

Do you have any idea about this?

Just a curious question: how yum coud identify the corresponding kmod package? ( for ex, for installing open-vm-tools, we need kmod-open-vm-tools-`uname -r` )
Attached Files
File Type: bz2 mymodule-0.0.tar.bz2 (1.3 KB, 64 views)
File Type: spec mymodule.spec (779 Bytes, 65 views)
File Type: spec mymodule-kmod.spec (2.7 KB, 67 views)
Reply With Quote
  #6  
Old 22nd June 2010, 02:49 PM
nguyenkims Offline
Registered User
 
Join Date: Jun 2010
Posts: 4
linuxfedoramozilla
Re: Packaging kernel modules

I have (finally) succeed in creating some kmod package corresponding to each kernel version.
But when tested in another machine with an old kernel, yum always takes the newest kmod package instead of the right one ! Even if I disable the official repo to prevent yum from getting the newer kernel.
I compared my Spec file to some others like open-vm one, but I don't still see why .
Does someone know how yum decide which package is the right one for another?

Thanks in advance,
Reply With Quote
Reply

Tags
kernel, modules, packaging

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Livna packaging error? (fc8, new kernel, ati drivers) bradycl_84043 Hardware & Laptops 14 9th December 2007 10:04 AM
Howto compile modules which need kernel headers that are not included in kernel-devel raoul Guides & Solutions (No Questions) 2 31st March 2006 11:44 PM
about kernel and modules remi_2 Installation and Live Media 2 16th November 2005 01:50 PM
Packaging a custom kernel, the Fedora Way™? Thetargos Programming & Packaging 0 22nd October 2005 12:02 AM


Current GMT-time: 00:21 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat