From ArchWiki
Revision as of 22:50, 10 November 2012 by Alexfikl (Talk | contribs) (Tips: aand fixed the template)

Jump to: navigation, search

hwdetect is a hardware detection script primarily used to load or list modules for use in rc.conf or mkinitcpio.conf. The script makes use of information exported by the sysfs subsystem employed by the Linux kernel.


The hwdetect package is available from the official repositories.


The latest usage information can be found here or by running hwdetect --help.


You can use the following method to disable MOD_AUTOLOAD in rc.conf. This should improve boot times, as time will not be spent discovering modules.

# hwdetect --modules

The command should output something similar to the following (of course, output depends on the system):

MODULES=(ac battery button processor thermal video cdrom ....) 

Copy this output to replace the MODULES section in /etc/rc.conf and change MOD_AUTOLOAD from "yes" to "no". The system should now skip the auto-load and boot faster.

Note: If any of the module names change (unlikely) or you install new hardware on your computer, you will need to generate the list of modules again and update MODULES.


  • To generated a list of modules currently not used, run:
# hwdetect --modules-not-loaded

or use the following script:

eval $(hwdetect --modules)
for m in ${MODULES[*]}; do
    if ! grep -sq $(echo $m|tr - _) <(lsmod); then
        echo $m;