• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: How to "Make" a driver?  (Read 4602 times)
Doose
Newbie
*

Karma: 0
Posts: 5


View Profile
« on: November 28, 2009, 03:23:20 AM »

Im stuck trying to build a driver for 2.6.31.6
Its a RT73 Wireless USB device.

root@ubuntu:/usr/2009_0713_RT73_Linux_STA_Drv1.1.0.3/Module# lsusb
Bus 001 Device 004: ID 148f:2573 Ralink Technology, Corp. RT2501USB Wireless Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation root hub

root@ubuntu:/usr/2009_0713_RT73_Linux_STA_Drv1.1.0.3/Module# make config

-------------------- Ralink RT73 Station Configuration --------------------

  Linux kernal source directory [/usr/src/linux-2.31.6]"

Linux source tree '/usr/src/linux/linux-2.6.31.6' is incomplete or missing!

Configuration failed

make: *** [config] Error 1

sheeva-with-linux has the headers @
http://sheeva.with-linux.com/sheeva/2.6.31.6/sheeva-2.6.31.6-KernelHeaders.tar.gz
But im not sure how to install them.
Tried extracting the .tar.gz and pointing the Config to them, with no luck.

How do I install the headers?
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #1 on: November 28, 2009, 04:37:56 AM »

It looks like the headers are set to go to /usr/include, which isn't the correct location for kernel headers(?)

What (I think) is supposed to happen is that /lib/modules/`uname -n`/ has a build and a source symlink, and these are supposed to point to the source and build directories (which are usually the same location).  The include directory for the headers is supposed to be under the source location.
The links as supplied point to /home/kelly/src/Sheeva/SheevaPlug_LSP/Sources/linux-2.6.31.6-work, so you could try:
  • Putting your module source somewhere convenient to you
  • Moving the include directory from the headers to be alongside it
  • Make the source and build links point to the parent dir.
Logged

Doose
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #2 on: November 28, 2009, 06:51:43 AM »

Unsure what you mean by moving the include directory next to the rt73 module and linking to the parent.
I tried pointing to the extracted include directory :
Code:
-------------------- Ralink RT73 Station Configuration --------------------

  Linux kernel source directory [/usr/src/linux-2.6.31.6]: /usr/include

  Linux kernel source directory : /usr/include

sed: can't read /usr/include/Makefile: No such file or directory
sed: can't read /usr/include/Makefile: No such file or directory
sed: can't read /usr/include/Makefile: No such file or directory
sed: can't read /usr/include/Makefile: No such file or directory
expr: syntax error
./Configure: line 104: [: -lt: unary operator expected
  Module install directory : /lib/modules/2.6.31.6/kernel/drivers/net

root@ubuntu:/usr/2009_0713_RT73_Linux_STA_Drv1.1.0.3/Module#
Which didn't work.
I was able to find that both build and source in /lib/modules/2.6.31.6 are links to /home/kelly/src/Sheeva/SheevaPlug_LSP/Sources/linux-2.6.31.6 .
http://www.cyprusmania.net/plug-computing/usb-wireless-access-point/ has more information on the problem,
but their only fix was to make a custom kernel.
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #3 on: November 28, 2009, 05:24:16 PM »

Unsure what you mean by moving the include directory next to the rt73 module and linking to the parent.
Do you have the source code for the module you are trying to build?  If so, what is the path of the directory which this is in?  (/usr/include is *not* your kernel source directory)
Logged

Doose
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #4 on: November 28, 2009, 10:11:13 PM »

Ok, I downloaded the 2.6.31.6 kernel source from kernel.org.
Changed the build/source symbolic links from /home/kelly/src/Sheeva/SheevaPlug_LSP/Sources/linux-2.6.31.6,
to the location of the extracted source.
Also merged the kernal headers from sheeva-with-linux into newly extracted source.

make config, now works without a hitch.
make all, fails

Now that I know a little bit more about whats going on, I'll try reflashing the plug to default.
Then do this all over again from scratch.

Thanks for your help Birdman.
Logged

Pages: [1]
Print
Jump to: