mdev with USB wifi adapters

Walter Dnes waltdnes at waltdnes.org
Mon May 21 06:47:57 UTC 2012


On Fri, May 18, 2012 at 10:49:05AM +0200, Denys Vlasenko wrote

> I had to debug mdev-based device creation and also noticed
> that it's hard to debug. So I committed some changes
> which make it emit some diagnostics to /dev/mdev.log
> (only if this file exists).

  What I've been doing is to insert generic "print" code into the mdev
scripts. E.g....

exec 3>> /dev/shm/logfile.txt
printenv >&3
echo "===separator===" >&3
exec 3>&-

  This works in in my sh and bash.  Of course, in linux sh is merely a
symlink to bash.  Can anybody confirm this works in "real sh"?  See
http://tldp.org/LDP/abs/html/io-redirection.html for details.  Note that
bash may use file descriptor 5 internally, so you're limited to
3,4,6,7,8,9.  If you get desparate, close 0, 1, and 2 and re-use them.

  Anyhow, I got an important clue re some problems I'm having with
automount and unmount.  Inserting a USB key or drive generates multiple
events, e.g.

one event for /dev/sdb
one event for /dev/sdb1

and presumably one event for each and every partition.  I also assume
when receiving an event to create /dev/sdb1, I should put a sleep loop
in the script that gets activated if /dev/sdb doesn't exist yet <G>.
Now that I know what I'm up against, I can get on with it.

-- 
Walter Dnes <waltdnes at waltdnes.org>


More information about the busybox mailing list