Difference between revisions of "Hwdetect"

From ArchWiki
Jump to: navigation, search
(remove rc.conf mentions, style, avoid redundancy)
(Tips and tricks: --modules-not-loaded was removed, and --show-modules has no output suited for eval)
Line 28: Line 28:
 
* The tool has dedicated output for usage within {{ic|/etc/mkinitcpio.conf}}.}}
 
* The tool has dedicated output for usage within {{ic|/etc/mkinitcpio.conf}}.}}
 
* If any of the module names change because newer kernels have newer modules, or you install new hardware on your computer, you will need to generate the list of modules again and update {{ic|MODULES}}.}}
 
* If any of the module names change because newer kernels have newer modules, or you install new hardware on your computer, you will need to generate the list of modules again and update {{ic|MODULES}}.}}
 
== Tips and tricks ==
 
 
To generated a list of modules currently not used, run:
 
 
# hwdetect --modules-not-loaded
 
 
or use the following script:
 
 
{{hc|modules-not-loaded|<nowiki>
 
eval $(hwdetect --modules)
 
for m in ${MODULES[*]}; do
 
    if ! grep -sq $(echo $m|tr - _) <(lsmod); then
 
        echo $m;
 
    fi
 
done</nowiki>
 
}}
 

Revision as of 20:35, 23 July 2016

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

Installation

Install the hwdetect package.

Usage

See the hwdetect source, or run hwdetect --help.

Examples

You can use the following method to to populate MODULES in mkinitcpio.conf.

# hwdetect --show-modules

The command should have similar output to the following (system-dependant):

SOUND    : pcspkr
OTHER    : 8139cp 8139too ac

Depending on what is used, copy the module names to replace the MODULES section in /etc/mkinitcpio.conf. The system should now boot faster, as some, or all, of the hardware detection and modules dependencies calculations is already stated.

Note:
  • The tool has dedicated output for usage within /etc/mkinitcpio.conf.
  • If any of the module names change because newer kernels have newer modules, or you install new hardware on your computer, you will need to generate the list of modules again and update MODULES.}}