S10udev 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. # Check for missing binaries
  19. UDEV_BIN=/lib/udev/udevd
  20. test -x $UDEV_BIN || exit 5
  21. # Check for config file and read it
  22. UDEV_CONFIG=/etc/udev/udev.conf
  23. test -r $UDEV_CONFIG || exit 6
  24. . $UDEV_CONFIG
  25. case "$1" in
  26. start)
  27. echo -n "Populating $udev_root using udev: "
  28. echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
  29. $UDEV_BIN -d || (echo "FAIL" && exit 1)
  30. echo "done"
  31. ;;
  32. stop)
  33. # Stop execution of events
  34. udevadm control --stop_exec_queue
  35. killall udevd
  36. ;;
  37. *)
  38. echo "Usage: $0 {start|stop}"
  39. exit 1
  40. ;;
  41. esac
  42. exit 0