LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 02-02-2006, 09:42 PM   #1
Z038
Member
 
Registered: Jan 2006
Distribution: Slackware
Posts: 804

Rep: Reputation: 157Reputation: 157
How to load a network driver during boot?


I installed Slackware 10.2 on /dev/hda3. My ABIT KV8-MAX3 system has a builtin gigabit NIC from 3COM. I think it is a 3C940. Fedora recognizes it and supports it, but there doesn't appear to be support for this card in Slackware.

I downloaded the 3c2000 driver source from 3COM and compiled it. I've got a 3c2000.o driver module now that I'd like to load during boot up.

I think I need to put the driver binary somewhere and add an INSMOD instruction somewhere in one of the rc initialization scripts in /etc, but I don't know where to put it.

So, where should I put the driver? What is the insmod command I need to use, and where do I put it?
 
Old 02-02-2006, 10:31 PM   #2
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
I'd put the compiled file into /lib/modules/<kernel version>/...
You can put the insmod command in /etc/rc.d/rc.local
 
Old 02-03-2006, 12:17 AM   #3
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
rc.local is a good choice, you also have rc.modules which is used to load modules as the name says
 
Old 02-03-2006, 05:54 AM   #4
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
Ah yes, rc.modules is the best place. I almost always compile drivers into the kernel
 
Old 02-04-2006, 12:05 AM   #5
Z038
Member
 
Registered: Jan 2006
Distribution: Slackware
Posts: 804

Original Poster
Rep: Reputation: 157Reputation: 157
I downloaded the latest version of the SK98LIN driver from the 3Com driver downloads web site. It came with an installation shell script that I ran. It compiled the driver source and stuck the object module in /lib/modules/2.4.31/kernel/drivers/net/sk98lin

I can't see where the install script stuck an insmod command anywhere to load the driver, but the eth0 interface now comes up during boot. It's not in rc.local or rc.modules. So I don't understand exactly why it works, but it does.

If anyone could explain it to me, I'd love understand why it works without the insmod.
 
Old 02-04-2006, 02:13 AM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,910

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
if the insmod or modprobe command are not in those files then it should be in /etc/modprobe.conf. Something like that:
Code:
alias eth0 sk98lin
so the module is loaded when eth0 is to be configured from /etc/rc.inet1
 
Old 02-04-2006, 01:57 PM   #7
Z038
Member
 
Registered: Jan 2006
Distribution: Slackware
Posts: 804

Original Poster
Rep: Reputation: 157Reputation: 157
bathory, the /etc/modprobe.conf and /etc/modules.conf are both empty files with 0 blocks.

I cut this from dmesg output:

sk98lin: Network Device Driver v8.23.1.3
(C)Copyright 1999-2005 Marvell(R).
PCI: Found IRQ 5 for device 00:0e.0
eth0: 3Com Gigabit LOM (3C940)
PrefPort:A RlmtMode:Check Link State

Then later in dmesg output I see this:

eth0: network connection up using port A
speed: 100
autonegotiation: yes
duplex mode: full
flowctrl: symmetric
irq moderation: disabled
scatter-gather: enabled
tx-checksum: enabled
rx-checksum: enabled

I want the speed to be set to 1000, so I think I need to issue an ifconfig or set an option on the modprobe or insmod somewhere during boot up. That's another reason why I'd like to track down how and where the driver is being loaded during boot.
 
Old 02-04-2006, 05:45 PM   #8
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,910

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Why don't you
Code:
grep sk98lin /etc/rc.d/rc.*
to see what file loads the module.
 
Old 02-04-2006, 10:54 PM   #9
Z038
Member
 
Registered: Jan 2006
Distribution: Slackware
Posts: 804

Original Poster
Rep: Reputation: 157Reputation: 157
That grep for sk98lin didn't turn up anything, bathory.

The installation shell script for the driver compiled several programs extracted from the driver tar file then linked them as module sk98lin.o. I found it using
Code:
find / -type f -name sk98lin.o -print
here
/lib/modules/2.4.31/kernel/drivers/net/sk98lin/sk98lin.o
And as I mentioned before, /etc/modprobe.conf and /etc/modules.conf are empty files, but
Code:
modprobe -c | grep -i eth
finds
alias eth0 off
I just don't know where all the configuration settings for modprobe come from if not from /etc/modprobe.conf.

Anyway, then I found this logic in /etc/rc.d/rc.inet1

Code:
  # If the interface isn't in the kernel yet (but there's an alias for it in
  # modules.conf), then it should be loaded first:
  if ! grep `echo ${1}: | cut -f 1 -d :`: /proc/net/dev 1> /dev/null ; then # no interface yet
    if /sbin/modprobe -c | grep -w "alias ${1}" | grep -vw "alias ${1} off" > /dev/null ; then
      echo "/etc/rc.d/rc.inet1:  /sbin/modprobe ${1}" | $LOGGER
      /sbin/modprobe ${1}
    fi
I don't entirely understand that, but I'm wondering if this would result in a modprobe eth0 or something like that if the output from the 'modprobe -c' finds the 'alias eth0 off'?

Hey, I still totally clueless, but at least I'm learning a little bit about the initialization process.
 
Old 02-05-2006, 04:11 AM   #10
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,910

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
If it's none of these methods, then it should be hotplug. So check under /etc/hotplug for a net.agent script which controls the network interface.
 
Old 02-05-2006, 09:19 PM   #11
Z038
Member
 
Registered: Jan 2006
Distribution: Slackware
Posts: 804

Original Poster
Rep: Reputation: 157Reputation: 157
Could be, but the eth0 messages come out before any messages about hotplugging in dmesg output.

I think I will modify rc.inet1 and rc.hotplug to write some messages during boot up so I can see where they are invoked relative to the eth0 messages...

Will let you know how it goes.
 
Old 02-05-2006, 10:00 PM   #12
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
Maybe it's recognized first as a PCI device, then hotplug loads the driver for it. Try adding the module on hotplug blacklist to see if it comes up: /etc/hotplug/blacklist

Last edited by gbonvehi; 02-05-2006 at 10:04 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] sound card driver does not load on boot uncle guido Suse/Novell 2 01-26-2005 01:21 PM
kernel driver load/boot order devacom Linux - Hardware 1 11-04-2004 07:41 AM
keep having to load network driver at bootup Dswissmiss Linux - Software 2 04-20-2004 03:55 AM
How to load a driver on boot? superfuzz Linux - General 4 11-28-2003 12:28 PM
how to load a network driver dansen Linux - Hardware 0 11-28-2002 03:50 AM


All times are GMT -5. The time now is 07:10 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration