Are there any guides for creating kernel module packages?

Asked by Barrakketh

The summary says it all, but are there any guides that cover the creation of packages for kernel modules? I'd like to start packaging drivers and firmware for the Ralink RT61 since the ones Ubuntu started providing as of Edgy Eft are broken. I've read the Debian New Maintainers Guide and don't see the subject so much as mentioned.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Barrakketh
Solved:
Last query:
Last reply:
Revision history for this message
Cesare Tirabassi (norsetto) said :
#1

I'm not a MOTU (even though I did few basic packages) but, why would such a package be different from any other package?
You can find some good examples of module packages here:

http://packages.ubuntu.com/feisty/base/

And of course a (basic) packaging guide here:

http://doc.ubuntu.com/ubuntu/packagingguide/C/index.html

You can find also good help on specific topics at the MOTU irc:

#ubuntu-motu

Revision history for this message
Morten (morten-lunde) said :
#2

I'm very new at Ubuntu.

To me it's a big problem to get the rt61 card to work. I haven't found any HOWTO's regarding this which work.

Revision history for this message
Barrakketh (barrakketh) said :
#3

Ralink provides drivers on their site for Linux. They are listed on this page: http://web.ralinktech.com/ralink/Home/Support/Linux.html

To build them you will need the build-essential package as well as the kernel headers (linux-headers-generic should be the package you want).

After unpacking the driver source you'll want to copy the files rt2561.bin, rt2561s.bin, rt2661.bin, rt61sta.dat
 from the Module directory to /etc/Wireless/RT61STA (which you'll need to create). rt61sta.dat is the file that will be used to configure your adapter. The lines in it that you are mainly interested in are:

SSID=
NetworkType=
AuthMode=
EncrypType=
DefaultKeyID=1
Key1Str=

The README file describes the settings that you can use. SSID will be whatever your router's name is, NetworkType should be Infra. Encryption will vary depending on how your router is configured, but I use WPAPSK for AuthMode and AES for EncrypType. DefaultKeyID is set to 1, and I filled in Key1Str with the router's encryption key.

In /etc/network/interfaces you will want an entry that reads like this:

auto ra0
iface ra0 inet dhcp

After you have copied Makefile.6 over Makefile, you should be able to type "make" from the Module directory and the driver should build itself. To install it you need to do the following with sudo from the Module directory:

cp ./rt61.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/
depmod
modprobe rt61

You will need to reboot the first time you do this, as I have never been able to successfully unload the driver that ships with Ubuntu (the rt2x00 driver).

This is somewhat involved, and there is a fair chance that you won't have to go through this process with Gutsy Gibbon, depending on which version of the rt2x00 drivers it ships with. The NetworkManager hardware page at http://live.gnome.org/NetworkManagerHardware says that the drivers in CVS support WPA/WPA2 with the 2.6.22 kernel, so we can go back to being lazy bums ;-)

The procedure I typed up here sounds involved, but it probably won't take more than five minutes to do unless you have to hit up the README. It definitely shouldn't after you've done it once.