| Samuel Mendoza-Jonas | 1ed8cbee | 2016-12-23 13:05:15 +1100 | [diff] [blame] | 1 | #!/bin/sh | 
|  | 2 | # | 
|  | 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.34+ kernels. | 
|  | 6 | # | 
|  | 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. | 
|  | 12 | # | 
|  | 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. | 
|  | 17 | # | 
|  | 18 |  | 
|  | 19 | # Check for missing binaries | 
|  | 20 | UDEV_BIN=/sbin/udevd | 
|  | 21 | test -x $UDEV_BIN || exit 5 | 
|  | 22 |  | 
|  | 23 | # Check for config file and read it | 
|  | 24 | UDEV_CONFIG=/etc/udev/udev.conf | 
|  | 25 | test -r $UDEV_CONFIG || exit 6 | 
|  | 26 | . $UDEV_CONFIG | 
|  | 27 |  | 
|  | 28 | case "$1" in | 
|  | 29 | start) | 
|  | 30 | printf "Populating ${udev_root:-/dev} using udev: " | 
|  | 31 | printf '\000\000\000\000' > /proc/sys/kernel/hotplug | 
|  | 32 | $UDEV_BIN -d || (echo "FAIL" && exit 1) | 
|  | 33 | udevadm trigger --type=subsystems --action=add | 
|  | 34 | udevadm trigger --type=devices --action=add | 
|  | 35 | echo "done" | 
|  | 36 | ;; | 
|  | 37 | stop) | 
|  | 38 | # Stop execution of events | 
|  | 39 | udevadm control --stop-exec-queue | 
|  | 40 | killall udevd | 
|  | 41 | ;; | 
|  | 42 | *) | 
|  | 43 | echo "Usage: $0 {start|stop}" | 
|  | 44 | exit 1 | 
|  | 45 | ;; | 
|  | 46 | esac | 
|  | 47 |  | 
|  | 48 |  | 
|  | 49 | exit 0 |