df8ae412a4
This commit adjusts the S10udev script by: * Using the --action=add option to udevadm trigger. By default, only the "change" events are handled by 'udevadm trigger', which means it doesn't handle all the "device add" events that occured during the boot time, before eudev was started. * Adds a call to 'udevadm settle' to make sure we wait for udev to handle all the events that occured before eudev was started. Both of these change match what the Ubuntu and Debian udev startup scripts are doing. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
50 lines
1.5 KiB
Bash
Executable File
50 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# udev This is a minimal non-LSB version of a UDEV startup script. It
|
|
# was derived by stripping down the udev-058 LSB version for use
|
|
# with buildroot on embedded hardware using Linux 2.6.34+ kernels.
|
|
#
|
|
# You may need to customize this for your system's resource limits
|
|
# (including startup time!) and administration. For example, if
|
|
# your early userspace has a custom initramfs or initrd you might
|
|
# need /dev much earlier; or without hotpluggable busses (like USB,
|
|
# PCMCIA, MMC/SD, and so on) your /dev might be static after boot.
|
|
#
|
|
# This script assumes your system boots right into the eventual root
|
|
# filesystem, and that init runs this udev script before any programs
|
|
# needing more device nodes than the bare-bones set -- /dev/console,
|
|
# /dev/zero, /dev/null -- that's needed to boot and run this script.
|
|
#
|
|
|
|
# Check for missing binaries
|
|
UDEV_BIN=/sbin/udevd
|
|
test -x $UDEV_BIN || exit 5
|
|
|
|
# Check for config file and read it
|
|
UDEV_CONFIG=/etc/udev/udev.conf
|
|
test -r $UDEV_CONFIG || exit 6
|
|
. $UDEV_CONFIG
|
|
|
|
case "$1" in
|
|
start)
|
|
printf "Populating ${udev_root:-/dev} using udev: "
|
|
printf '\000\000\000\000' > /proc/sys/kernel/hotplug
|
|
$UDEV_BIN -d || (echo "FAIL" && exit 1)
|
|
udevadm trigger --action=add
|
|
udevadm settle
|
|
echo "done"
|
|
;;
|
|
stop)
|
|
# Stop execution of events
|
|
udevadm control --stop-exec-queue
|
|
killall udevd
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
|
|
exit 0
|