LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   "Conceptual" question about the start-up (https://www.linuxquestions.org/questions/slackware-14/conceptual-question-about-the-start-up-484537/)

frankie_DJ 09-18-2006 01:04 AM

"Conceptual" question about the start-up
 
OK, so I got a new network card and I'm trying to figure out how to install the driver for it, so I am looking in the /etc/rc.d/rc.modules. I wanted to find a file that loads the modules upon startup, and I guess this is supposed to be the one. But I don't understand how these modules get loaded, since all the /sbin/modprobe commands are commented out. I mean, even those that load the modules that I KNOW that are loaded. So there's gotta be another script file that loads stuff that are needed for my system, right?
Followup question: What is the file /etc/modules.conf for? It's empty, there is nothing in there.
Thanks.

Thoreau 09-18-2006 01:10 AM

/etc/modprobe.conf
/etc/modprobe.conf.local
/etc/modules.conf
/etc/conf.modules

Depends on the distro really, but you get the point. If there is nothing in your /etc/modules.conf file then you aren't probing for an alias after kernel load. The kernel loads modules dynamically at boot... unless you have the driver compiled into the kernel, which means it's part of the kernel and no longer a module, which means you wouldn't need to probe it because it was already there.

If you have a specific question about specific hardware, maybe that would be the best way to help.

Nylex 09-18-2006 01:12 AM

Surely you have to uncomment the relevant lines in /etc/rc.d/rc.modules if you want particular modules to load? I had to uncomment the line for APM so that it loads when I boot..

frankie_DJ 09-18-2006 01:18 AM

Hi,
That was pretty quick, thanks. OK, so how do the right modules get loaded if all these files you mentioned are either empty or nonexistant and rc.modules has everything commented out?

frankie_DJ 09-18-2006 01:20 AM

Hi Nylex, that's what I'm talking about. It just so happens that both my old and my new network card modules are one above the other in th rc.modules, and both lines are commented. So how was my old card module getting loaded in the first place? Oh, and I know for a fact that I didn't hard-compile it in the kernel.

frankie_DJ 09-18-2006 01:27 AM

Toreau, what do you mean by "probing for an alias after kernel load"? I notice that alsaconf put some lines with alias in the /etc/modprobe.conf. Why doesn't it use /sbin/modprobe?

gbonvehi 09-18-2006 01:56 AM

If you don't modprobe the module manually most of the times hotplug loads the modules for you (there's a blacklist for hotplug too, just like the commented lines).

frankie_DJ 09-18-2006 02:04 AM

But I have hotplugging disabled. Also, if it is hotplug that loads those modules (by recognizing the hardware automatically I assume) does that mean it should recognize my new card too? I mean, surely it's not just plugging the card in the board, cause I did that and the card is not being recognized?

frankie_DJ 09-18-2006 02:05 PM

Can anyone pick this up?

Alien Bob 09-18-2006 02:15 PM

Perhaps your old network card's module is loaded in the file "/etc/rc.d/rc.netdevice" which the Slackware installer created for you if you allowed it to probe for a network card?

If you disabled hotplug, the module for that new card will not be loaded automatically - that is why people enable hotplug. You will need to find out (by examining the output of the command "lspci") what card you have if you do not yet know, and add an appropriate "modprobe" line to /etc/rc.d/rc.modules.

Eric

frankie_DJ 09-18-2006 02:50 PM

Hi Alien Bob,

Are you the same Alien from Alien's Wiki? That's an awesome Wiki, really good info.

You are right, it did ask me to probe for the card when I was configuring the network at the installation. I will look in that file when I get home.I know what my new card is. I just wanted to see, before changing any of the files, how was the old card module getting loaded.

So, are you saying that, if I enable hotplugging, the module for the new card will automatically be loaded upon startup?

I looked around those files and found that /etc/modprobe.conf was changed by the alsaconf, which added some lines with alias. How does that exactly load sound module? Why not use modprobe?

Thanks,
Frankie

Alien Bob 09-18-2006 03:42 PM

Quote:

Originally Posted by frankie_DJ
So, are you saying that, if I enable hotplugging, the module for the new card will automatically be loaded upon startup?

That is the function of hotplug, yes. It will lookup the correct module for your card and load it automatically.

Quote:

I looked around those files and found that /etc/modprobe.conf was changed by the alsaconf, which added some lines with alias. How does that exactly load sound module? Why not use modprobe?
The modprobe.conf file contains configuration info for the modprobe program. If any of your kernel modules needs special attention when it is loaded, you add the necessary stuff there (or add it in /etc/modules.conf if you run a 2.4 kernel, or in a file under /etc/modprobe.d/ once you run Slackware 11.0 and a 2.6 kernel).
The ALSA init script "/etc/rc.d/rc.alsa" parses the modprobe.conf file and loads the appropriate sound modules it finds there, using modprobe. The "alsaconfig" program wrote that information there, based on what hardware it found when probing your computer hardware.

Eric

frankie_DJ 09-18-2006 04:54 PM

Alien Bob,

You were right, I did find the line that loads my old netcard modules in the /etc/rc.d/rc.netdevice. Thanks.

Now, I turned on hotplugging, but it didn't detect my new card. I also tried manualy loading the module that I thougth was correct module for it

modprobe tulip
depmod -a
( the card is SFA110 10/100 Fast PCI Adapter, and the installation cd that comes with it says that this is the right module for linux).

I restarted inet1, couldn't get ip address.

I disabled rc.netdevices, restarted the computer, hotplug again didn't detect the card so I loaded the module manualy again. Again, no address.

Any suggestions what else could I try? Thanks.

evilDagmar 09-18-2006 05:13 PM

Quote:

Originally Posted by frankie_DJ
Alien Bob,

You were right, I did find the line that loads my old netcard modules in the /etc/rc.d/rc.netdevice. Thanks.

Now, I turned on hotplugging, but it didn't detect my new card. I also tried manualy loading the module that I thougth was correct module for it

modprobe tulip
depmod -a
( the card is SFA110 10/100 Fast PCI Adapter, and the installation cd that comes with it says that this is the right module for linux).

I restarted inet1, couldn't get ip address.

I disabled rc.netdevices, restarted the computer, hotplug again didn't detect the card so I loaded the module manualy again. Again, no address.

Any suggestions what else could I try? Thanks.

OKay, that's just bizarre. It should have loaded the module unless something is disabled in your kernel (or hotplug/udev is disabled) or you're using a 2.4.x kernel.

With 2.6.x it works like this (and I'm explaining this so you'll understand how it really, really should have "just worked")...

When something with a PCI or USB bus is initialized, this generates an event which triggers the hotplug/udev stuff to go and scan that bus to get the list of all the devices on it. PCI and USB devices, unlike ISA/VLB devices, will report a pair of numbers that identify both the manufacturer of the product, as well as it's exact type (cheap-assed non-compliant Chinese USB webcams not withstanding). This allows the device to be looked up in the modmap tables (you'll see them under /lib/modules-`uname -r`) to find out exactly which driver is responsible for that device, at which point hotplug/udev goes and modprobes that module. The information in the modmap table is generated from a lot of places, but basically, most of the time you can see a device named when you do an `lspci` or `lsusb` if you have compiled the module that drives that particular device, it's going to have the necessary entries in the modmap tables because no one bothers to add stuff to pci.ids or usb.ids without marking it's product and vendor codes as belonging to whatever module can drive it, and Linux supports damn near everything now, so if someone knew about it, it's probably got a driver that will make it go, or someone's working on one.

Particularly for a tulip card, this should have "just worked". The other (older method) thing you can do is to break out the electric voodoo chalk and start drawing some circuits in /etc/modprobe.conf (for 2.6.x kernels) or /etc/modules.conf (for 2.4.x kernels) so that there are lines between the name "eth0" and the tulip module. The line "alias eth0 (modulename)" in there will cause the kernel to associate the eth0 device with the driver module cited, and will (after some internal deliberation) load that module before attempting to access the device. (I'm not being derogatory here. For some reason the alias directive has always struck me as being a strange form of sympathetic magic. "eth0 is now tulip, they are one and the same, (stabs device name with pin)" yadda yadda)

Alien Bob 09-18-2006 05:25 PM

Quote:

Originally Posted by frankie_DJ
Now, I turned on hotplugging, but it didn't detect my new card. I also tried manualy loading the module that I thougth was correct module for it

modprobe tulip
depmod -a
( the card is SFA110 10/100 Fast PCI Adapter, and the installation cd that comes with it says that this is the right module for linux).

I restarted inet1, couldn't get ip address.

How did you determine that the module was not loaded? Was it not listed in the output of
Code:

lsmod
? Did a new interface not appear in the output of
Code:

ifconfig -a
? Did you remove your old card? Did you configure your new card in /etc/rc.d/rc.inet1.conf ? Much is unclear.

Eric


All times are GMT -5. The time now is 11:17 PM.