commit 9244c0900f4d5423c268932d581132db0ffa7099 parent ec744ecd71093fb3a8fa647785758a7ce60d4fa5 Author: Morel BĂ©renger <berengermorel76@gmail.com> Date: Sun, 15 Nov 2020 19:22:02 +0100 handle udev with runit, not rc.d Diffstat:
A | templates/generic/root/etc/service/udev | | | 2 | ++ |
A | templates/generic/root/etc/sv/udev/log/run | | | 2 | ++ |
A | templates/generic/root/etc/sv/udev/run | | | 33 | +++++++++++++++++++++++++++++++++ |
3 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/templates/generic/root/etc/service/udev b/templates/generic/root/etc/service/udev @@ -0,0 +1 @@ +/etc/sv/udev+ \ No newline at end of file diff --git a/templates/generic/root/etc/sv/udev/log/run b/templates/generic/root/etc/sv/udev/log/run @@ -0,0 +1 @@ +/etc/runit/log.run+ \ No newline at end of file diff --git a/templates/generic/root/etc/sv/udev/run b/templates/generic/root/etc/sv/udev/run @@ -0,0 +1,33 @@ +#!/bin/sh + +#TODO move to /etc/runit/common +#TODO find a less ugly way +need() +{ + i=0 + while ! test -e "$1" + do + sleep "0.$i" + test "$i" = 9 || i=$((i+1)) + done +} + +exec 2>&1 +set -ex + +mkdir -p /run/udev +rm -f /run/udev/control # just in case +rm -f /run/udevd_ready # just in case +( + need /run/udev/control # not sure we really need to wait for it + echo "Trigger+settle:" + udevadm --debug trigger --type=subsystems --action=add + udevadm --debug trigger --type=devices --action=add + udevadm --debug settle + >/run/udevd_ready + echo "Done: trigger+settle" +) & +echo "* Starting systemd-udevd[$$]" + +#exec env - PATH="$PATH" /usr/lib/systemd/systemd-udevd +exec env - PATH="$PATH" /lib/systemd/systemd-udevd -N late