Difference between revisions of "Hwdetect"

From ArchWiki
Jump to: navigation, search
(Undo revision 442596 by Regid (talk) The page needs to be edited to remove the out of date parts before the out of date flag can be removed.)
(Undo revision 442599 by Rdeckard (talk))
Line 2: Line 2:
 
[[ja:Hwdetect]]
 
[[ja:Hwdetect]]
 
[[tr:hwdetect]]
 
[[tr:hwdetect]]
{{out of date|Initscripts are obsolete.}}
 
 
[https://projects.archlinux.org/svntogit/packages.git/tree/hwdetect/trunk/hwdetect 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 [[Wikipedia:Sysfs|sysfs]] subsystem employed by the Linux kernel.
 
[https://projects.archlinux.org/svntogit/packages.git/tree/hwdetect/trunk/hwdetect 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 [[Wikipedia:Sysfs|sysfs]] subsystem employed by the Linux kernel.
  

Revision as of 20:22, 23 July 2016

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.

Installation

The hwdetect package is available from the official repositories.

Usage

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

Example

You can use the following method to disable MOD_AUTOLOAD in rc.conf, or to populate MODULES in {ic|/etc/mkinitcpio.conf}}. This should improve boot times, as time will not be spent discovering modules.

# hwdetect --show-modules

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

SOUND    : pcspkr
OTHER    : 8139cp 8139too ac

Depending on what is used, copy the module names to replace the MODULES section in /etc/rc.conf, or in /etc/mkinitcpio.conf. For /etc/rc.conf, also change MOD_AUTOLOAD from "yes" to "no". 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.
Note: 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.

Tips

To generated a list of modules currently not used, run:

# hwdetect --modules-not-loaded

or use the following script:

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