4.1- Boot model (1.5.5+)#
Two services; vdev does not wait on coldplug:
| Script | Role |
|---|---|
| vdev | Start vdevd hotplug listener plus control socket |
| coldplug.sh | Oneshot: boot_vga KMS and then triggers a subset of early coldplug events and promotes the listener afterwards. When the early stamp vdev.ready is already present, background worker that seeds and sweeps sysfs |
4.1.1- Sequence#
vdevdstarts with the early profile (netlink + /run/udev/control), aplying only a subset of actions. There is no sysfs walk.vdevadmtriggers a subset of coldplug events (graphics, input, hid, i2c and drm), talking to that same process:- wait for control
vdevadm trigger -s …forsubsystems=invdevd.early.confvdevadm settle— this is the wait; nothing waits onvdev.readyvdevadm control --promote[=long-running.conf](same PID loadsvdevd.conf/actions)vdevadm trigger --sysfs(full/sys/devicessweep; a later subshell not waited)
Promote does not stop or re-exec vdevd. vdev.ready is written after a successful promote and is not part of this handoff.
%%{init: {'sequence': {'mirrorActors': true, 'actorFontSize': 22, 'messageFontSize': 20, 'noteFontSize': 18}}}%%
sequenceDiagram
participant LR as vdevd<br/>(hotplug listener)
participant VE as early<br/>triggerer
participant CP as coldplug (bg)
Note over LR: early profile<br/>(only a subset of actions)
CP->>CP: boot_vga KMS sync
VE->>LR: wait control socket
VE->>LR: trigger early subsystems (bg)
VE->>LR: vdevadm settle
VE->>LR: #nbsp;vdevadm control --promote#nbsp;
Note over LR,VE: Loads long-running profile on the fly (no SIGHUP)<br/>The boot proccess goes ahead.
VE->>CP: <br/>early stamp
CP->>LR: vdevadm trigger --sysfs
Note over VE,CP: one-shot
Note over LR: long running<br/>(same PID)4.1.2- Promote (control socket)#
Promote and reload use the control socket only (no SIGHUP fallback):
vdevadm control --promote
vdevadm control --promote=/etc/vdev/vdevd.conf
vdevadm control --reload
vdevadm control --print-pid # listener PID via SO_PEERCRED
vdevadm control --exit # ask listener to stop (VDEV_CTRL_EXIT)Empty promote path → daemon loads /etc/vdev/vdevd.conf. The coldplug script passes VDEV_LONG_RUNNING (default vdevd.conf) under VDEV_CONFIG_DIR.
Wire types: VDEV_CTRL_PROMOTE (buf = path/basename), VDEV_CTRL_RELOAD, VDEV_CTRL_EXIT. --print-pid does not send a wire message; it connects and reads the peer PID with SO_PEERCRED (listeners only — coldplug_only does not bind control).
A stray SIGHUP is ignored by vdevd (still blocked via signalfd so the default disposition cannot kill the daemon). SIGINT (Ctrl+C) exits the poll loop — useful when running vdevd -1 / coldplug_only in the foreground for tests (no control socket on that instance).
Coldplug tunables: VDEV_PROMOTE_RETRIES (default 5), VDEV_LONG_RUNNING_CONFIG.
4.1.3- What vdevd does vs scripts#
| Concern | Owner |
|---|---|
| Subsystem seed order | INI subsystems= + vdevadm trigger -s (scripts) |
| Sysfs walk in C | Only coldplug_only=1 (e.g. optional terminal vdevd.1 -1) |
| Promote / reload / stop | Control PROMOTE / RELOAD / EXIT; init stop uses vdevadm control --print-pid then SIGTERM |
| Ready stamps | vdev.ready: coldplug after promote; vdevd-1-coldplug.ready: coldplug vdevd when its libudev monitor reads COLDPLUG_END=1 |
Scripts read subsystems and stamp from the profile INI.
action_files is the allowlist of *.act basenames; omit it to load every file in actions.
An empty control --promote loads /etc/vdev/vdevd.conf.
Sysfs comes from the kernel mount table.
4.2- Runtime stamps in /run/vdev#
| File | Writer | Meaning |
|---|---|---|
| vdev.ready | vdev-coldplug after successful promote |
Not a boot barrier. A later start of the vdev service uses it to exec vdevd.conf instead of early. The boot handoff itself is vdevadm settle then control --promote |
| vdevd-1-coldplug.ready | coldplug vdevd (COLDPLUG_END=1) |
Optional terminal coldplug finished |
4.3- Initramfs (initrd)#
init-top/vdev starts vdevd with vdevd.initrd.conf , binds control, and seeds with vdevadm trigger -s for each name in profile’s subsystems. init-bottom/vdev stops the initrd listener with kill -TERM "$(vdevadm control --print-pid)" before pivoting.
Kernel bind/unbind are treated like add/remove for late hotplug while the initrd listener is up. Do not add driver rebind loops in initrd (that belongs to real-root input tooling if needed).
4.4- Profile INI#
subsystems, action_files, and stamp live in the profile INI (/etc/vdev/*.conf).
A comma-separated action_files lists basenames under that profile’s actions directory. Omit the key, leave it empty, or set * to load every *.act there.
A file that is not listed is skipped at load. stamp is a basename. The coldplug process creates it in the pidfile directory (default /run/vdev) when it exits on COLDPLUG_END=1.
Lines that begin with # are comments.
subsystems=pci, block, usb, scsi
action_files=001-sysfs-block.act, 001-sysfs-char.act, 002-modalias.act, char.act, device-mapper.act
stamp=vdev.ready4.5- Optional helpers (not on the default boot path)#
-
vdev_settle— libinput seat0 monitor + FIFOs; usable viavdevadm settle --input/--input-workerfor debugging, not required for promote. -
vdevd.1.conf+-1— optional terminal full-sysfs oneshot; post-promote--sysfsusually replaces it. That process is a libudev-compat client: udev_monitor_new_from_netlink (“udev”),udev_monitor_get_fdin the same poll as the signal fd. The last sysfs uevent is published with COLDPLUG_END=1 and its kernel SEQNUM. Reading that property makes this process exit after touching stamp. The long-running listener does not open that monitor. If path creation fails, libudev-compat does not publish the event and the oneshot waits until a signal.