Hi Steve,
On 8/28/26 01:57, Steve Litt wrote:
> That being said, why not just put the one shot in stage 1 instead of
> stage 2?
You read my mind. I am absolutely moving the vdev oneshot service from stage 2 to stage 1, and here is why...
I have heavily simplified vdev, and it now supports `udevadm` compatible commands. Because of this, I completely
removed the extremely slow hybrid vdev instance (coldplug + hotplug). Instead, I replaced it with a hotplug-only
supervised instance (the long-running daemon) and a oneshot service launched in stage 1.
This stage 1 oneshot service waits for the '/lib/udev/control' socket. Once ready, it triggers "add" events for a
minimal, restricted group of subsystems. Devices within these subsystems only undergo a limited, essential set
of actions. This approach successfully solves the boot bottleneck, ensuring that input devices respond as fast
as possible:
vdev_wait_for_stamp "/lib/udev/control"
vdevadm control --promote="/etc/vdev/vdevd.early.conf"
for _sub in graphics video4linux input hid i2c drm fd; do
vdevadm trigger -s "${_sub}" -a add
done
Right after that, a "promote" command is executed to reload the configuration file on the fly, while the long-running
instance *PRESERVES* its PID (this is important for runit).
From this point forward, the full set of actions will be applied to every device:
vdevadm settle -t 15
vdevadm control --promote="/etc/vdev/vdevd.conf"
Immediately following the promote step, a complete sweep of sysfs is performed:
vdevadm trigger --sysfs -a add
Another advantage of using `vdevadm trigger` instead of running a separate coldplug-only instance is that the metadata
in '/dev/metadata/dev/*/vdev_instance' will always match up perfectly.
Additionally, udevadm is currently a symbolic link to vdevadm, which means that `wait_for_udev()` from initramfs-tools
remains fully functional with vdev as well.
It is also worth noting that, as explained in d1g, you can hot-swap between eudev and vdev very easily via apt:
# apt-get install eudev|vdev
By the way, you can test this new approach in the latest genuen iso images, which are currently only available with
OpenRC:
https://www.genuen.org/mirror/excalibur/
Let me know what you think!
Aitor.