LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   rc.modules-2.6.19.2 (https://www.linuxquestions.org/questions/slackware-14/rc-modules-2-6-19-2-a-525667/)

ryanoa 02-05-2007 12:49 AM

rc.modules-2.6.19.2
 
I've recently compiled 2.6.19.2 and it works flawlessly. I need to load some modules during boot but I don't have /etc/rc.d/rc.modules-2.6.19.2, do I need to create one? If so, what's the best way to do this? Or, can I load modules somewhere else?

Thanks,
Ryan

bathory 02-05-2007 02:58 AM

If you have /etc/rc.d/rc.modules you can put them there. Another way is to use /etc/rc.d/rc.local to load the modules you want

GrapefruiTgirl 02-05-2007 09:29 AM

Just remember, if you use the rc.local file, it is apparently the first and ONLY modules file that will be checked, so be sure everything you need is in there.
I have had good success keeping ONE rc.modules file for each kernel-version I happen to be using/testing, and using a symlink called rc.modules to point to the correct modules file to be used at the moment.
Lately all my kernels are 2.6.x.x, so I have named the modules file rc.modules-2.6.x.x, and I created a symlink called rc.modules, which points to it.

H_TeXMeX_H 02-05-2007 06:14 PM

Assuming they are related enough (and they are), you might wanna start with the rc.modules-2.6.x from one of the Slackware 2.6.x kernels, fix whatever you need to, rename it to match your kernel, and symlink rc.modules to it. If not, then I guess you'll have to write it from scratch.

kevmccor 02-05-2007 06:36 PM

Have a look at your /etc/rc.M file. This loads things on startup in multi-user mode (the normal mode). The services you want should be identified by rc.[ service ] scripts which are set to executable if they are to be run. The printing module (parport_pc, lp, etc.), usb modules (ohci_hcd, sg, usb_storage, etc.), and sound modules (snd_*) are among those that are not started there. The firewall (iptables) modules are also not loaded there. Generally, any script in the rc.d directory that is executable will be run at startup. Your kernel may have automatic module loading and unloading as well, in which case the modules will be loaded when a need is detected. You can put module parameters in /etc/modprobe.conf.

There are so many possible variations that it really requires that you become familiar with your hardware and program needs. Run /sbin/lsmod to see what you have and then read up on what you need or think you need.

ryanoa 02-05-2007 07:16 PM

Thank you for all the replies,
I made a copy my old rc.modules-2.6.18 and renamed it rc.modules-2.6.19.2, then symlinked rc.modules to the new one. Seems to work just fine, no problems yet.

Thanks again,
Ryan

duryodhan 02-06-2007 10:46 AM

no need to symlink. Symlinkin is a pain if you keep on upgradin....

it always searches for rc.modules-'uname -r' first.
then goes for rc.modules.

rc.local is totally different and unrelated. You can put modprobe there but its not wat I would recommend.

H_TeXMeX_H 02-06-2007 01:25 PM

Quote:

Originally Posted by duryodhan
it always searches for rc.modules-'uname -r' first.
then goes for rc.modules.

you sure ? I wouldn't put too much trust in that statement. I'd say "almost always".

drumz 02-06-2007 05:56 PM

This is from rc.S:

Code:

# This loads any kernel modules that are needed.  These might be required to
# use your ethernet card, sound card, or other optional hardware.
# Priority is given first to a script named "rc.modules.local", then
# to "rc.modules-$FULL_KERNEL_VERSION", and finally to the plain "rc.modules".
# Note that if /etc/rc.d/rc.modules.local is found, then that will be the ONLY
# rc.modules script the machine will run, so make sure it has everything in
# it that you need.
if [ -x /etc/rc.d/rc.modules.local -a -r /proc/modules ]; then
  echo "Running /etc/rc.d/rc.modules.local:"
  /bin/sh /etc/rc.d/rc.modules.local
elif [ -x /etc/rc.d/rc.modules-$(uname -r) -a -r /proc/modules ]; then
  echo "Running /etc/rc.d/rc.modules-$(uname -r):"
  . /etc/rc.d/rc.modules-$(uname -r)
elif [ -x /etc/rc.d/rc.modules -a -r /proc/modules -a -L /etc/rc.d/rc.modules $
  echo "Running /etc/rc.d/rc.modules -> $(readlink /etc/rc.d/rc.modules):"
  . /etc/rc.d/rc.modules
elif [ -x /etc/rc.d/rc.modules -a -r /proc/modules ]; then
  echo "Running /etc/rc.d/rc.modules:"
  . /etc/rc.d/rc.modules
fi

So the order of preference is rc.modules.local, rc.modules-`uname -r`, and finally rc.modules. The script even tells you if rc.modules is a symlink! The first one found is used, and the rest are ignored.

Edit: Clarification (For you non-Bashers out there)
The first on in the list found that is also executable is used.

duryodhan 02-07-2007 12:30 AM

ya rc.modules.local not rc.local. I don't have any rc.modules.local. I only have a rc.local and that has nothing to do with modules. There I just put something like 915resolution etc.


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