LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-05-2005, 10:59 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Wher do I have to use a new driver I compiled?


Hi, guys!

I had a NIC driver problem that has already being solved. It was a broadcom device in a HP brand new PC.

It was using the tg3 driver but had problems with the network connection. After some tests (with different kernels, knoppix) having the same problems, and after noticing that windows didn't have the problem at all (excluding hardware as a source of the problem), I decided to get the nic manufactor's driver.

I downloaded the driver (available through GPL ), compiled it and tested it. No problem with the network so far.

However, I had problems making my computer use that driver for eth0.

What I did was place the bcm5700.ko file in /lib/modules/<kernel name>/kernel/drivers/net/ (the kernel is a 2.6.x)

Commented the line in /etc/modules.config that set tg3 for eth0 and added a line with bcm5700:

Code:
alias eth0 bcm5700
However, having done that wasn't enough. It still loads tg3.

I can bring down eth0 and unload tg3 manually. If I try to load the modele at that point, it fails. Says it cant read bcm5700.

As a workaround, in /etc/rc.local I manually change the module... specifying the full driver's path:

Code:
ifdown eth0
rmmod tg3
insmod /blah/blah/bcm5700.ko
ifup eth0
Then It works. However, it's not the most elegant solution out there, right? What did I miss???
 
Old 04-05-2005, 11:20 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
For regular libraries, I would run 'ldconfig' to register it, however your make install step may have done it. You may need to remake your initrd file for the kernel. The old tg3 module may be loaded by the 'linuxrc' script in the initrd ramdrive. Also, check for a file such as /etc/modules.preload or something similar. It may have the tg3 driver listed.

I thought that you would add a kernel module using 'make modules_install'. Please check the README file in /etc/src/linux for information about installing kernel modules.
 
Old 04-05-2005, 11:34 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Oh... I know about make modules_install..... however, It's not a driver of a kernel I compiled... I'm "adding" it to my precompiled kernel.. so to speak.
 
Old 04-05-2005, 11:38 PM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
By the way.... will check the things you are telling me about tomorrow. It's the office computer... will keep you posted.
 
Old 04-06-2005, 03:21 PM   #5
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
what does the initrd file do? and how do I rebuild it?
 
Old 04-07-2005, 07:27 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The initrd file is read in after the kernel. It is a compressed ram drive that contains the /bin, /usr, /sbin, /lib, etc hierarchy. Kernel modules which need to be loaded in order for the computer to boot up are loaded from the ram first. Then after the regular file system is mounted, it is pivoted out and the memory is cleared. For a network device, if you aren't booting from the network, the module may not be included in the initrd file. But from the way the old module keeps loading, it may be present in the initrd file. You can copy this file and uncompress it, then mount it as a loop device somewhere with the ext2 filesystem. This will allow you to explore it and determine if indeed the old kernel module is present. There is a script file called 'linuxrc' that is executed, that you can read also for clues. If nothing else, you might learn more about how your system boots up.

I think that you can use the 'zcat' program to uncompress the 'initrd', but see what 'file '<initrdfile>' reports, in case I'm wrong.

You can use the mkinitrd command to produce the initrd file. It is a script in the /sbin directory that you run as root.

Also, I believe that with a 2.6 kernel the 'make modules_install' command will only compile the needed modules. If this is a new module, and not a replacement, you will need to enable kernel module support for the module. If there is an option for the bcm5700 device, module support needs to be selected and the kernel will need to be recompiled. This is if the option wasn't enabled as a module when the kernel was compiled. However it is possible that the option was enabled, so you will want to check your .config file.

There is a make option called 'make oldconfig' that will select your old options. Then you can use one of the others, like make xconfig, to set the one option that you want to change. If you have changed to a different kernel option, make oldconfig will prompt you on new options.


Before I forget, be sure to look in the source directory for the driver. there may be detailed installation instructions. There is also a Documentation directory at /usr/linux/Documentation. There may also be something there, plus you will want to read the README file in there also. It details how to compile a new kernel.

Last edited by jschiwal; 04-07-2005 at 08:19 AM.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why driver needs to be compiled against the running kernel? make Linux - General 2 04-13-2005 04:59 PM
alsa driver compiled and installed... but no sound guitarfella Linux - Hardware 2 03-19-2005 10:12 AM
Need SIS900.o compiled driver perez-cabanb Linux - Networking 0 01-04-2005 10:56 AM
WebCam driver not compiled for my kernel daftwight Linux - Newbie 2 01-13-2004 03:18 PM
compiled linuxant driver vmlinuz Slackware 4 06-21-2003 07:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration