kumquat-buildroot/package/eudev/S10udev
Carlos Santos 6246ea7d14 eudev: don't test if the binary exists in the init script
The test doesn't make sense. It just exits with error code 5 if the
binary doesn't exist, which is silly. Buildroot installs both udevd and
its init script as part of the same package. But if it ever happens for
some reason, the error message "/sbin/udevd: No such file or directory"
in the start case should be pretty clear.

Replace the UDEV_BIN variable, which was used only once, by the full
path of the binary file.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-04-16 07:34:40 +02:00

47 lines
1.6 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 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 %s using udev: " "${udev_root:-/dev}"
[ -e /proc/sys/kernel/hotplug ] && printf '\000\000\000\000' > /proc/sys/kernel/hotplug
/sbin/udevd -d || { echo "FAIL"; exit 1; }
udevadm trigger --type=subsystems --action=add
udevadm trigger --type=devices --action=add
udevadm settle --timeout=30 || echo "udevadm settle failed"
echo "done"
;;
stop)
# Stop execution of events
udevadm control --stop-exec-queue
killall udevd
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0