On Thu, 2009-11-05 at 01:52 -0600, Rob Landley wrote:
> So so...@gentoo has maintained his own mdev.conf for a while:
> 
>   ftp://tinderbox.x86.dev.gentoo.org/misc/mdev.conf
> 
> And Cross Linux From Scratch picked up a variant of it:
> 
>   http://cross-lfs.org/view/clfs-embedded/x86/bootscripts/mdev.html
> 
> It would be nice if busybox had an example mdev.conf in the examples 
> directory, and these seem to be the main ones being used in the field.
> 
> Here's my comment on the diff between those two:
> 
> >--- mdev-gentoo.conf 2009-11-05 01:18:23.000000000 -0600
> >+++ mdev-lfs.conf    2009-11-05 01:18:45.000000000 -0600
> >@@ -1,12 +1,7 @@
> >-#
> >-# This is a sample mdev.conf.
> >-#
> >-
> 
> Comments, might as well keep the gentoo version.
> 
> >-SLEEP=10
> 
> I dunno what "SLEEP=10" does here.  (As far as I can tell: nothing.  Solar?)
> 
> >-
> >-
> >+# /etc/mdev/conf
> > # Symlinks:
> > # Syntax: %s -> %s
> >+
> 
> Noise.
> 
> > MAKEDEV -> ../sbin/MAKEDEV
> > /proc/core -> kcore
> > fd -> /proc/self/fd
> >@@ -34,10 +29,14 @@
> > stderr -> fd/2
> > stdin -> fd/0
> > stdout -> fd/1
> >+
> 
> Noise.
> 
> >+# Remove these devices, if using a headless system
> >+# You will see an error mdev: Bad line 35
> > vbi -> vbi0
> > vcs -> vcs0
> > vcsa -> vcsa0
> > video -> video0
> >+# Stop Remove for headless system
> 
> 
> Good comments from LFS, but the real question: is this perhaps a bug busybox 
> should _fix_?  I'll leave that for now...
> 
> > # Devices:
> > # Syntax: %s %d:%d %s
> >@@ -45,7 +44,6 @@
> >
> > null 0:0 777
> > zero 0:0 666
> >-grsec 0:0 660
> 
> That line's a NOP, those are the defaults and LFS was right to remove it.
> 
> > urandom 0:0 444
> >
> >@@ -56,10 +54,12 @@
> > mem 0:9 0640
> > port 0:9 0640
> > ptmx 0:5 0660
> >+tun[0-9]* 0:0 0640 =net/
> >
> > sda* 0:6 0660
> > sdb* 0:6 0660
> > hda* 0:6 0660
> >+hdb* 0:6 0660
> 
> These are regexes, people:
> 
> sd[a-z]* 0:6 0660
> hd[a-z]* 0:6 0660
> 
> Now soe comments on other random stuff in here:
> 
> >/proc/core -> kcore
> >fd -> /proc/self/fd
> 
> There's no way both those lines can be right, I think the first is backwards.
> 
> Anyway, attached is my slightly cleaned up version which may need more 
> tweaking.  Solar: comments?
> 
> Rob



Rob,

I've been on vacation in the research triangle area for the past week
and just got off the plane and home about 90 mins ago. 
So sorry for not responding sooner.

Anyway that example conf you are looking at was "before" you did any
porting of my first attempt of a mdev.c from that guys mini-udev.c file.

These days my busybox-compat basic confs/script-foo look more like the
attached files.

I'll keep reading this thread to see what you guys came up or debated
with however.

Attachment: mdev-event-handler
Description: application/shellscript

console 0:5 0600 @mkdir -pm 755 fd && cd fd && for x in 0 1 2 3 ; do ln -sf 
/proc/self/fd/$x $x; done
null 0:0 777 @ln -sf fd/0 stdin;ln -sf fd/1 stdout;ln -sf fd/2 stderr
urandom 0:0 444
zero 0:0 666
grsec 0:0 660
kmem 0:9 000
mem 0:9 0640
port 0:9 0640
ptmx 0:5 0660

[h,s]d[a-z]* 0:6 0660 

tty 0:5 0660
tty[0-9].* 0:5 0660 @mkdir -pm 755 vc && cd vc && ln -sf ../$MDEV $(echo $MDEV 
| cut -c 4-)
tty[a-z].* 0:5 0660
ttyS[0-9].* 0:5 0660 @mkdir -pm 755 tts && cd tts && ln -sf ../$MDEV $(echo 
$MDEV | cut -c 5-)

event[0-9] 0:0 0600 @mkdir -pm 755 event;cd event && ln -sf ../$MDEV $(echo 
$MDEV | cut -c 6-);mdev-event-handler $MDEV
fb[0-9] 0:0 0600 @mkdir -pm 755 fb;cd fb && ln -sf ../$MDEV $(echo $MDEV | cut 
-c 3-)
loop[0-9] 0:0 0640 @mkdir -pm 755 loop;cd loop && ln -sf ../$MDEV $(echo $MDEV 
| cut -c 5-)
i2c-[0-9].* 0:0 0660 @mkdir -pm 755 i2c && cd i2c && ln -sf ../$MDEV $(echo 
$MDEV | cut -c 5-)


# Hammer
#s3c2410_serial[0-9] 0:20 0600 @ln -sf $MDEV ttySAC$(echo $MDEV | cut -c 15-)
s3c2410_serial([0-9]) 0:20 660 =ttySAC%1

# Sound.
(seq|timer|pcmC[0-9]D[0-9].*|controlC[0-9]) 0:18 0660 @mkdir -pm 755 snd;cd snd 
; ln -sf ../$MDEV $MDEV
(adsp|dsp.*|mixer|sequencer|sequencer2|audio.*) 0:18 0660 @mkdir -pm 755 
sound;cd sound ; ln -sf ../$MDEV $MDEV


# nslu2
#rtc0 0:0 660 @ln -sf /dev/rtc0 /dev/rtc
#ixp4xx_ucode 0:0 600

# catchall
#.* 0:0 600 . @([ -b $MDEV ] && mkdir -pm 755 block && cd block && ln -sf 
../$MDEV $MDEV;[ -c $MDEV ] && mkdir -pm 755 char && cd char && ln -sf ../$MDEV 
$MDEV)
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to