I am working on a couple of ideas for device tree overlays for the RPi 3B+ & 4B. It will be useful in my testing to be able to load and unload overlays without having to reboot each time. As described in The Dynamic Device Tree, the
dtoverlay command is able to accomplish this loading and un-loading at run time - a useful feature I think. Additional usage documentation is contained in
The documentation contains several important caveats wrt use of the
dtoverlay command. I think I've respected these caveats, but
dtoverlay doesn't seem to be working exactly as described in this official documentation; specifically wrt listing overlays that are in use/loaded.
dtoverlay -a and
dtoverlay -l are similar. The former lists all defined overlays and places an asterisk (*) next to the ones that are loaded; the latter lists all currently loaded overlays.
dtoverlay -a lists all overlays, but none are shown as loaded (i.e. no
* for any item in the list). Running
dtoverlay -l lists nothing at all.
I know that there are several overlays loaded because: a) they are included in
/boot/config.txt, and b) I can verify they are operating.
I've found that if I defer loading an overlay, both of these commands seem to work as advertised; i.e. I remove the dtoverlay from
/boot/config.txt, reboot, load the overlay dynamically with
sudo dtoverlay gpio-led gpio=25, then it does show up in the listings as loaded.
And so this is my question: It seems odd that
dtoverlay distinguishes an overlay loaded at boot time from one that is loaded at run time. How does
dtoverlay know the difference, and why does it care?
This question is similar to an older question, but that Q&A did not cover usage of the new-ish