[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 5


strload Command

Purpose

Loads and configures Portable Streams Environment (PSE).

Syntax

strload [ -u | -q ] [ -f File ] [ -d List ] [ -m List ]

Description

The strload command enables the system administrator to load and unload drivers and modules and to query the load status of PSE and its dependents.

By default, the strload command loads PSE according to the /etc/pse.conf file. The -f flag allows the administrator to use an alternate configuration file. The -d and -m flags are used to specify drivers and modules that are not present in the configuration files (such as when new drivers are being developed). The -q flag reports on the system load status (kernel existence) of the referenced drivers and modules.

Configuration File

The configuration file is a flat ASCII, line-oriented database. Comments are introduced by a # (pound sign), and continue until the end of the line. Blank lines are ignored. The form for each record is:

attributes filename [argument [node [minor ...] ] ]

Fields are separated by spaces, tabs, or both. A - (dash) can be specified as the field value, indicating that the default value is to be used. The fields are defined as follows:

attributes Describes the extension to load. The acceptable values are:

d
Specifies a driver.

m
Specifies a module.

s
Creates the node as a standard (not cloned) device.

+
Specifies that the extension can be configured more than once. This value must be specified for all lines containing the extension file name.

filename Specifies the object file containing the extension. If the command is issued with a "/" (slash) in the filename of the driver or module to be loaded, unloaded or queried, the strload command uses the value in the filename field explicitly. If there is no "/" in the filename entry, the strload command will first look for a copy of the driver or module in the current directory. If the driver or module is not in the current directory, strload will look for the driver or module in the /usr/lib/drivers/pse directory.

Note: It is recommended that the strload command be issued from the root directory (/). The strload command for load, unload, and query should always be issued from the same directory.

The kernel extension loader REQUIRES that the pathnames used be identical in load, unload and queries. This, coupled with the way the filename is determined by strload, could cause problems. Every byte in the pathname used by the strload command must EXACTLY match every positionally corresponding byte in the pathname used by the kernel extension loader because the kernel does a strcmp() on the filename when looking for matches. If the strload command is issued from a different directory to unload the module or driver, one of the following will occur:

For example:

The following scenario (NOT recommended) will cause "spx", also known as "A", to be unloaded. This is probably not the desired effect.

mkdir /tmp/foo /tmp/bar
cp /usr/lib/drivers/pse/spx /tmp/foo/A
cp /bin/ls /tmp/bar/A
cd /tmp/foo
strload -d A      # The loader knows the path and filename as
                  # "A" because "A" is found in the current
                  # directory
cd /tmp/bar
strload -q -d A   # Reports "yes" because there is "A" in the
                  # current directory. Note that the file "A"
                  # in /tmp/bar is NOT the same file "A" in
                  # /tmp/foo, but the loader does not care 
                  # because it identifies the file by 
                  # pathname.
strload -u -d A   # Unloads spx (also known as "A")!

The following is an error scenario:

mkdir /tmp/foo2 /tmp/bar2
cp /usr/lib/drivers/pse/spx /tmp/foo2/A
cd /tmp/foo2
strload -d A     # The loader knows the path and filename as
                 # "A"because "A" is found in the current
                 # directory.
cd /tmp/bar2
strload -q -d A  # Answers "no". There is no filename 
                 # in /tmp/bar2 that matches "A", so strload
                 # prepends pathname "/usr/lib/drivers/pse" to
                 # "A". "/usr/lib/drivers/pse/A" is not found,
                 # so strload answers "no".
strload -u -d A  # Fails - "A" does not exist.

The following is an error scenario:

cd /usr/lib/drivers/pse
strload -d spx   # The loader knows the path and filename as
                 # "spx" because "spx" is found in the 
                 # current directory.
cd /
strload -q -d spx # Answers "no". There is no filename in /
                  # that matches "spx", so strload prepends
                  # the pathname "/usr/lib/drivers/pse" to
                  # "spx". "/usr/lib/drivers/pse/spx" is found
                  # since it exists, so strload gives
                  # "/usr/lib/drivers/pse/spx" to the loader.
                  # The strcmp() fails since
                  # "/usr/lib/drivers/pse/spx" and "spx" do
                  # not match exactly.
strload -u -d spx # Fails - "spx" does not exist.


argument Has no meaning for the strload command. This field is optional. It is passed to the extension when its configuration routine is called. Its interpretation is specific to that extension. The default argument is the value of the filename field.
node Specifies the name of the node to create. This field is optional. It applies only to drivers and is used as the created node name when the driver is loaded. By default, the created node is /dev/filename.
minor Specifies additional, non clone nodes to create for this driver. This field is optional. The node names are created by appending the minor number to the cloned driver node name. No more than five minor numbers can be given (from 0 to 4), and a node is created for each one.

The -d and -m flags cause the configuration file to be ignored, unless it is explicitly named on the command line, as follows:

strload -f /tmp/my.conf -d newdriver

Note: The -d and -m flags do not override the configuration file. That is, if driver dgb is loaded by using the configuration file, the -d flag will attempt to reload it but will fail. The configuration file is processed before the -d and -m flags.

The List variable for the -d and -m flags is a comma-separated list of file names, each of which contains a single PSE driver or module. The configuration process proceeds as if a line of one of the following forms was found in the configuration file:

d filename

m filename

Flags


-d List Lists PSE device drivers to load or unload. The List variable specifies a comma-separated list of driver object names.
-f File Configures PSE according to the configuration information contained in the file indicated by the File variable. The default configuration file is /etc/pse.conf.
-m List Lists PSE modules to load or unload. The List variable specifies a comma-separated list of module object names.
-q Reports load status of extensions.
-u Unloads extensions.

Examples

  1. Entering the following command loads PSE (if not already loaded), the dgb and ssb drivers from the /usr/lib/drivers/pse/ directory, and the aoot module from the current directory, but does not use the configuration file:

    root# strload -d dgb,ssb -m ./aoot
    
  2. To unload the aoot module only, enter:

    root# strload -u -m ./aoot
    
  3. Entering the following command asks if the spx driver exists:

    root# strload -q -d 
    spx
    

    and produces the following output if not:

    spx
    : no
    
  4. The following is an example configuration file:

    #example configuration file
    d       dgb                                     #line 1
    d       mux    -       -       0                #line 2
    ds      foo                                     #line 3
    d+      xtiso  tcp     /dev/xti/tcp             #line 4
    d+      xtiso  udp     /dev/xti/udp             #line 5
    m       aoot                                    #line 6
    

    Line 1 loads the dgb driver extension as a cloned device named /dev/dgb. The argument passed to the dgb configuration routine is dgb.

    Line 2 loads the mux driver extension as a cloned device named /dev/mux and also creates a standard device name /dev/mux0 with a minor number of 0 (zero). (No more than five device names can be created with minor numbers from 0 to 4.)

    Line 3 loads the foo driver extension as a standard device (not cloned) named /dev/foo. The minor number is 0.

    Lines 4 and 5 load the xtiso driver extension, and configure it twice: once as tcp and once as udp. The clone nodes created are /dev/xti/tcp and /dev/xti/udp. The configuration routine of xtiso is called twice: once with the argument tcp, and once with udp.

    Line 6 loads the aoot module extension. No node is created, and the configuration routine is passed the value aoot.

Files


/usr/lib/drivers/pse/* Contains PSE kernel extensions.
/etc/pse.conf Default PSE configuration file.
/usr/sbin/strload Contains the strload command.

Related Information

The slibclean command, strerr command.

Configuring Drivers and Modules in the Portable Streams Environment (PSE), List of Streams Commands, STREAMS Overview in AIX 5L Version 5.1 Communications Programming Concepts.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]