about summary refs log tree commit diff
path: root/core-services/02-udev.sh
diff options
context:
space:
mode:
Diffstat (limited to 'core-services/02-udev.sh')
-rwxr-xr-xcore-services/02-udev.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/core-services/02-udev.sh b/core-services/02-udev.sh
new file mode 100755
index 0000000..1375209
--- /dev/null
+++ b/core-services/02-udev.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+# vim: set ts=4 sw=4 et:
+
+. /etc/runit/functions
+[ -r /etc/rc.conf ] && . /etc/rc.conf
+
+[ -n "$VIRTUALIZATION" ] && return 0
+
+if [ -x /usr/lib/systemd/systemd-udevd ]; then
+    _udevd=/usr/lib/systemd/systemd-udevd
+elif [ -x /usr/sbin/udevd ]; then
+    _udevd=/usr/sbin/udevd
+else
+    msg_warn "cannot find udevd!\n"
+fi
+
+if [ -n "${_udevd}" ]; then
+    msg "Starting udev and waiting for devices to settle...\n"
+    ${_udevd} --daemon
+    udevadm trigger --action=add --type=subsystems
+    udevadm trigger --action=add --type=devices
+    udevadm settle
+fi