/etc/init/preload-network.conf tries to save which network drivers have been in use on this system previously, and preloads those manually. It starts on 'starting boot-services', to give it a chance to load drivers very early (if we stashed anything in /var/lib/...), and it stops on 'stopped udev-trigger', to try and collect (and stash) info about any loaded network drivers after udev has finished loading network drivers.
That, however, assumes that when udev has finished, that we have all our /sys/class/net/ devices available. This doesn't work, though, since most Wifi drivers don't have their net device ready by the time they finish probing -- they fork off an asynchronous task to load any Wifi firmware, and create the net device only after that has succeeded.
IOW, the 'post-stop script' in preload-network.conf races with the completion of Wifi driver initialization.
This means that on many devices, /var/lib/preload-network-drivers is empty or only contains an ethernet driver. e.g., on my systems with QCA Wifi, I only see the USB ethernet driver there:
# cat /var/lib/preload-network-drivers
r8152
and same on my Marvell Wifi systems:
# cat /var/lib/preload-network-drivers
r8152
If I go back and rerun this well after booting, only *then* does it pick up my Wifi driver:
# start preload-network
preload-network start/running
# stop preload-network
preload-network stop/waiting
# cat /var/lib/preload-network-drivers
ath10k_pci r8152
We could probably replace the 'post-stop' stuff with a udev rule or something, couldn't we? That would then work to cache network drivers no matter when they load.
Comment 1 by grundler@google.com
, Feb 10 2018