devfs
[Top] [All Lists]

devfs and module 'post-install' commands

To: devfs@xxxxxxxxxxx
Subject: devfs and module 'post-install' commands
From: Jurgen Botz <jurgen@xxxxxxxx>
Date: Fri, 22 Jun 2001 08:13:45 -0700
Sender: owner-devfs@xxxxxxxxxxx
I just discovered an interesting little problem... on my RH 7.1 system
which I have configured to use devfs I've always had the problem that
I'd lose my mixer settings after the sound module got auto-unloaded
and later auto-loaded when something tried to play a sound.  Now 
RedHat has the following in modules.conf that's supposed to prevent
this:

  post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L
  pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S

I finally spent some time investigating this and found that the
that aumix-minimal wants to open /dev/mixer, but /dev/mixer is
a symlink to /dev/sound/mixer which devfsd creates.  Well, the
problem is that when the post-install command runs devfsd hasn't
had a chance to do this yet!  It isn't just timing... inserting
a delay in the post-install command above doesn't help.
Apparently the event doesn't get sent to devfsd until after
all the post-install commands have run?  Is that right, Richard?

Anyway, the simple solution is to explicitly tell aumix to use the
real devfs device name i.e.

  post-install sound-slot-0 /bin/aumix-minimal -d /dev/sound/mixer -f 
/etc/.aumixrc -L

This solution should work for most other cases where a post-install
command is needed since any program to do something with a device
should have an option for specifying the name.  I thought I should
mention it on the list in case someone else gets bitten by this...

--jurgen




<Prev in Thread] Current Thread [Next in Thread>