libdmx: Add fso-specs to DEPENDS
[openembedded.git] / recipes / busybox / busybox-1.2.2 / busybox-mdev.sh
blob9744322fa9af13764e1ce61998c081763c12d90b
1 #!/bin/sh
2 MDEV=/sbin/mdev
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."
8 exit 1
9 fi
11 if ! grep -q '[[:space:]]tmpfs$' /proc/filesystems; then
12 echo "mdev requires tmpfs support, not started."
13 exit 1
16 if [ ! -d /sys/class/ ]; then
17 echo "mdev requires a mounted sysfs, not started."
18 exit 1
21 if [ ! -e /proc/sys/kernel/hotplug ]; then
22 echo "mdev requires hotplug support, not started."
23 exit 1
26 # We need to unmount /dev/pts/ and remount it later over the tmpfs
27 if mountpoint -q /dev/pts/; then
28 umount -l /dev/pts/
31 if mountpoint -q /dev/shm/; then
32 umount -l /dev/shm/
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"
44 $MDEV -s
46 # Touch .udev to inform scripts that /dev needs no further setup
47 touch /dev/.udev
49 # Mount devpts
50 TTYGRP=5
51 TTYMODE=620
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
58 # Make shm directory
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
69 exit 0