lkml.org 
[lkml]   [1998]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
From
SubjectRe: Autoloading of modules
On Sun, 12 Jul 1998, Anthony DeStefano wrote:
> alias char-major-14 sound
>
> Now the psaux module just won't autoload, but the sound module does load
> so I added the following line to load the sb module (I have an ESS sound
> card)
>
> post-install sound modprobe sb
>
> but all i get is post-install /lib/modules/2.1.106/misc/sound.o failed in
> my logs.

I recently had a similar problem. It turns out to be an unfortunate
interaction between kmod, modprobe, and typical post-install rules
in conf.modules.

Several readmes (e.g. drivers/sound/Readme.modules) suggest rules like:

post-install foo-module modprobe bar-module

Note that 'modprobe' is a relative path, not an absolute path.
Now, when kmod execves /sbin/modprobe, PATH=/usr/bin:/bin.
So the the first modprobe will run ok, but the post-install rule will
fail since system("modprobe bar-module") cannot find modprobe in $PATH.
(We might have found this earlier, had the author of modutils
bothered to print errno when the system() call in modprobe.c fails.)

There are several simple fixes. An obvious one is to tell people to
use absolute paths, e.g.

--- linux-2.1.108/drivers/sound/Readme.modules.orig Mon Jun 8 22:32:35 1998
+++ linux-2.1.108/drivers/sound/Readme.modules Tue Jul 7 22:38:38 1998
@@ -29,7 +29,7 @@
Then, add to your /etc/modules.conf or /etc/conf.modules something like:

alias char-major-14 sb
-post-install sb modprobe "-k" "adlib_card"
+post-install sb /sbin/modprobe "-k" "adlib_card"
options sb io=0x220 irq=7 dma=1 dma16=5 mpu_io=0x330
options adlib_card io=0x388 # FM synthesizer

Another is to be a bit more compatible with kerneld and add /sbin
to the path kmod hands to modprobe:

--- linux-2.1.108/kernel/kmod.c.orig Thu Jun 25 19:15:21 1998
+++ linux-2.1.108/kernel/kmod.c Tue Jul 7 21:56:36 1998
@@ -21,7 +21,7 @@
modprobe_path is set via /proc/sys.
*/
char modprobe_path[256] = "/sbin/modprobe";
-static char * envp[] = { "HOME=/", "TERM=linux", "PATH=/usr/bin:/bin", NULL };
+static char * envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/bin:/bin", NULL };

/*
exec_modprobe is spawned from a kernel-mode user process,

/Mikael

(Linus: could you include these fixes in 2.1.109 or 2.1.110?)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:2.162 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site