Best use of mdev?

Bernhard Fischer rep.dot.nop at gmail.com
Fri May 2 03:40:55 PDT 2008


On Fri, May 02, 2008 at 08:11:39PM +1000, Michael D. Setzer II wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>On 2 May 2008 at 9:28, Bernhard Fischer wrote:
>
>Date sent:      	Fri, 2 May 2008 09:28:44 +0200
>From:           	Bernhard Fischer <rep.dot.nop at gmail.com>
>To:             	"Michael D. Setzer II" <mikes at kuentos.guam.net>
>Copies to:      	busybox at busybox.net
>Subject:        	Re: Best use of mdev?
>
>> On Fri, May 02, 2008 at 12:49:33AM +1000, Michael D. Setzer II wrote:
>> >-----BEGIN PGP SIGNED MESSAGE-----
>> >Hash: SHA1
>> >
>> >I was just contacted by a user that has 11 partitions on a large hard disk. My 
>> >g4l project currently has the nods setup as being precreated in the /dev 
>> >directory. It had massive number of these for both the hd and sd going all 
>> >the way to sdp but only to the 9th option. I was manually able to create a 
>> >script to create the additional nods, but then started looking at options to 
>> >have it automaticly create the proper nods. I have found the mdev, and 
>> >seem to have figured some of it out, but think there might be some 
>> >additional things to make it work better. 
>> >
>> >I booted from the g4l cd, and did the following manually.
>> >
>> >created the /etc/mdev.conf with these two lines.
>> >
>> >hd[a-z][0-9]* 0:3 660
>> >sd[a-z][0-9]* 0:3 660
>> >
>> >Run the commands to create the /dev
>> >
>> >mkdir /sys
>> >mount -t sysfs sysfs /sys
>> >mdev -s
>> >
>> >Below is the original contents of the /dev directory minus all the hd and sd 
>> >files. Not sure which all of these can also be created with the mdev.conf file 
>> >and which have to be manually created. Also, some of the directories were 
>> >for raid systems that users had. Would the mdev create these? 
>> >Unfortunately, I don't have all the hardware to test.
>> 
>> I usually only have /dev/null and /dev/console and create all the rest
>> via mdev.
>> $ egrep -v "(^#|^$)" box/root/etc/inittab 
>> ::sysinit:/bin/mount -t proc none /proc
>> ::sysinit:/bin/mount -t sysfs none /sys
>> ::sysinit:/bin/mount -t tmpfs -o size=64k,mode=0755 none /dev
>> ::sysinit:/bin/mkdir /dev/pts
>> ::sysinit:/bin/mount -t devpts devpts /dev/pts
>> ::sysinit:/bin/echo /sbin/mdev > /proc/sys/kernel/hotplug
>> ::sysinit:/sbin/mdev -s
>> ::sysinit:/bin/mount -o remount,rw /
>> ::sysinit:/bin/mount -a
>> ::sysinit:/bin/hostname -F /etc/hostname
>> ::sysinit:/etc/init.d/rcS
>> 
>
>Thanks for all the info. I did some test, and mdev -s seems to create all the 
>files that were in the /dev directory. The exception was the sub directories 
>and the symbolic links. Haven't tried with a clean dev on boot. Notice your 
>system has a way to create the pts, which I need for the telnetd to work. So, 
>was going to leave it there, but if I can have it created that would be better. 
>
>The vc directory, and the others are for raid controllers that some users 
>had.Since I don't have a system with these raid systems, I don't know if 
>mdev could create those directories and nods. Not clear on the vc directory, 
>since it just has a 0 file.
>
>Additionally, you seem to do the things in inittab, whereas the g4l that I got 
>from the last author seems to have it all in the rcS file.
>
>One question that still stands is do I need to add something to the 
>mdev.config for md files. It seemed to create a single md file on a test.

$ cat box/root/etc/mdev.*
cat: box/root/etc/mdev.*: No such file or directory

Note that i currently have
$ grep SYSFS linux-2.6.25/.config
CONFIG_SYSFS_DEPRECATED=y
CONFIG_SYSFS_DEPRECATED_V2=y
CONFIG_SYSFS=y


More information about the busybox mailing list