How to use mdev to fix devices

M. Frey m.frey at avelon-cetex.com
Fri Jan 22 10:26:38 UTC 2010


Thanks Rob for your tips and links.

For other newbies:
I wrote a short HOWTO about creating a simple mdev hot-plug script. 
You'll find the article on:
http://maus.chaosnet.ch/2010/01/how-to-set-up-mdev-rules-for-busybox/

greez

maus

Rob Landley schrieb:
> On Wednesday 06 January 2010 11:55:06 M. Frey wrote:
>> Hi,
>>
>> I use busybox on embedded devices. So far it works great!
>>
>> Now I sett up mdev to solve the following problem:
>>
>> I use several USB-Devices simultaneously: A RS232/USB converter normally
>> attached to ttyUSB0 and a USB-Modem normally attached to ttyUSB0-5 by
>> the USB-Serial-Driver
>>
>> Problem: It's not predictable at what device file (ttyUSBX) the modem or
>> converter gets attached.
>>
>> I think that's what udev or mdev for.
>>
>> My questions:
>>
>> -How can I write a mdev rule to fix the devices to certain nodes?
>>
>> It tried something like this.
>> ttyACM* = modem
>> ttyUSB0 -> converter
>>
>> -How can I distinguish which device has been pluged in?
> 
> You'll have to call a program to look at the device and see what's in it.  
> Look at your environment variables.
> 
> A long, long time ago I wrote http://www.kernel.org/doc/pending/hotplug.txt 
> but keep in mind that the kernel keeps changing its interface and that's from 
> 2007 or so...
> 
>> -Where can I find examples and more documentation about defining mdev
>> rules?
> 
> There used to be a page or so full of information at:
> 
>   http://web.archive.org/web/20070121011248/http://www.busybox.net/downloads/BusyBox.html#item_mdev
> 
> But that got "upgraded" away.
> 
> These days if you look at the busybox sources, there's docs/mdev.txt which 
> might help.  There's also examples/mdev_fat.conf
> 
> Rob


More information about the busybox mailing list