On Fri, 2007-05-18 at 19:47 +0200, Souf wrote: > 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
It would be ideal not to alter the syntax of mdev.conf in anyway that people who already have established working configs will be forced to upgrade. Doing just that sort of the thing is why many of us dislike udev with it's ever changing code base. > > > 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. I've done most of what your doing simply in the mdev.conf when creating the "null" device, events and such. It's hackish but I think the end result is probably smaller than additional compiled binary 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 Yeah we want that part which checks for the symlinks. > > 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 > > _______________________________________________ > busybox mailing list > [email protected] > http://busybox.net/cgi-bin/mailman/listinfo/busybox -- Ned Ludd <[EMAIL PROTECTED]> Gentoo Linux _______________________________________________ busybox mailing list [email protected] http://busybox.net/cgi-bin/mailman/listinfo/busybox
