[aklug] Re: Grokking modprobe.conf

From: Arthur Corliss <acorliss@nevaeh-linux.org>
Date: Fri Feb 25 2011 - 09:42:19 AKST

On Fri, 25 Feb 2011, Kevin Miller wrote:

> I was reading the modprobe.conf man page and came across this, which I'm
> not sure I quite understand:
>
> [CODE]
> install modulename command...
> This command instructs modprobe to run your command instead of
> inserting the module in the kernel as normal. The command can be any
> shell command: this allows you to do any kind of complex processing you
> might wish. For example, if the module "fred" works better with the
> module "barney" already installed (but it doesn't depend on it, so
> modprobe won't automatically load it), you could say
> "install fred /sbin/modprobe barney; /sbin/modprobe --ignore-install
> fred",
> which would do what you wanted. Note the --ignore-install, which stops
> the second modprobe from running the same install command again. See
> also remove below.
> [/CODE]
>
> How does one parse the install line? Is it saying to install fred, then
> barney? If so, why does it have to specify modprobe for barney but not
> fred?

The format breaks down like this:

   {rule} {module} {action/options}

In this case you're making an install rule for fred which executes two shell
commands. Modprobe.conf isn't a script, it's a list of rules which apply to
specific modules, and is consulted each time modprobe is called.

> The second half of the command with the --ignore-install confuses me.
> What do they mean by "second modprobe"? Are they referring to the call
> to modprobe just before barney? Why would that re-call fred?

The --ignore-install rule makes it skip the install rule for fred. If you
didn't do this you'd end up in an infinite recursive loop. You only want
this rule executed for the *first* install request for fred to make sure
barney is preloaded.

         --Arthur Corliss
           Live Free or Die
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Fri Feb 25 09:42:28 2011

This archive was generated by hypermail 2.1.8 : Fri Feb 25 2011 - 09:42:28 AKST