3 # udev This is a minimal non-LSB version of a UDEV startup script. It
4 # was derived by stripping down the udev-058 LSB version for use
5 # with buildroot on embedded hardware using Linux 2.6.12+ kernels.
7 # You may need to customize this for your system's resource limits
8 # (including startup time!) and administration. For example, if
9 # your early userspace has a custom initramfs or initrd you might
10 # need /dev much earlier; or without hotpluggable busses (like USB,
11 # PCMCIA, MMC/SD, and so on) your /dev might be static after boot.
13 # This script assumes your system boots right into the eventual root
14 # filesystem, and that init runs this udev script before any programs
15 # needing more device nodes than the bare-bones set -- /dev/console,
16 # /dev/zero, /dev/null -- that's needed to boot and run this script.
19 # old kernels don't use udev
25 # Check for missing binaries
27 test -x $UDEV_BIN ||
exit 5
28 UDEVSTART_BIN
=/sbin
/udevstart
29 test -x $UDEVSTART_BIN ||
exit 5
31 test -x $UDEVD_BIN ||
exit 5
33 # Check for config file and read it
34 UDEV_CONFIG
=/etc
/udev
/udev.conf
35 test -r $UDEV_CONFIG ||
exit 6
38 # Directory where sysfs is mounted
43 # mount sysfs if it's not yet mounted
44 if [ ! -d $SYSFS_DIR ]; then
45 echo "${0}: SYSFS_DIR \"$SYSFS_DIR\" not found"
48 grep -q "^sysfs $SYSFS_DIR" /proc
/mounts ||
49 mount
-t sysfs
/sys
/sys ||
52 # mount $udev_root as ramfs if it's not yet mounted
53 # we know 2.6 kernels always support ramfs
54 if [ ! -d $udev_root ]; then
55 echo "${0}: udev_root \"$udev_root\" not found"
58 grep -q "^udev $udev_root" /proc
/mounts ||
59 mount
-t ramfs udev
$udev_root ||
62 # heck, go whole-hog: use only new style hotplug
63 # echo $UDEV_BIN > /proc/sys/kernel/hotplug
65 # populate /dev (normally)
66 echo -n "Populating $udev_root using udev... "
67 $UDEVSTART_BIN ||
(echo "FAIL" && exit 1)
68 mkdir
$udev_root/pts
$udev_root/shm
73 echo -n "Starting udevd... "
74 $UDEVD_BIN --daemon ||
(echo "FAIL" && exit 1)
81 echo "Usage: $0 {start|stop}"