From ArchWiki
Revision as of 00:32, 19 August 2011 by Pointone (Talk | contribs) (use i18n template)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

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 Template:Package Official package is available in [extra]:

# pacman -S hwdetect


  --kernel_version=      use kernel version (no autodetect)
  --ide-legacy           use old ide modules instead of pata
  --load-modules         load all detected modules
  --unload-modules       unload all detected modules
  --show-modules         show all detected modules
  --show-modules-order   shows load order of detected modules
  --show-agp             show AGP modules
  --show-ide             show IDE modules
  --show-scsi            show SCSI modules
  --show-sata            show SATA modules
  --show-usb             show USB modules
  --show-fw              show FIREWIRE modules
  --show-net             show NETWORK modules
  --show-input           show INPUT modules
  --show-irda            show IRDA modules
  --show-isdn            show ISDN modules
  --show-pcmcia          show PCMCIA modules
  --show-sound           show SOUND modules
  --show-video           show VIDEO modules
  --show-other           show OTHER modules

For /etc/mkinitcpio.conf use:
  --hostcontroller       show MODULES= for all hostcontrollers
  --vmware               add BusLogic to MODULES for vmware

  --hooks                show HOOKS=
  --hooks-dir            use this directory for HOOKS check
  --dsdt                 add dsdt to HOOKS=
  --raid                 add raid to HOOKS=
  --raid-partitions      add raid-partitions to HOOKS=
  --encrypt              add encrypt to HOOKS=
  --lvm2                 add lvm2 to HOOKS=
  --keymap               add keymap to HOOKS=
  --usb                  add usb to HOOKS=
  --fw                   add fw to HOOKS=
  --pcmcia               add pcmcia to HOOKS=
  --nfs                  add net to HOOKS=

For /etc/rc.conf use:
  --net                  show network MODULES
  --modules              show all detected MODULES


You can use the following method to disable Template:Codeline 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 Template:Codeline section in Template:Filename and change Template:Codeline from "yes" to "no". The system should now skip the auto-load and boot faster.


List generated with "hwdetect --modules" is very long. You might be interested only with those which are not actually loaded. Script does the job:

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