Default gumstix configuration changed
[gumsense-br.git] / package / udev / init-udev
blobb0eb278db56530b3ef13cec83fba39ab17eda13f
1 #!/bin/sh
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
20 case $(uname -r) in
21 2.6*|2.7*) ;;
22 *) exit 0;;
23 esac
25 # Check for missing binaries
26 UDEV_BIN=/sbin/udev
27 test -x $UDEV_BIN || exit 5
28 UDEVSTART_BIN=/sbin/udevstart
29 test -x $UDEVSTART_BIN || exit 5
30 UDEVD_BIN=/sbin/udevd
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
36 . $UDEV_CONFIG
38 # Directory where sysfs is mounted
39 SYSFS_DIR=/sys
41 case "$1" in
42 start)
43 # mount sysfs if it's not yet mounted
44 if [ ! -d $SYSFS_DIR ]; then
45 echo "${0}: SYSFS_DIR \"$SYSFS_DIR\" not found"
46 exit 1
48 grep -q "^sysfs $SYSFS_DIR" /proc/mounts ||
49 mount -t sysfs /sys /sys ||
50 exit 1
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"
56 exit 1
58 grep -q "^udev $udev_root" /proc/mounts ||
59 mount -t ramfs udev $udev_root ||
60 exit 1
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
69 mount /dev/pts
70 echo "done"
72 # Start udevd
73 echo -n "Starting udevd... "
74 $UDEVD_BIN --daemon || (echo "FAIL" && exit 1)
75 echo "done"
77 stop)
78 # do nothing
81 echo "Usage: $0 {start|stop}"
82 exit 1
84 esac