seaflashlin.txt                                           Revision: 19-May-2016
===============================================================================
 Seagate Firmware Download Utility.
 Copyright (c) 2016 Seagate Technology LLC, All Rights Reserved
 SeaFlashLin Version: 0.4.8
===============================================================================
Usage
=====
        seaflashlin -f <fw_file> -d <sg_device>
        seaflashlin {-m <model_number> -f <fw_file> | -c <cfs_file>} [-d <sg_device>]

Example
=======
Specific drive:
        seaflashlin -f test.lod -d /dev/sg0
        (defaults to segment size = 64 and timeout = 5 seconds)

Multiple drives:
        seaflashlin -c barracuda.cfs
        seaflashlin -m ST600MP0005

Control options
===============
        -i      Display identification information (list sg_devices)

        -d, --device deviceHandle
                Use this option to specify the sg device handle on which to
                perform an operation. Multiple device handles can be given.

                Example: -d /dev/sg5

        -f <fw_file>
                The name of the firmware file.

        -x <path>
                To designate alternate location of the firmware files.  Default
                is the current working directory.

        -c <cfs_file>   (SATA only)
                A Seagate-prepared compatible firmware selector file.  All
                drives is the system will be reviewed for new firmware based on
                this CFS file.

        -k <cfs_file>   (SATA only)
                "dry run" test to determine which files and drives are
                supported by a given CFS file.

        -m <model_number>
                The model number of the drive to download firmware. All drives
                is the system with this model number will be selected.  Use a
                CFS first if you have one instead of using this choice.

                Not recommended for batch updates to multiple SATA notebook or
                desktop drives because the model numbers are not exclusively
                defined for just one family.  In other words, two similar
                drives with the same model number may have different part
                numbers and will not share the same firmware file.

Modes and Controls
==================
        -e      Deferred download. Not common. (ATA only)
        -s      Segment size (1 segment = 512 bytes) Default is 64 (32KiB)
        -p      Force ATA passthrough (for SATA)
        -w      Force Write Buffer CMD (for SAS)
        -u      Non-segmented
        -o      Timeout value (seconds).  Default without this option is 5
                seconds.

Utility Options
===============
        -v      Display version and exit (overrides all other arguments)
        -l      Show license agreement

Return codes
============
        0       No error found
        1       Fatal error in command line options
        2       Firmware (FW) Download Failed
        3       Invalid device
        4       No match in CFS file (CFS file and SATA only)
        5       FW up to date (CFS file and SATA only)
        6       Model number mismatch (CFS file and SATA only)
        7       FW version mismatch (CFS file and SATA only)
        4x      Hexadecimal number count of Seagate sg devices in the
                system.  This response code is only returned by the -i
                system scan argument.  Beginning with 41 where x is the
                beginning of the count of the number of devices.
        Anything else = unknown error

================
Tool Usage Hints
================
First, run the -i option to determine what /dev/sg? assignment lines up to your
disk drive. This option will also show you other details about the drive
including the current firmware revision. Like this:

ATA       /dev/sg0 MN: ST94813AS            SN: 3AA043KP          FW: 3.03
SEAGATE   /dev/sg1 MN: ST1000NM0011         SN: ZAA15VAS          FW: SN03

==============================================
Batch Modes: SAS or SATA
==============================================
For SAS, -m is a model number verification based on the device Inquiry
response. -m mode scans all sg devices on the system, so it is -- in itself --
a batch mode. The -d switch may be used with -m to select a specific device.

   seaflashlin -m <model_number> -f <fw_file>

Note: Use of -m mode is preferred for batch processing of sg (SCSI generic) SAS
disk drives.  While the -m model checking mode works on SATA disk drives you
should be careful to have the exact right firmware file.  Unlike SAS disk
drives, some SATA drives may have less intelligence for checking improper
firmware download.  Damage might result from the attempted application of the
wrong firmware on some SATA drives.

For SATA, the -c <cfs_file> is a Seagate-prepared compatible firmware selector
file which is used to match up the right firmware for a particular SATA drive.
Use -k <cfs_file> to test which files and drives are supported by a given CFS
file.  No actual firmware download takes place with the "dry run" -k argument.

   seaflashlin -c <cfs_file>

Each /dev/sg device will be reviewed for applicable firmware download. Various
messages are displayed depending on the review results like:
   Downloading file SATA-filename.lod to /dev/sg0
   /dev/sg1 [CC49] does not match any entries in filename.cfs
   /dev/sg2 [CC4H] firmware is up to date

Note: Batch processing of SATA drives should use a Seagate prepared CFS file.

Both of these batch modes assume that the relevant firmware files are located
in the current working directory.

Alternately, these two batch modes may be targeted to a specific device like so:
   seaflashlin -m <model_number> -f <fw_file> -d </dev/sg#>
   seaflashlin -c <cfs_file> -d </dev/sg#>

By specifying -f and -d, without the benefit of requiring a model match with -m
or utilizing a Seagate -c .CFS file, you may still force a SATA download
attempt on any /dev/sg device regardless of type or suitability. Obviously,
this use is not recommended for most situations, but is available if needed.

Multiple devices can be defined like this:
   seaflashlin -f <fw_file> -d </dev/sg#> -d </dev/sg#> -d </dev/sg#>

=====================
More Tool Usage Hints
=====================
Enumeration (IDENT INFO) is a scan of all sg devices in the system.  Use the -i
option to determine what /dev/sg? assignment lines up to your disk drive. This
option will also show you other details about the drive including the current
firmware revision. Like this:

ATA       /dev/sg0 MN: ST94813AS            SN: 3AA043KP          FW: 3.03
SEAGATE   /dev/sg1 MN: ST1000NM0011         SN: ZAA15VAS          FW: SN03
Seagate   /dev/sg2 MN: Backup+  SL          SN: NA365TE8          FW: A905

You may use the --enum argument in the case of Seagate USB storage devices to
review the specific details of a hard disk drive within the USB enclosure.
This is sometimes called the child drive.  The above example /dev/sg2 would
change to this display with --enum:

ATA       /dev/sg0 MN: ST94813AS            SN: 3AA043KP          FW: 3.03
SEAGATE   /dev/sg1 MN: ST1000NM0011         SN: ZAA15VAS          FW: SN03
Seagate   /dev/sg2 MN: ST1500LM HN-M151RAD  SN: S326J9ADC07171    FW: 2BC10001

The seaflashlin default segment size is 64 when not specified on the command
line.

Advanced SAS installations may use dual ports.  These are listed as Port 0 and
Port 1 on the device information report. When both ports are active, each one
may have a unique /dev/sg designation.  The scan option may indicate that there
are two drives in the system with the same serial number.

The -e Deferred SATA download is not supported by many drives as of 2013. Usage
is expected to increase over time.  The Deferred download stores the new
firmware in a temporary location on the drive and does not actually update the
firmware until the next power reset.

The -u Non-segmented download requires more memory which may or may not be
available to the sg driver. In some cases Linux will try and fail but the sg
driver may not generate any error.

Tests which alter the firmware or erase user data on the drive are limited to
Seagate-only products which include Seagate, Maxtor, Samsung and LaCie.

===================
General Usage Hints
===================
The tool will require root privileges to run using either sudo or su commands.
Also, verify that the tool has executable rights.

Remember that Linux file names and command line arguments are cAsE SeNsiTiVe.

Display a file listing with the Linux command: ls -lah

A dot slash is a dot followed immediately by a forward slash (./). It is used
in Linux to execute a compiled program in the current directory when it is not
a built-in command or found in your path.
For example, ./seaflashlin -f test.lod -d /dev/sg0

Shut down the files system and remove the power with the command:
poweroff

See previous screen history with the key combination:
shift+pgup or shift+pgdn

Save a log file by redirecting the screen output to a text file by adding space
&>test.log at the end of your command line. Choose your own file name. To
append the screen output to an existing log file use >>test.log.

To save a log and display results at the conclusion of the tests, you can use
the "tee" command. Tee command writes to the STDOUT and to a file.
For example,
seaflashlin -f test.lod -d /dev/sg0 | tee -a myTestLog.txt

Display a log or text file with the Linux "less" command: less myfile.log
Press the letter q to quit displaying the file.  Similarly, you can easily
read the Seagate License agreement by piping the output to the less
command with seaflashlin -l |less

Display a list of sg (SCSI generic) devices with the command:
cat /sys/class/scsi_generic/sg*/device/model
or
ls /dev/sg*

sg devices include the following interfaces: SATA, USB, SCSI (SCSI, SAS and FC)

When drives are not detected by SeaFlashLin
-------------------------------------------
The problem is that the sg driver isn't loaded on the system on boot.  You can
test if it is loaded by doing "ls /dev/sg*" and see if anything shows up. If
nothing shows up then the SG driver is missing (which is required by
SeaFlashLin to issue commands).

You need to do "modprobe sg" as root to load the sg module (since it wasn't
compiled into the kernel), then you will get sg devices that we can scan and
find. Once you run the modprobe command and sg is successfully loaded, then you
can re-run "ls /dev/sg*" and see SG device nodes. SeaFlashLin should then be
able to find devices once again.

========================
Raw Firmware Data Files
========================
You will need the Seagate firmware file to run the simple command line Linux
tool. This file will have the .LOD filename extension and should be located in
the current working directory. This firmware file should never be used outside
of the specific product family models and part numbers listed with the firmware
release. Incorrect usage of the .LOD may result in data loss or even product
failure. Seagate Technology is not responsible for lost user data. See the End
User License Agreement below for specific information about these software
tools.

For your convenience, a copy of the seaflashlin firmware download utility is
saved in the directory named 'linux cli tools'.  You may use this with your
native Linux OS.  Be sure to follow all cautions and backup all important data
before attempting to download firmware to the hard disk drive.

===============
Version History
===============
v0.3.8  18-Jun-2014  SAS support, Deferred download SATA, new response codes.
v0.4.0  28-Aug-2014  Scan now includes USB storage devices.
v0.4.1  30-Sep-2014  Add new response code to -i scan which gives a count of
                     devices.  Add the -k "dry run" argument to test SATA CFS
                     files. Add the -x <path> to designate alternate location
                     of the firmware files.
v0.4.2  27-Oct-2014  Refinements to SATA firmware download and final
                     verification.
v0.4.3  07-Nov-2014  Additional refinements to SATA firmware download and final
                     verification.
v0.4.4  07-Nov-2014  Added -o Timeout value (seconds).
v0.4.5  20-Aug-2015  Improved device discovery.
v0.4.6  26-Oct-2015  Fixed a bug in the config file parser that could cause a
                     segmentation fault.
v0.4.7  26-Jan-2016  Added improved error messages when using CFS file.
v0.4.8  22-Feb-2016  Improved the messages associated with the -m batch mode
                     option.

=================================
Support and Open Source Statement
=================================
SeaTools for Windows is available to download firmware to SAS drives, provided
they are not obscured by RAID controllers.

Seagate offers technical support for disk drive installation.  If you have any
questions related to Seagate products and technologies, feel free to submit
your request on our web site. See the web site for a list of world-wide
telephone numbers.

Seagate Support:
http://www.seagate.com/www/en-us/support/"
Contact Us:
http://www.seagate.com/www/en-us/about/contact_us"

This software uses open source packages obtained with permission from the
relevant parties. For a complete list of open source components, sources and
licenses, please see our Linux USB Boot Maker Utility FAQ for additional
information.

Linux USB Boot Maker FAQ:
http://support.seagate.com/firmware/usbbootmaker_faq.html

This product includes software developed by the OpenSSL Project for use in the
OpenSSL Toolkit (http://www.openssl.org/)

Copyright  2016 Seagate Technology LLC. All rights reserved.

======================================================================

                        END USER LICENSE AGREEMENT
                            FOR SEAGATE SOFTWARE


PLEASE READ THIS END USER LICENSE AGREEMENT ("EULA") CAREFULLY.  BY CLICKING
"I AGREE" OR TAKING ANY STEP TO DOWNLOAD, SET-UP, INSTALL OR USE ALL OR ANY
PORTION OF THIS PRODUCT (INCLUDING, BUT NOT LIMITED TO, THE SOFTWARE AND
ASSOCIATED FILES (THE "SOFTWARE"), HARDWARE ("HARDWARE"), DISK (S), OR OTHER
MEDIA) (COLLECTIVELY, THE "PRODUCT") YOU AND YOUR COMPANY ACCEPT ALL THE
TERMS AND CONDITIONS OF THIS EULA.  IF YOU ACQUIRE THIS PRODUCT FOR YOUR
COMPANYS USE, YOU REPRESENT THAT YOU ARE AN AUTHORIZED REPRESENTATIVE WHO
HAS THE AUTHORITY TO LEGALLY BIND YOUR COMPANY TO THIS EULA.  IF YOU DO NOT
AGREE, DO NOT CLICK "I AGREE" AND DO NOT DOWNLOAD, SET-UP, INSTALL OR USE THE
SOFTWARE.


1.  Ownership.  This EULA applies to the Software and Products of Seagate
Technology LLC and the affiliates controlled by, under common control with,
or controlling Seagate Technology LLC, including but not limited to
affiliates operating under the LaCie name or brand, (collectively, "Seagate",
"we", "us", "our").  Seagate and its suppliers own all right, title, and
interest in and to the Software, including all intellectual property rights
therein.  The Software is licensed, not sold.  The structure, organization,
and code of the Software are the valuable trade secrets and confidential
information of Seagate and its suppliers.  The Software is protected by
copyright and other intellectual property laws and treaties, including,
without limitation, the copyright laws of the United States and other
countries. The term "Software" does not refer to or include "Third-Party
Software".  "Third-Party Software" means certain software licensed by Seagate
from third parties that may be provided with the specific version of Software
that you have licensed.  The Third-Party Software is generally not governed
by the terms set forth below but is subject to different terms and conditions
imposed by the licensors of such Third-Party Software.  The terms of your use
of the Third-Party Software are subject to and governed by the respective
license terms, except that this Section 1 and Sections 5 and 6 of this
Agreement also govern your use of the Third-Party Software.  You may identify
and view the relevant licenses and/or notices for such Third-Party Software
for the Software you have received pursuant to this EULA at
http://www.seagate.com/support/by-topic/downloads/ , or at
http://www.lacie.com/support/ for LaCie branded product. You agree to comply
with the terms and conditions contained in all such Third-Party Software
licenses with respect to the applicable Third-Party Software. Where
applicable, the URLs for sites where you may obtain source code for the Third
Party Software can be found at
http://www.seagate.com/support/by-topic/downloads/, or at
http://www.lacie.com/support/ for LaCie branded product.

2.  Product License.  Subject to your compliance with the terms of this EULA,
Seagate grants you a personal, non-exclusive, non-transferable, limited
license to install and use one (1) copy of the Software on one (1) device
residing on your premises, internally and only for the purposes described in
the associated documentation. Use of some third party software included on
the media provided with the Product may be subject to terms and conditions of
a separate license agreement; this license agreement may be contained in a
"Read Me" file located on the media that accompanies that Product.  The
Software includes components that enable you to link to and use certain
services provided by third parties ("Third Party Services").  Your use of the
Third Party Services is subject to your agreement with the applicable third
party service provider.  Except as expressly stated herein, this EULA does
not grant you any intellectual property rights in the Product. Seagate and
its suppliers reserve all rights not expressly granted to you.  There are no
implied rights.

2.1     Software.  You are also permitted to make a single copy of the
Software strictly for backup and disaster recovery purposes.  You may not
alter or modify the Software or create a new installer for the Software.  The
Software is licensed and distributed by Seagate for use with its storage
products only, and may not be used with non-Seagate storage product.

3.  Restrictions.  You are not licensed to do any of the following:
        a.      Create derivative works based on the Product or any part or
                component thereof, including, but not limited to, the
                Software;

        b.      Reproduce the Product, in whole or in part;

        c.      Except as expressly authorized by Section 11 below, sell,
                assign, license, disclose, or otherwise transfer or make
                available the Product, in whole or in part, to any third
                party;

        d.      Alter, translate, decompile, or attempt to reverse engineer
                the Product or any part or component thereof, except and only
                to the extent that such activity is expressly permitted by
                applicable law notwithstanding this contractual prohibition;

        e.      Use the Product to provide services to third parties;

        f.      Take any actions that would cause the Software to become
                subject to any open source license agreement if it is not
                already subject to such an agreement; and

        g.      Remove or alter any proprietary notices or marks on the
                Product.

4.  Updates.  If you receive an update or an upgrade to, or a new version of,
any Software ("Update") you must possess a valid license to the previous
version in order to use the Update.  All Updates provided to you shall be
subject to the terms and conditions of this EULA.  If you receive an Update,
you may continue to use the previous version(s) of the Software in your
possession, custody or control.  Seagate shall have no obligation to support
the previous versions of the Software upon availability of an Update. Seagate
has no obligation to provide support, maintenance, Updates, or modifications
under this EULA.

5.  NO WARRANTY.  THE PRODUCT AND THE THIRD-PARTY SOFTWARE ARE OFFERED ON AN
"AS-IS" BASIS AND NO WARRANTY, EITHER EXPRESS OR IMPLIED, IS GIVEN.  SEAGATE
AND ITS SUPPLIERS EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND, WHETHER
STATUTORY, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON-INFRINGEMENT.  SEAGATE DOES NOT PROVIDE THE THIRD PARTY SERVICES AND
MAKES NO WARRANTIES WITH RESPECT TO THE THIRD PARTY SERVICES.  YOUR USE OF
THE THIRD PARTY SERVICES IS AT YOUR RISK.

6.  EXCLUSION OF INCIDENTAL, CONSEQUENTIAL, AND CERTAIN OTHER DAMAGES.  TO
THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL SEAGATE OR
ITS LICENSORS OR SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, PUNITIVE,
INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, BUT NOT LIMITED TO,
DAMAGES FOR LOSS OF PROFITS OR CONFIDENTIAL OR OTHER INFORMATION, FOR
BUSINESS INTERRUPTION, FOR PERSONAL INJURY, FOR LOSS OF PRIVACY, FOR FAILURE
TO MEET ANY DUTY INCLUDING OF GOOD FAITH OR REASONABLE CARE, FOR NEGLIGENCE,
AND FOR ANY OTHER PECUNIARY OR OTHER LOSS WHATSOEVER) ARISING OUT OF OR IN
ANY WAY RELATED TO THE USE OF OR INABILITY TO USE THE PRODUCT OR ANY PART OR
COMPONENT THEREOF OR RELATED SERVICE OR ANY THIRD PARTY SERVICES, OR
OTHERWISE UNDER OR IN CONNECTION WITH ANY PROVISION OF THE EULA, EVEN IN THE
EVENT OF THE FAULT, TORT (INCLUDING NEGLIGENCE), MISREPRESENTATION, STRICT
LIABILITY, BREACH OF CONTRACT, OR BREACH OF WARRANTY OF SEAGATE OR ITS
LICENSORS OR SUPPLIERS, AND EVEN IF SEAGATE OR ITS LICENSOR OR SUPPLIER HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING ANY
FAILURE OF THE ESSENTIAL PURPOSE OF THIS AGREEMENT OR ANY REMEDY.

7.  LIMITATION OF LIABILITY.  NOTWITHSTANDING ANY DAMAGES THAT YOU MIGHT
INCUR FOR ANY REASON WHATSOEVER, THE ENTIRE LIABILITY OF SEAGATE UNDER ANY
PROVISION OF THIS EULA AND YOUR EXCLUSIVE REMEDY HEREUNDER SHALL BE LIMITED
TO, AND IN NO EVENT WILL SEAGATE'S TOTAL CUMULATIVE DAMAGES EXCEED, THE FEES
PAID BY THE LICENSEE TO SEAGATE FOR THE PRODUCT.  ADDITIONALLY, IN NO EVENT
SHALL SEAGATE'S LICENSORS OR SUPPLIERS BE LIABLE FOR ANY DAMAGES OF ANY KIND.

8.  Privacy.  Seagates collection, use and disclosure of personally
identifiable information in connection with your use of the Product is
governed by Seagates Privacy Policy which is located at
http://www.seagate.com/legal-privacy/privacy-policy/As further described in
Seagates Privacy Policy, certain Products may include a Product dashboard
which allows users to manage Product settings, including but not limited to
use of anonymous statistical usage data in connection with personally
identifiable information. You agree to Seagates collection, use, and
disclosure of your data in accordance with the Product dashboard settings
selected by you for the Product, or in the case of transfer as described in
Section 11, you agree to the settings selected by the prior licensee unless
or until you make changes to the settings.

9.  Indemnification.  By accepting the EULA, you agree to indemnify and
otherwise hold harmless Seagate, its officers, employees, agents,
subsidiaries, affiliates, and other partners from any direct, indirect,
incidental, special, consequential or exemplary damages arising out of,
relating to, or resulting from your use of the Product or any other matter
relating to the Product, including, without limitation, use of any of the
Third Party Services.

10.  International Trade Compliance.  The Software and any related technical
data made available for download under this EULA are subject to the customs
and export control laws and regulations of the United States ("U.S.") and may
also be subject to the customs and export laws and regulations of the country
in which the download is contemplated.  Further, under U.S. law, the Software
and any related technical data made available for download under this EULA
may not be sold, leased or otherwise transferred to restricted countries, or
used by a restricted end-user (as determined on any one of the U.S.
government restricted parties lists, found at
http://www.bis.doc.gov/complianceandenforcement/liststocheck.htm) or an
end-user engaged in activities related to weapons of mass destruction
including, without limitation, activities related to designing, developing,
producing or using nuclear weapons, materials, or facilities, missiles or
supporting missile projects, or chemical or biological weapons.  You
acknowledge that you are not a citizen, national, or resident of, and are not
under control of the governments of Cuba, Iran, North Korea, Sudan or Syria;
are not otherwise a restricted end-user as defined by U.S. export control
laws; and are not engaged in proliferation activities.  Further, you
acknowledge that you will not download or otherwise export or re-export the
Software or any related technical data directly or indirectly to the
above-mentioned countries or to citizens, nationals, or residents of those
countries, or to any other restricted end user or for any restricted end-use.

11.  General.  This EULA between Licensee and Seagate is governed by and
construed in accordance with the laws of the State of California without
regard to conflict of laws principles.  The EULA constitutes the entire
agreement between Seagate and you relating to the Product and governs your
use of the Product, superseding any prior agreement between you and Seagate
relating to the subject matter hereof.  If any provision of this EULA is held
by a court of competent jurisdiction to be contrary to law, such provision
will be changed and interpreted so as to best accomplish the objectives of
the original provision to the fullest extent allowed by law and the remaining
provisions of the EULA will remain in force and effect.  The Product and any
related technical data are provided with restricted rights.  Use,
duplication, or disclosure by the U.S. government is subject to the
restrictions as set forth in subparagraph (c)(1)(iii) of DFARS 252.227-7013
(The Rights in Technical Data and Computer Product) or subparagraphs (c)(1)
and (2) of 48 CFR 52.227-19 (Commercial Computer Product - Restricted
Rights), as applicable.  The manufacturer is Seagate.  You may not transfer
or assign this EULA or any rights under this EULA, except that you may make a
one-time, permanent transfer of this EULA and the Software to another end
user, provided that (i) you do not retain any copies of the Software, the
Hardware, the media and printed materials, Upgrades (if any), and this EULA,
and (ii) prior to the transfer, the end user receiving this EULA and the
Software agrees to all the EULA terms.  Any attempted assignment in violation
of this Section is void.  Seagate, the Seagate logo, and other Seagate names
and logos are the trademarks of Seagate.

5.4.2016

===========================================================================

GNU LESSER GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright (c) 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.

This version of the GNU Lesser General Public License incorporates the terms
and conditions of version 3 of the GNU General Public License, supplemented
by the additional permissions listed below.

0. Additional Definitions.

As used herein, "this License" refers to version 3 of the GNU Lesser General
Public License, and the "GNU GPL" refers to version 3 of the GNU General
Public License.

"The Library" refers to a covered work governed by this License, other than
an Application or a Combined Work as defined below.

An "Application" is any work that makes use of an interface provided by the
Library, but which is not otherwise based on the Library. Defining a subclass
of a class defined by the Library is deemed a mode of using an interface
provided by the Library.

A "Combined Work" is a work produced by combining or linking an Application
with the Library. The particular version of the Library with which the
Combined Work was made is also called the "Linked Version".

The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code for
portions of the Combined Work that, considered in isolation, are based on the
Application, and not on the Linked Version.

The "Corresponding Application Code" for a Combined Work means the object
code and/or source code for the Application, including any data and utility
programs needed for reproducing the Combined Work from the Application, but
excluding the System Libraries of the Combined Work.

1. Exception to Section 3 of the GNU GPL.

You may convey a covered work under sections 3 and 4 of this License without
being bound by section 3 of the GNU GPL.

2. Conveying Modified Versions.

If you modify a copy of the Library, and, in your modifications, a facility
refers to a function or data to be supplied by an Application that uses the
facility (other than as an argument passed when the facility is invoked),
then you may convey a copy of the modified version:

* a) under this License, provided that you make a good faith effort to ensure
that, in the event an Application does not supply the function or data, the
facility still operates, and performs whatever part of its purpose remains
meaningful, or

* b) under the GNU GPL, with none of the additional permissions of this
License applicable to that copy.

3. Object Code Incorporating Material from Library Header Files.

The object code form of an Application may incorporate material from a header
file that is part of the Library. You may convey such object code under terms
of your choice, provided that, if the incorporated material is not limited to
numerical parameters, data structure layouts and accessors, or small macros,
inline functions and templates (ten or fewer lines in length), you do both of
the following:

* a) Give prominent notice with each copy of the object code that the Library
is used in it and that the Library and its use are covered by this License.

* b) Accompany the object code with a copy of the GNU GPL and this license
document.

4. Combined Works.

You may convey a Combined Work under terms of your choice that, taken
together, effectively do not restrict modification of the portions of the
Library contained in the Combined Work and reverse engineering for debugging
such modifications, if you also do each of the following:

* a) Give prominent notice with each copy of the Combined Work that the
Library is used in it and that the Library and its use are covered by this
License.

* b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.

* c) For a Combined Work that displays copyright notices during execution,
include the copyright notice for the Library among these notices, as well as
a reference directing the user to the copies of the GNU GPL and this license
document.

* d) Do one of the following:
  o 0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form suitable for, and
under terms that permit, the user to recombine or relink the Application
with a modified version of the Linked Version to produce a modified
Combined Work, in the manner specified by section 6 of the GNU GPL for
conveying Corresponding Source.
  o 1) Use a suitable shared library mechanism for linking with the Library.
A suitable mechanism is one that (a) uses at run time a copy of the Library
already present on the user's computer system, and (b) will operate
properly with a modified version of the Library that is
interface-compatible with the Linked Version.

* e) Provide Installation Information, but only if you would otherwise be
required to provide such information under section 6 of the GNU GPL, and only
to the extent that such information is necessary to install and execute a
modified version of the Combined Work produced by recombining or relinking
the Application with a modified version of the Linked Version. (If you use
option 4d0, the Installation Information must accompany the Minimal
Corresponding Source and Corresponding Application Code. If you use option
4d1, you must provide the Installation Information in the manner specified by
section 6 of the GNU GPL for conveying Corresponding Source.)

5. Combined Libraries.

You may place library facilities that are a work based on the Library side by
side in a single library together with other library facilities that are not
Applications and are not covered by this License, and convey such a combined
library under terms of your choice, if you do both of the following:

* a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities, conveyed under the
terms of this License.

* b) Give prominent notice with the combined library that part of it is a
work based on the Library, and explaining where to find the accompanying
uncombined form of the same work.

6. Revised Versions of the GNU Lesser General Public License.

The Free Software Foundation may publish revised and/or new versions of the
GNU Lesser General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number. If the Library as you
received it specifies that a certain numbered version of the GNU Lesser
General Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that published version
or of any later version published by the Free Software Foundation. If the
Library as you received it does not specify a version number of the GNU
Lesser General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.

If the Library as you received it specifies that a proxy can decide whether
future versions of the GNU Lesser General Public License shall apply, that
proxy's public statement of acceptance of any version is permanent
authorization for you to choose that version for the Library.
