Best use of mdev?

Lombard, David N dnlombar at ichips.intel.com
Fri May 2 13:46:00 UTC 2008


On Fri, May 02, 2008 at 09:28:44AM +0200, Bernhard Fischer wrote:
> 
> I usually only have /dev/null and /dev/console and create all the rest
> via mdev.

I've switched over to the kernel's initrd utilities to avoid having
to create devices, i.e., to build as non-root:

  {
    $SHELL linux-2.6.25/scripts/gen_initramfs_list.sh \
        -u squash -g squash root
    echo "nod /dev/null  0600 0 0 c 1 3"
    echo "nod /dev/tty1  0600 0 0 c 4 1"
    echo "nod /dev/ttyS0 0600 0 0 c 4 64"
    echo "nod /dev/ttyS1 0600 0 0 c 4 65"
  } | linux-2.6.25/usr/gen_init_cpio - | gzip > initrd.img


Earlier versions were less useful:

  $SHELL linux-2.6.18/scripts/gen_initramfs_list.sh \
        -u $(id -u) -g $(id -g) root > initramfs_list
  echo "nod /dev/null  0600 0 0 c 1 3" >> initramfs_list
  echo "nod /dev/tty1  0600 0 0 c 4 1" >> initramfs_list
  echo "nod /dev/ttyS0 0600 0 0 c 4 64" >> initramfs_list
  echo "nod /dev/ttyS1 0600 0 0 c 4 65" >> initramfs_list
  linux-2.6.18/usr/gen_init_cpio initramfs_list | gzip > initrd.img


-- 
David N. Lombard, Intel, Irvine, CA
I do not speak for Intel Corporation; all comments are strictly my own.



More information about the busybox mailing list