The following script gives us a list of all the modules that are needed to control all devices in a system:
#!/bin/bash
for i in `find /sys/ -name modalias -exec cat {} \;`;do
`which modprobe` --config /dev/null --show-depends $i;
done | rev | cut -f 1 -d '/' | rev | sort -u
Such a list could be useful in case you wish to make sure that your devices all have the required device drivers already loaded up in the kernel.
You probably see errors like this when you run this script:
modprobe: FATAL: Module platform:kgdboc not found.
modprobe: FATAL: Module platform:platform-framebuffer not found.
modprobe: FATAL: Module platform:Fixed not found.
modprobe: FATAL: Module MDIO not found.
modprobe: FATAL: Module bus not found.
modprobe: FATAL: Module platform:serial8250 not found.
These basically mean there are devices on the system that the script was not able to find a module/device driver for. Don't be concerned about these, some devices do not need a kernel driver for them to work.