getcfg

Langue: en

Version: April 2004 (openSuse - 09/10/07)

Section: 8 (Commandes administrateur)

NAME

getcfg - matches a configuration file to a configuration
getcfg-parse-hwdesc - Parses a configuration name
getcfg-make-hwdesc - Returns a valid configuration name
getcfg-device - returns the matching device
getcfg-interface - returns the matching interface
getcfg-all-info - returns the sysfs information matching a configuration name

SYNOPSIS

getcfg{-parse-hwdesc,-make-hwdesc,-device,-interface,-all-info} cfg-name [ options ] [ args

DESCRIPTION

The configuration names passed as cfg-name refer to a set of configuration data. Hardware descriptions as found in /etc/sysconfig/{hardware|network} are configuration names that indicate exactly one device. The getcfg-* family of programs is a configuration finder that looks for the best matching available configuration for a given hardware description. The individual programs have the following function: getcfg-parse-hwdesc Parses the hardware description hw-description and checks whether it complies with the device naming rules specified below. getcfg-get-all-info Parses the hardware description hw-description an returns information found in the corresponding sysfs attributes. It returns a list of variables which can be used in device-dependant initialisation scripts. getcfg Parses hw-description and returns the matching configuration file (if any). getcfg-device (Not yet implemented) getcfg-interface Parses hw-description and returns the interface matching to this configuration. getcfg-make-hwdesc Returns a valid configuration name base on the variables passed in args

OPTIONS

The following are options can be specified.
-c, --config
<arg> is a configuration name and not a hardware description
-d dir, --directory=dir
look for configurations in <dir>
-f prefix, --file-prefix=prefix
use <prefix> as prefix for configuration files
-h, --help
print usage information
-i, --ifacetype
set the interfacetype to look for in getcfg-interface
-l, --literally
take hardware description literally and don't complete it
-m, --multiarg
take multiple arguments like when called as getcfg-make-hwdesc
-e, --noexport
Don't print a final line 'export <list of varaibles>'
-p prefix, --prefix=prefix
Use this prefix for variable names (default: 'HWD_')
-t <t>, --type=<t>
Choose the type of hardware description
-v n, --verbose=<n>
Set the verbosity level to <n> (or specify multiple times)

DEVICE NAMING RULES

Configuration names describe the device or interface they belong to. They need not to describe it exactly because they may be used for several devices or for a device plugged in at different locations. There are different types of configuration names. They may contain a (parts of) a individual number like link layer addresses or serial numbers. Alternatively they may describe (parts of) the location or specify the type of the device. To be backward compatible they may also just be the interface name traditionally given by the kernel. The configuration names consist of several parts which are seperated by a hyphen '-'. The parts of a configuration name must comply to the following rules:
#!<config name>#:=#[<device type>-]{<interface name>|<device description>}#
#!<device description>#:=#{id-<identifier>#
#!# #|bus-<bus location>#
#!# #|devpath-<sysfs devpath>}#
#!# #|interface-<interface name>}#
#!# #|vpid-<vendor id>[-<product id>[-<vendor sub id>[-<product sub id>]]]#
#!# #|type-<device type>#
#!<bus location>#:=#<bus name>[-<bus id>][-<bus location>]#
#!# ##
#!<device type>#:=#Any valid string except "id", "bus", "devpath",#
#!# #"interface", "vpid", or "type".#
#!# #This describes the type of the device. We will use the#
#!# #event types from hotplug for this purpose. If there is#
#!# #need for a finer differentiation we will have to specify#
#!# #it here in this document.#
#!<interface name>#:=#Any valid string#
#!# #The interface name or the device file.#
#!<identifier>#:=#Any valid string#
#!# #The identifier for this device. The interpretation of#
#!# #the identifier depends on the device type. For this#
#!# #reason the device type is mandatory when using "id".#
#!<vendor id>#:=#Any valid string#
#!<vendor sub id>#:=#Any valid string#
#!<product id>#:=#Any valid string#
#!<product sub id>#:=#Any valid string#
#!# #These are identifiers that describe the product and not#
#!# #an individual device. Think of PCI ids for example.#
#!<bus name>#:=#{pci|scsi|ide|pcmcia|usb|ieee1394|css|ccw}#
#!<bus id>#:=#Any valid string except a bus name#
#!<sysfs devpath>#:=#Any path in /sys#
#!Any valid string#:=#String that does not contain characters which#
#!# #are invalid in a filename (e.g. a slash '/').#

EXAMPLES

The following examples are meant to give an overview how the device naming rules can be applied to actual devices.
bus-pci-0000:00:07.2
Any device in PCI slot 0000:00:07.2.
bus-pci-0000:03:05.0-scsi-0:0:1:0
The SCSI target 0:0:1:0 accessed via SCSI HBA in PCI slot 0000:03:05.0. Note that the HBA number are counted relative to the PCI slot, so the first HBA in a PCI slot will always have HBA number 0.
eth-id-00:01:02:8E:21:9
An ethernet device with id (MAC address) 00:01:02:8E:21:9.
iucv-id-ROUTER01
S/390 iucv device with id (link partner) 'ROUTER01'.

BUGS

Please report bugs at <http://www.suse.de/feedback>

AUTHOR


Christian Zoz <zoz@suse.de> -- hwup script

Michal Svec <msvec@suse.cz> -- hwup script

Hannes Reinecke <hare@suse.de> -- S/390 configuration

SEE ALSO

hwup(8),
/etc/sysconfig/hardware/*,
/etc/sysconfig/hardware/skel/*