Quote:
Originally Posted by rkrishna
right then how the machine will take the relevant rc.modules-xxxxx file,
the options are either we have to make a simlink pointing towards rc.modules-xxxxx like here i have
Code:
bash-3.1$ ls -al /etc/rc.d/rc.modules
lrwxrwxrwx 1 root root 23 2007-12-06 22:33 /etc/rc.d/rc.modules -> rc.modules-2.6.21.5-smp
and still that problem arise!!!
how will the kernel take automatically the respective rc.modules??
(b'se we already have a rc.modules pointing towards one of the rc.modules-VERSION )
or
i should remove the simlink /etc/rc.d/rc.modules, ie there should not be any rc.modules file
am i correct?
|
If you look at rc.S you will see
Code:
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 ];
then
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
As you can see it checks for rc.modules.local first and runs that if it is there. Next, looks for rc.modules-$(uname -r) so if you are running 2.6.21-5-myfancystring then it will look for rc.modules-2.6.21-5-myfancystring and will run it. If it doesn't then it will run rc.modules. The only difference with the last two conditionals is that it will output a different string if it is a symlink.
When you boot you should see the output of which rc.module file it chooses.
Do note, that it is important that you have different modules folders for all your kernel images (unless they have
exactly the same modules. These should be under /lib/modules. If you have an extra string appended to your kernel version then that should be reflected in the folder name.
I'm using two different kernels images of the same version and one has the extra string. The correct rc.modules file is called for each and the appropriate modules are loaded for me. I have my rc.modules pointing to rc.modules-2.6.21.5huge and on my current kernel image I loaded rc.modules-2.6.21.5. The only difference between the files is that I commented out some things in the latter which refer to modules which I have built into the kernel.