LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Slackware with new Kernel - rc.modules is called more than once? (https://www.linuxquestions.org/questions/linux-newbie-8/slackware-with-new-kernel-rc-modules-is-called-more-than-once-856245/)

me-$-on 01-14-2011 01:50 AM

Slackware with new Kernel - rc.modules is called more than once?
 
Hello.

After I have chosen to use my new compiled and installed kernel ( 2.6.35-stable ) with my Slackware 12.2, i relinkend the rc.modules against the rc.modules.local.

In this I just added

Code:

echo "rc.modules->rc.modlues.local is called, without any commands but this".
And during the bootup dmesg screen I can see, that this modules is called more than once.

Now my question : is that right? I Suppose this should not be, should it ?


THX in advance.


Greetings

me-$-on

Tinkster 01-14-2011 02:49 AM

Can't recall having seen an rc.modules.local ... is that something
you did yourself? If you're concerned about "repeat handling" of it
I'd be grepping /etc/rc.d for files with rc.modules.local in them.


Cheers,
Tink

me-$-on 01-14-2011 03:19 AM

Ok
 
As I have seen, the rc.S calls a rc.modules.local, a modules.uname -r or at least one other rc.modules-whatever, but only one of them, checking rc.modules.local prior to the other two. ( I hope, I do not have a typo )
After I had installed my new kernel, I saw that rc.modules was still pointing to the modules-2.6.27.7-smp and called it during boot.
After reading some things, I chose the possibility of redirecting it to an file, which several posts on the web recommended:

rc.modules.local.

So the rc.S usually should be called more than once, because this decides, which rc.modules shall be called.

I should take a look at the dmesg from my ditro-stock kernel paying attention whether this happens there, too.

But it is really interesting, I did nothing but compiled a new kernel and installed it. And the modules. Following a Wiki-how to.

If it wll be the same with stock kernel, I really do not see any reason why linux should call one script more than ....... oh, perhaps because of dependencies in some way..... hmmmm.

Greetings


me-$-on

me-$-on 01-17-2011 02:10 AM

Seems solved : Must be like this
 
Hello again.

At the weekend I started my stock-kernel , and saw, that the rc.modules ( we, know, how rc.S uses its calls ) one time calls a rc.modules-"uname -r" ( which is found during bootup, because I started the stock kernel ) , and later, at the end it also calls the rc.local.
That means , the call is really redundant, if i set the link rc.modules to rc.local and start my own kernel.
It really means, that relinking rc.modules to a rc.local is even not so good,
because the rc.S script does not rely on the link-target of rc.modules.

At least i assume this now.

So, I will remove this link as long I do not tend to start any special modules.

I still have to thank.

Greetings

me-$-on.

Andy Alt 01-17-2011 02:54 AM

If I understand you right, it sounds like all you need to do is update the symlink /etc/rc.d/rc.modules, which by default points to /etc/rc.d/rc.modules-<kernel ver>

So if you're using 2.6.35-stable

ln -sf /etc/rc.d/modules-2.6.35-stable /etc/rc.d/rc.modules

But if you're compiling from scratch, you'd have to provide your own rc.modules file.

Someone will hopefully correct me if I'm wrong, but in most cases, in modern kernels, modules will load automatically. So the only thing you might want to have in your new modules files is this excerpt ( which is contained in /etc/rc.d/rc.modules-2.6.33.4-smp), but should work for other versions since it's using variables and stuff.

Code:

### Update module dependencies ###
# If /usr is mounted and we have 'find', we can try to take a shortcut:
if [ -x /usr/bin/find -a -e /lib/modules/$RELEASE/modules.dep \
    -a /lib/modules/$RELEASE/modules.dep -nt /etc/modules.conf ]; then
  NEWMODS="$(/usr/bin/find /lib/modules/$RELEASE -mindepth 2 -type f -newer /lib
/modules/$RELEASE/modules.dep)"
  # Only rebuild dependencies if new module(s) are found:
  if [ ! "" = "$NEWMODS" ]; then
    echo "Updating module dependencies for Linux $RELEASE:"
    /sbin/depmod -a
  else
    echo "Module dependencies up to date (no new kernel modules found)."
  fi
else # we don't have find, or there is no existing modules.dep, or it is out of date.
  echo "Updating module dependencies for Linux $RELEASE:"
  /sbin/depmod -A
fi

Any modules that aren't loading automatically could be added after that snippet, using modprobe.

One more thing: rc.local and rc.modules are two completely separate files, and have nothing to do with each other.

So, did I understand your question somewhat correctly?

me-$-on 01-18-2011 02:35 AM

Yes,
 
You are absolutely right, the rc.modules link seems to be some kind of customizing, for adding or removing individual modules.

What made me wonder, was the fact, that the rc.modules-(ker-ver) was filled with many entries.
This was with my stock Slackware.
But after removing its link, the distro started also correctly, so I would agree, that the kernel itself checks for its activated modules, which reside in /lib/modules. ( At least I think so ).

LFS ?

Tried that ten times, will try this the eleventh very soon, would like to build an own distro, flat, fast, highly compatible witht the recent and most common multimedia hardware, it shall be the distro for a mediacenter, enabling
lirc , a vm , and so on. I surely will be here again, if something will not work properly.

See ya.


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