Difference between revisions of "Hwdetect"

From ArchWiki
Jump to: navigation, search
(Example usage)
(clean-up)
Line 1: Line 1:
 
[[Category:Hardware detection and troubleshooting (English)]]
 
[[Category:Hardware detection and troubleshooting (English)]]
 +
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.
  
This is a tool that detects/lists modules that are exported by /sys
+
==Installation==
   
+
 
  Options:
+
The {{Package Official|hwdetect}} package is available in [extra]:
    --kernel_version=      use kernel version (no autodetect)
+
 
    --ide-legacy          use old ide modules instead of pata
+
  # pacman -Sy hwdetect
    --load-modules        load all detected modules
+
 
    --unload-modules      unload all detected modules
+
==Usage==
    --show-modules        show all detected modules
+
 
    --show-modules-order  shows load order of detected modules
+
Options:
    --show-agp            show AGP modules
+
  --kernel_version=      use kernel version (no autodetect)
    --show-ide            show IDE modules
+
  --ide-legacy          use old ide modules instead of pata
    --show-scsi            show SCSI modules
+
  --load-modules        load all detected modules
    --show-sata            show SATA modules
+
  --unload-modules      unload all detected modules
    --show-usb            show USB modules
+
  --show-modules        show all detected modules
    --show-fw              show FIREWIRE modules
+
  --show-modules-order  shows load order of detected modules
    --show-net            show NETWORK modules
+
  --show-agp            show AGP modules
    --show-input          show INPUT modules
+
  --show-ide            show IDE modules
    --show-irda            show IRDA modules
+
  --show-scsi            show SCSI modules
    --show-isdn            show ISDN modules
+
  --show-sata            show SATA modules
    --show-pcmcia          show PCMCIA modules
+
  --show-usb            show USB modules
    --show-sound          show SOUND modules
+
  --show-fw              show FIREWIRE modules
    --show-video          show VIDEO modules
+
  --show-net            show NETWORK modules
    --show-other          show OTHER 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:
+
For /etc/mkinitcpio.conf use:
    --hostcontroller      show MODULES= for all hostcontrollers
+
  --hostcontroller      show MODULES= for all hostcontrollers
    --vmware              add BusLogic to MODULES for vmware
+
  --vmware              add BusLogic to MODULES for vmware
 
   
 
   
    --hooks                show HOOKS=
+
  --hooks                show HOOKS=
    --hooks-dir            use this directory for HOOKS check
+
  --hooks-dir            use this directory for HOOKS check
    --dsdt                add dsdt to HOOKS=
+
  --dsdt                add dsdt to HOOKS=
    --raid                add raid to HOOKS=
+
  --raid                add raid to HOOKS=
    --raid-partitions      add raid-partitions to HOOKS=
+
  --raid-partitions      add raid-partitions to HOOKS=
    --encrypt              add encrypt to HOOKS=
+
  --encrypt              add encrypt to HOOKS=
    --lvm2                add lvm2 to HOOKS=
+
  --lvm2                add lvm2 to HOOKS=
    --keymap              add keymap to HOOKS=
+
  --keymap              add keymap to HOOKS=
    --usb                  add usb to HOOKS=
+
  --usb                  add usb to HOOKS=
    --fw                  add fw to HOOKS=
+
  --fw                  add fw to HOOKS=
    --pcmcia              add pcmcia to HOOKS=
+
  --pcmcia              add pcmcia to HOOKS=
    --nfs                  add net to HOOKS=
+
  --nfs                  add net to HOOKS=
 
   
 
   
  For /etc/rc.conf use:
+
For /etc/rc.conf use:
    --net                  show network MODULES
+
  --net                  show network MODULES
    --modules              show all detected MODULES
+
  --modules              show all detected MODULES
  
 +
==Example==
  
== Examples ==
+
You can use the following method to disable {{Codeline|MOD_AUTOLOAD}} in [[rc.conf]]. This should improve boot times, as time will not be spent discovering modules.
You can use the following method to disable MOD_AUTOLOAD in rc.conf. This will make your system boot faster, since it won't waste time on discovering modules.
+
# hwdetect --modules
  
Use:
+
The command should output something similar to the following (of course, output depends on the system):
    hwdetect --modules
+
MODULES=(ac battery button processor thermal video cdrom ....)  
It should output something like this (of course yours will be different):
+
    MODULES=(ac battery button processor thermal video cdrom ....)  
+
  
Copy this output and paste it in /etc/rc.conf to the modules section and change MOD_AUTOLOAD from "yes" to "no". Now your system should skip the autoload and boot faster.
+
Copy this output to replace the {{Codeline|MODULES}} section in {{Filename|/etc/rc.conf}} and change {{Codeline|MOD_AUTOLOAD}} from "yes" to "no". The system should now skip the auto-load and boot faster.

Revision as of 18:15, 23 December 2009

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

# pacman -Sy hwdetect

Usage

Options:
  --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

Example

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.