S10udev 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 config file and read it
  19. UDEV_CONFIG=/etc/udev/udev.conf
  20. test -r $UDEV_CONFIG || exit 6
  21. . $UDEV_CONFIG
  22. case "$1" in
  23. start)
  24. printf "Populating %s using udev: " "${udev_root:-/dev}"
  25. [ -e /proc/sys/kernel/hotplug ] && printf '\000\000\000\000' > /proc/sys/kernel/hotplug
  26. /sbin/udevd -d || { echo "FAIL"; exit 1; }
  27. udevadm trigger --type=subsystems --action=add
  28. udevadm trigger --type=devices --action=add
  29. udevadm settle --timeout=30 || echo "udevadm settle failed"
  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