S10udev 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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.12+ 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=/sbin/udevd
  20. test -x $UDEV_BIN || exit 5
  21. UDEVSTART_BIN=/sbin/udevstart
  22. test -x $UDEVSTART_BIN || exit 5
  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. case "$1" in
  28. start)
  29. mknod -m 0666 /dev/null c 1 3
  30. echo -n "Populating $udev_root using udev: "
  31. echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
  32. $UDEV_BIN -d || (echo "FAIL" && exit 1)
  33. $UDEVSTART_BIN || (echo "FAIL" && exit 1)
  34. echo "done"
  35. ;;
  36. stop)
  37. # Stop execution of events
  38. udevcontrol stop_exec_queue
  39. killall udevd
  40. ;;
  41. *)
  42. echo "Usage: $0 {start|stop}"
  43. exit 1
  44. ;;
  45. esac
  46. exit 0