[MDEV] mdev and CONFIG_SYSFS_DEPRECATED

Souf souf_oued at yahoo.fr
Fri May 18 17:47:06 UTC 2007


Le vendredi 18 mai 2007 à 14:38 +0200, Natanael Copa a écrit :
> On Wed, 2007-05-09 at 23:46 +0200, Souf wrote:
> > Hi all,
> > I rewrote mdev so that it can work with or without CONFIG_SYSFS_DEPRECATED in the kernel,
> > this rewriting implies a minor modification of the syntax of mdev.config
> > New the mdev can:
> > 1- create symlinks
> >         <symlink> -> <target>
> >         stderr -> /proc/self/fd/2
> >         XOR -> null
> > 
> > 2- create (sub-)directories
> >         <(sub-)directory> <octal permissions>
> >         bus/usb/001 0755
> >         disk/by-id 0755
> > 
> > 3- create a device in a (sub-)directory
> >         <device regex> <uid>:<gid> <octal permissions> [</>>/>
> > <(sub-)directory> <octal permissions>]
> >         seq 0:0 0666 >> snd 0755
> >         pcmC[0-9]D[0-9]p 0:0 0666 >> snd 0755
> >         event[0-9] 0:0 0600 >> input 0755
> > 
> > 4- execute an command
> >         <device regex> <uid>:<gid> <octal permissions> [</>>/>
> > <(sub-)directory> <octal permissions>] [<@|$|*> <command>]
> >         controlC[0-9] 0:0 0666 >> snd 0755  @ echo "hello $MDEV"
> >         seq     0:0 0666 $echo "good bye $MDEV"
> >         timer 0:0 0666 >> snd 0755 * echo "Hi $MDEV"    
> > 
> >         @ Run after creating the device.
> >         $ Run before removing the device.
> >         * Run both after creating and before removing the device.
> 
> Is this new? Isnt that how current mdev works?
> 

I do not believe that the current medev is able to create symlinks,
neither (sub-)directories, nor devices in (sub-)directories. I agree for
command execution but it is not the same code.
In addition to that, I used libbb to parse mdev.conf and create devs:
xmalloc_getline()
last_char_is()
recursive_action()
bb_make_directory()
remove_file()
bb_get_last_path_component()
xmalloc_readlink_or_warn()

> > 5- work with or without CONFIG_SYSFS_DEPRECATED
> 
> I just came across this one while upgrading to 2.6.20. This should be
> fixed even if the rest is rejected.

I rectify: 
5- work with AND without CONFIG_SYSFS_DEPRECATED

> Havent looked at the code too much yet, but I definitively like the idea
> of letting mdev create devs in subdirs.
> 
> I wonder if it might be worth having dir creation as a config option?
Done, I added 2 options of configuration:
FEATURE_MDEV_MKDIR
FEATURE_MDEV_SYMLINK

This mdev works with busybox >= svn18362

Thanks

Malek

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mdev.patch
Type: text/x-patch
Size: 10812 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070518/845f1b6f/attachment-0002.bin 


More information about the busybox mailing list