GETCFG(8)

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 '-'. If a part of a name contains a hyphen '-', it has to be quoted with an underscore '_'. Also underscores '_' itself must be quoted with another underscore '_'.

The parts of a configuration name must comply to the following rules:
#!<config name>#:=#[<device type>-]{<interface name>|<device description>}#
#!<device description>#:=#{id-<identifier>#
#!# #|vpid-<vendor id>[-<product id>[-<vendor sub id>[-<product sub id>]]]#
#!# #|bus-<bus location>#
#!# #|type-<device type>#
#!# #|devpath-<sysfs devpath>}#
#!<bus location>#:=#<bus name>[-<bus id>[-<device id>]]#
#!# ##
#!<device type>#:=#Any valid string except "id", "bus", "type" and "devpath"#
#!# #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 is very device type specific. E.g. with#
#!# #ethernet devices we use the link layer address (MAC).#
#!# #Other identifiers should be specified here.#
#!<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>#:=#Any valid string#
#!<device id>#:=#Any valid string#
#!# #A bus name is e.g. pci, usb or scsi and the device id#
#!# #depends on the type of the bus. There may be multiple#
#!# #busnames and ids, when e.g. a scsi host is a pci device.#
#!# #Example: bus-pci-0002:30:0c.0-scsi-0:1:0#
#!<sysfs devpath>#:=#Any path in /sys#
#!Any valid string#:=#String that does not contain an unquoted seperator#
#!# #character or quoting character and may be used as a filename#

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.

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/*