diff --git a/.checkpackageignore b/.checkpackageignore index a547816886..b0c103ee4b 100644 --- a/.checkpackageignore +++ b/.checkpackageignore @@ -426,7 +426,6 @@ package/elfutils/0002-Really-make-Werror-conditional-to-BUILD_WERROR.patch lib_p package/erlang-rebar/0001-src-rebar_port_compiler-add-fPIC-to-LDFLAGS-by-defau.patch lib_patch.Upstream package/espeak/0001-Fix-build-of-shared-library-on-architectures-needing.patch lib_patch.Upstream package/espeak/0002-tr_languages-cast-string_ordinal-init-values.patch lib_patch.Upstream -package/eudev/S10udev Shellcheck lib_sysv.ConsecutiveEmptyLines lib_sysv.Indent lib_sysv.Variables package/evemu/0001-Include-limits.h-for-PATH_MAX.patch lib_patch.Upstream package/evemu/0002-evemu-Update-struct-input_event.patch lib_patch.Upstream package/evemu/0003-src-evemu.c-fix-build-with-kernels-4.16.patch lib_patch.Upstream diff --git a/package/eudev/S10udev b/package/eudev/S10udev deleted file mode 100644 index 6f20fc51f5..0000000000 --- a/package/eudev/S10udev +++ /dev/null @@ -1,54 +0,0 @@ -#!/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. -# - -DAEMON="udevd" - -SETTLE_TIMEOUT=30 -UDEVD_ARGS="-d" - -# shellcheck source=/dev/null -[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" - -# 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 $UDEVD_ARGS || { echo "FAIL"; exit 1; } - udevadm trigger --type=subsystems --action=add - udevadm trigger --type=devices --action=add - udevadm settle --timeout=$SETTLE_TIMEOUT || 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 diff --git a/package/eudev/S10udevd b/package/eudev/S10udevd new file mode 100644 index 0000000000..8bb8f6eb3a --- /dev/null +++ b/package/eudev/S10udevd @@ -0,0 +1,96 @@ +#!/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. +# + +DAEMON="udevd" +PIDFILE="/var/run/$DAEMON.pid" + +SETTLE_TIMEOUT=30 +UDEVD_ARGS="" + +# shellcheck source=/dev/null +[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" + +start() { + printf "Starting %s: " "$DAEMON" + [ -e /proc/sys/kernel/hotplug ] && printf '\000\000\000\000' > /proc/sys/kernel/hotplug + # shellcheck disable=SC2086 # we need the word splitting + start-stop-daemon --start --background --make-pidfile \ + --pidfile "$PIDFILE" --exec "/sbin/$DAEMON" \ + -- $UDEVD_ARGS + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + udevadm trigger --type=subsystems --action=add + udevadm trigger --type=devices --action=add + udevadm settle --timeout=$SETTLE_TIMEOUT || echo "udevadm settle failed" + return "$status" +} + +stop() { + printf "Stopping %s: " "$DAEMON" + udevadm control --exit + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + return "$status" + fi + while start-stop-daemon --stop --test --quiet --pidfile "$PIDFILE" \ + --exec "/sbin/$DAEMON"; do + sleep 0.1 + done + rm -f "$PIDFILE" + return "$status" +} + +restart() { + stop + start +} + +reload() { + printf "Reloading %s config: " "$DAEMON" + udevadm control --reload + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +case "$1" in + start) + start;; + stop) + stop;; + restart) + restart;; + reload) + reload;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 +esac + +exit $? diff --git a/package/eudev/eudev.mk b/package/eudev/eudev.mk index e9884f52d5..1a56cfd2f0 100644 --- a/package/eudev/eudev.mk +++ b/package/eudev/eudev.mk @@ -52,10 +52,10 @@ EUDEV_CONF_OPTS += --disable-selinux endif define EUDEV_INSTALL_INIT_SYSV - $(INSTALL) -D -m 0755 package/eudev/S10udev $(TARGET_DIR)/etc/init.d/S10udev + $(INSTALL) -D -m 0755 package/eudev/S10udevd $(TARGET_DIR)/etc/init.d/S10udevd endef -# Avoid installing S10udev with openrc, as the service is started by a unit +# Avoid installing S10udevd with openrc, as the service is started by a unit # from the udev-gentoo-scripts package. define EUDEV_INSTALL_INIT_OPENRC @: