3 DESC
="Busybox mdev setup"
5 # Complain if thing's aren't right
6 if [ ! -e /proc
/filesystems
]; then
7 echo "mdev requires a mounted procfs, not started."
11 if ! grep -q '[[:space:]]tmpfs$' /proc
/filesystems
; then
12 echo "mdev requires tmpfs support, not started."
16 if [ ! -d /sys
/class
/ ]; then
17 echo "mdev requires a mounted sysfs, not started."
21 if [ ! -e /proc
/sys
/kernel
/hotplug
]; then
22 echo "mdev requires hotplug support, not started."
26 # We need to unmount /dev/pts/ and remount it later over the tmpfs
27 if mountpoint
-q /dev
/pts
/; then
31 if mountpoint
-q /dev
/shm
/; then
35 # Create tmpfs for /dev
36 echo "Creating tmpfs at /dev"
37 mount
-t tmpfs tmpfs
/dev
-o size
=800k
39 # Register mdev as hotplug event helper
40 echo "$MDEV" > /proc
/sys
/kernel
/hotplug
42 # Populate /dev from /sys info
43 echo "Populating /dev using mdev"
46 # Touch .udev to inform scripts that /dev needs no further setup
52 mkdir
-m 755 -p /dev
/pts
53 if [ ! -e /dev
/ptmx
]; then
54 mknod
-m 666 /dev
/ptmx c
5 2
56 mount
-t devpts devpts
/dev
/pts
-onoexec,nosuid
,gid
=$TTYGRP,mode
=$TTYMODE
59 mkdir
-m 755 -p /dev
/shm
61 # Make extraneous links
62 ln -sf /proc
/self
/fd
/dev
/fd
63 ln -sf /proc
/self
/fd
/0 /dev
/stdin
64 ln -sf /proc
/self
/fd
/1 /dev
/stdout
65 ln -sf /proc
/self
/fd
/2 /dev
/stderr
66 ln -sf /proc
/kcore
/dev
/core
67 ln -sf /proc
/asound
/oss
/sndstat
/dev
/sndstat