LDP/LDP/howto/docbook/Scanner-HOWTO.sgml

1484 lines
68 KiB
Plaintext

<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
<article>
<!-- Header -->
<artheader>
<!-- title of HOWTO, include the word HOWTO -->
<title>The Scanner HOWTO</title>
<author><firstname>Howard</firstname><surname>Shane</surname>
<affiliation>
<address><email>hshane[AT]austin.rr.com</email></address>
</affiliation>
</author>
<!--revision history-->
<revhistory>
<revision>
<revnumber>1.1</revnumber>
<date>2004-05-16</date>
<authorinitials>jhs</authorinitials>
<revremark>Libusb and kernel 2.6-series updates, clarifications</revremark>
</revision>
<revision>
<revnumber>1.05</revnumber>
<date>2004-01-15</date>
<authorinitials>jhs</authorinitials>
<revremark>Miscellaneous errata and updates</revremark>
</revision>
<revision>
<revnumber>1.0</revnumber>
<date>2003-08-19</date>
<authorinitials>tm</authorinitials>
<revremark>Initial release, reviewed by LDP</revremark>
</revision>
<revision>
<revnumber>0.04</revnumber>
<date>07-03</date>
<authorinitials>jhs</authorinitials>
<revremark>Clarified, revised and edited after inviting feedback from participants of the SANE-devel mailing list</revremark>
</revision>
<revision>
<revnumber>0.01</revnumber>
<date>06-03</date>
<authorinitials>jhs</authorinitials>
<revremark>Completed draft.</revremark>
</revision>
</revhistory>
<!-- additional (*earlier*) revision histories go here, if any -->
<!--abstract-->
<abstract>
<indexterm>
<primary>Scanner</primary>
</indexterm>
<para>
This document was written to document the steps necessary for access and use of a photographic scanner device on a system running Linux.
</para>
</abstract>
</artheader>
<!-- Section1: intro -->
<sect1 id="intro">
<title>Introduction</title>
<indexterm><primary>>disk!introduction</primary></indexterm>
<para>
This document was written to assist the Linux user in setting up a raster image scanner device, including flatbed, hand-held, video- and still-cameras, frame-grabbers and so on.
It does not address how to use the available software tools to achieve a particular photographic result or to utilize your scanner device's features to the fullest extent.
For that information please consult the application home pages referenced in the text and the manufacturer's information that accompanied your hardware.
</para>
<para>
Finally, this document does not answer the question <quote>What type of scanner should I buy?</quote>
The answer varies depending on what you are looking for in a scanner device.
I suggest looking at the supported hardware list link in <xref linkend="interfaces"> and also <ulink url="http://www.xs4all.nl/~ljm/SANE-faq.html#buying">this link</ulink> within the SANE-project FAQ.</para>
<!-- Section2: copyright -->
<sect2 id="copyright">
<title>Copyright Information</title>
<para>
This document is Copyright 2004 Howard Shane.
</para>
<para>
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license can be found in <xref linkend="gfdpl">.
</para>
</sect2>
<sect2 id="disclaimer">
<title>Disclaimer</title>
<para>
No liability for the contents of this document can be accepted.
Use the concepts, examples and other content entirely at your own risk.
As this is a new edition, there may be technical or other inaccuracies that may result in system failure, destruction of your hardware and the loss of your irreplaceable data.
Proceed with caution and be aware that although errors are unlikely, the author can nonetheless accept no responsibility whatsoever for them.
</para>
<para>
All copyrights are held by their by their respective owners, unless specifically noted otherwise.
Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark.
</para>
<para>
Naming of particular products or brands should not be seen as endorsements.
</para>
</sect2>
<sect2 id="newversions">
<title>New Versions</title>
<indexterm>
<primary>(your index root)!news on</primary>
</indexterm>
<para>
This is the initial release.
</para>
<para>
The latest version of this document can be found <ulink url="http://www.hshanemd.net/docs/HOWTOS/Scanner/"> here</ulink>.</para>
</sect2>
<!-- Section2: credits -->
<sect2 id="credits">
<title>Credits</title>
<para>
I would like to thank Oliver Rauch, Henning Meier-Geinitz, Jonathan Buzzard, Laurent-jan, Jochen Eisinger and others who participate in SANE development and/or contribute to the SANE-devel mailing list, without whose input this project would have been difficult if not impossible to perform with any measure of quality-control. I would also like to thank the many individuals who have taken the time to email me new information and corrections.</para>
<para>
Also I would like to thank Marla for graciously tolerating all the time I've spent banging on the keyboard working on projects such as this.
You're the greatest.
</para>
</sect2>
<sect2 id="feedback">
<title>Feedback</title>
<para>
Please send any additions or comments pertaining to this document to the following email address : <email>hshane[AT]austin.rr.com</email>.
As this is the first release I am particularly interested in any errata, so don't hesitate to contact me if you know of something I have wrong or needing updating.
Also let me know if you know of any shortcuts, tools or bits of information that may help hapless users that you think should be included.
I apologize in advance, but I cannot answer any technical questions or <quote>plz help me</quote> pleas regarding scanners; any sent my way will be forwarded to <filename>/dev/null</filename>; for sources of assistance including live help see <xref linkend="lists"> instead, but only after reading the relevant sections of this document in their entirety.
I am neither an expert on scanners nor do I have every model of scanner ever manufactured available for testing.
My only contribution to scanner support within Linux is the compiling of my own limited experience with the exhaustive input of others to produce a succinct but (hopefully) straightforward HOWTO.
</para>
</sect2>
<sect2 id="conventions">
<title>Conventions Used in this Document</title>
<para>
The following conventions are used in this document and are outlined here for those who may not yet have a complete understanding of how to access and control the underlying operating system in Linux, which is almost always via the Bash shell.</para>
<para>
First, filenames are referenced in a paragraph like so: <filename>/path/file</filename></para>
<para>
Commands in Linux are executed (or 'called') at the command prompt, otherwise known as the 'command line.'
If you are in the non-graphical (text-based) environment you will usually be presented the Bash shell prompt which is a dollar sign: <screen>$</screen>...or the hash mark: <screen>#</screen>...if you have logged in as root or have acquired root, or 'superuser' privileges.
You can also access the Bash shell in the X window system, otherwise known as X or X11, with an <ulink url="http://invisible-island.net/xterm/">xterm</ulink> or similar X-terminal-emulator.
Commands to be performed at the Bash prompt, but referenced in a paragraph of this document, usually look like this: <command>do this now</command>
</para>
<para>
Commands and/or the resulting output of commands may also be outlined with screen output in their own paragraph or heading:</para>
<para>
<screen>$ date
Sun Jul 27 22:37:11 CDT 2003</screen></para>
<para>
When a command is written in front of the Bash prompt (e.g. <command>$ date</command> above), it is assumed the [Return] or [Enter] key has been depressed after the command, possibly followed by the output (e.g., the date).</para>
</sect2>
</sect1>
<!-- Section1: intro: END -->
<!-- Section1 begins-->
<sect1 id="interfaces">
<title>General Support and Interface Type</title>
<para>
There are four predominant types of scanner interfaces available and discussed in this document: SCSI, USB, parallel port, IEEE 1394.
Linux support exists for most scanners as pioneered by the <ulink url="http://www.sane-project.org/">SANE</ulink> project.
This is not the same thing as <ulink url="http://www.twain.org/index.html">TWAIN</ulink>, which you may be familiar with if you have used a scanner device under another operating system such as <trademark>Microsoft Windows</trademark>.
The latter protocol weds driver and user interface in a way that does not allow its use outside of that proprietary graphical environment.
Thus SANE, or Scanner Access Now Easy, was conceived for use under (but is by no means limited to) the Un*x environment.
The SANE standard allows for modularity where driver meets application and allows for much greater flexibility and portability.
With SANE you can scan with your device using only the command line, you can design your own front-end application to use the SANE backend(s), access your scanner(s) over a network or even access your cameras and other <ulink url="http://www.thedirks.org/v4l2/">video4linux</ulink> devices to acquire photographs.
As such SANE is SANE where TWAIN is not.
</para>
<para><emphasis>NOTE: Before reading any further you should check the SANE homepage at <ulink url="http://www.sane-project.org/sane-mfgs.html">http://www.sane-project.org/sane-mfgs.html</ulink> to see if your scanner device is supported.
Alternatively you can use the <ulink url="http://www.sane-project.org/cgi-bin/driver.pl">sane supported scanners search engine</ulink>.</emphasis>
</para>
<para>
If you have an integrated device, i.e., one that functions as a scanner, printer and/or fax, you can follow the steps below for the scanner functions using the appropriate interface just like a standard scanner.
Those who own an HP officejet should consult <ulink url="http://hpoj.sourceforge.net/"> the HP Officejet Linux Driver project site,</ulink> which goes into excellent detail on how to get the various functions of this integrated device to work within Linux.</para>
<sect2 id="scsi-type">
<title>SCSI Scanners</title>
<para>
These scanners are managed by an SCSI controller.
In general, just about any scanner using an SCSI interface should work assuming the SCSI hardware is supported.
You should check the <ulink url="http://tldp.org/HOWTO/Hardware-HOWTO/scsi.html">SCSI controller list of the Hardware HOWTO</ulink> if you are unsure if the SCSI controller is supported.
If your SCSI controller came bundled with your scanner there is a chance your hardware may not be supported or is only partly supported, as the accompanying SCSI card may not function as a complete SCSI controller.
</para>
<para>
You should consult <command>man sane-scsi</command>, if you run into difficulty configuring your SCSI scanner at any point.</para>
</sect2>
<sect2 id="usb-type">
<title>USB Scanners</title>
<para>
You probably already know what a Universal Serial Bus (USB) connector looks like and where it plugs in.
If you have a USB scanner your hardware is likely to be supported in Linux.
Information on enabling the USB subsystem and USB scanner support is found in <xref linkend="ossupport">.
</para>
</sect2>
<sect2 id="parport-type">
<title>Parallel Port Scanners</title>
<para>Parallel-port scanners on the whole can be made to work if there is a backend that supports them, however if your device also has a USB port (which the vast majority of new scanners released nowadays do) and a working USB backend you are strongly encouraged to use that instead, as it may be more easily configured.
</para>
<para>
If your model has only a parallel-port interface and a proprietary or non-standard controller you could be out of luck. If you have found there is a supported backend for the parallel-port interface of your scanner, then you should see <xref LinkEnd="parport-general">.
</para>
</sect2>
<sect2 id="IEEE1394">
<title>IEEE 1394 (<trademark>Firewire</trademark>, <trademark>i.Link</trademark>)</title>
<para>
Some IEEE 1394 scanners are supported as of the time of this writing, particularly those manufactured by Nikon and Epson.
The IEEE 1394 interface has been supported since the 2.4-series Linux kernel. IEEE 1394 scanners require your system be equipped with a IEEE 1394 PCI card or a mainboard IEEE 1394 port, as well as have IEEE 1394 support enabled in your kernel or as a loaded module.
You should check the SANE supported devices by manufacturer link in <xref linkend="interfaces"> and read the manpage next to your hardware (if any) for any issues related to your specific hardware.</para>
</sect2>
<sect2 id="ossupport">
<title>Operating System Support</title>
<para>If you don't have a USB scanner you should skip to <xref linkend="kernel">, and if your equipment is of the parallel port variety you should go to <xref linkend="parport-general">.</para>
</sect2>
<sect2 id="libusb">
<title>USB Scanners and Libusb</title>
<para>
This section was at one time entitled <quote>USB Scanner Kernel Support,</quote> but the existence of <ulink url="http://libusb.sourceforge.net/">libusb</ulink> promises to make the need for a USB-scanner enabled kernel unnecessary. Libusb is a project to create a userspace (i.e., non-kernel) library to access USB devices regardless of operating system.
For more information on the differences between these consult <command>man sane-usb</command>.
</para>
<para>
If you would prefer the more conventional kernel support for your USB Scanner, go on to <xref linkend="usb-kernel">, but be advised that kernel support for USB scanner devices is dropped in favor of libusb in kernel version 2.6.0 and higher.
Most distributions at this point are offering libusb in their stable branches (and some install it by default), so if you don't already have kernel support for USB scanner devices then you may only have to install the libusb package in order to access your device.
You must have USB device filesystem support enabled in your kernel, which most distributions do.
To find out for sure, issue the following at the command line:
</para>
<para>
<screen>$ cat /proc/filesystems</screen>
</para>
<para>
You should see (among others):</para>
<para><screen>
nodev usbdevfs
nodev usbfs</screen></para>
<para>
You may need to mount usbdevfs to enable it and see the device files, which you can do at the command line with <command>mount -t usbdevfs none /proc/bus/usb</command>.
Don't try to use libusb while <emphasis>kernel</emphasis> scanner support is enabled either statically or the module loaded; you can only use one at a time.</para>
<para>
You can obtain the libusb package in <filename>.rpm</filename>, <filename>.tgz</filename> or <filename>.deb</filename> format from your Linux distribution.
If you are planning on compiling your own SANE binary from source with libusb support enabled you will require the <filename>libusb-dev</filename> package as well.</para>
</sect2>
<sect2 id="kernel">
<title>Linux Kernel Support of your Scanner Device</title>
<para>Kernel support is required for SCSI, USB and parallel-port generic interface support and USB scanner support (if not using libusb).
Your stock kernel may already have support for what you need, and the way to tell is to use the <command>dmesg</command> command and look for an acknowledgement that the driver in question loaded at bootup.
If you don't see it, the driver may be present (but not necessarily loaded) as a module.
To find out you can type the following at the command line:</para>
<para>
<screen> $ ls -R /lib/modules/X.XX/kernel/drivers </screen></para>
<para>Where 'X.XX' is your kernel version number.
The following output is an example of what you would find in a USB scanner-enabled kernel (though all but the relevant lines have been edited for brevity):</para>
<para>
<screen>
./usb:
scanner.o
usbcore.o
</screen></para>
<para>
<emphasis>(A hint for newbies: if the info in dmesg or the above module list scrolls by too fast, you might try piping the output into 'less' (or 'more' if you don't have less): <command>ls -R /lib/modules/X.XX/kernel/drivers | less </command> or alternatively catching it in a file: <command>ls -R /lib/modules/X.XX/kernel/drivers > file.txt</command>, where 'file.txt' will contain the info that can then be accessed with <command>cat [file] | less</command>.)</emphasis>
</para>
<para>The following information is arranged on the basis of scanner interface type.
If your kernel doesn't contain the necessary support, you can always recompile your kernel.
If you are unfamiliar with the process of compiling your own kernel, I direct you to the <ulink url="http://www.tldp.org/HOWTO/Kernel-HOWTO.html">Kernel HOWTO</ulink> for more information.
</para>
<sect3 id="scsi-kernel">
<title>Kernel SCSI Support</title>
<para>
If you have an SCSI-type interface, when invoking <command>make config</command>, <command>make menuconfig</command> or <command>make xconfig</command> etc., be aware that in addition to the option to support your particular SCSI adapter, generic SCSI device support is also required.
Such generic devices are usually named <command>/dev/sg0, /dev/sg1</command>....
Since you probably already know if your card is supported from the <ulink url="http://tldp.org/HOWTO/Hardware-HOWTO/scsi.html">supported SCSI controllers list</ulink>, all that is required after confirming that your kernel supports your hardware and generic SCSI devices is to load the appropriate module(s):
</para>
<para><screen># modprobe CARD_MODULE_NAME</screen></para>
<para><screen># modprobe sg</screen></para>
<para>
...as root. Note there have been reports of ide-scsi emulation support (used for ATAPI-eide CDRW support) causing problems for scanner access; if you know your hardware is supported and you can't get things to work try unloading the ide-scsi module:</para>
<para><screen>rmmod ide-scsi</screen></para>
<para>...though it has been reported to me that this has been fixed as of recent (2.4.20+) kernels.</para>
</sect3>
<sect3 id="usb-kernel">
<title>Kernel USB and USB Scanner Support</title>
<para>
For USB scanner support, you will need USB subsystem support in your kernel, whether usb-ohci, usb-ehci, or whatever protocol of USB driver your system prefers.
USB support has been present in the Linux kernel since the late 2.2-series.
For a more in-depth discussion of USB support in general, I direct you to the <ulink url="http://www.linux-usb.org/">linux-usb project site</ulink>.
If you have a 2.4-series of kernel or earlier and wish to use the kernel USB-scanner support to access your scanner (instead of libusb outlined in <xref linkend="libusb">) you will need to have 'USB scanner support' enabled, which, if present, is visible within <command>dmesg</command>, or by <command>lsmod</command> if a loaded module.
If you want to find out which modules are loaded, at the command line or in an xterm type the following:
</para>
<para>
<screen># lsmod</screen></para>
<para>
As shown by the prompt above you will need to have root privileges to do this.
You should get output including (but not limited to) the following:
</para>
<para><screen>cdrom 29312 0 (autoclean) [sr_mod]
usb-ohci 17888 0 (unused)
usbcore 56768 0 [scanner ibmcam usbvideo usb-ohci]
scanner 8704 0 </screen>
</para>
<para>If you don't have <filename>scanner</filename> loaded, and you know you have USB scanner support in your kernel as a module, try loading it directly:</para>
<para><screen># modprobe -v scanner</screen></para>
<para>...at which point you should see something like the following:</para>
<para><screen>Using /lib/modules/2.4.20/kernel/drivers/usb/scanner.o</screen></para>
<para>By placing the entry <filename>scanner</filename> in <filename>/etc/modules</filename> (note that this varies by distribution), you can have the module load at boot-time automatically.
You can then confirm the module was loaded by checking the syslog or in the boot-time record with <command>dmesg | less</command>), where you should see an entry such as the following:
</para>
<para><screen>
May 16 23:17:25 K7 kernel: usb.c: registered new driver usbscanner
May 16 23:17:25 K7 kernel: scanner.c: 0.4.6:USB Scanner Driver
</screen></para>
</sect3>
</sect2>
<sect2 id="parport-general">
<title>Parallel Port Scanners</title>
<para>
By now you've probably figured out that configuration of parallel port scanners may be problematic.
Again, if your device has both a parallel port interface and a USB interface you should consider selecting USB to make the setup process easier.
</para>
<sect3 id="parport-kernel">
<title>Kernel Parport Support</title>
<para>
For 2.2 and 2.4 kernel systems, parallel-port support must be enabled statically or as a module (stock kernels usually have this enabled by default).
You may want to read <ulink url="http://www.torque.net/linux-pp.html">more generic info about parallel-port device support under the Linux kernel</ulink> before starting this process.
To find out for sure if the module <filename>parport</filename> is loaded you can check the <filename>dmesg</filename> file or use <command> lsmod </command> as outlined above.
Using <command>dmesg | less</command> you should see (among many other lines) the following:
</para>
<para><screen>
Mar 3 08:00:25 K7 kernel: parport0: PC-style at 0x378 (0x778) [PCSPP,TRISTATE]
Mar 3 08:00:25 K7 kernel: parport0: irq 7 detected
</screen></para>
<para>If you are compiling your own kernel, enable 'Parallel Port support.'
You should enable 'IEEE 1284 transfer modes,' and if you have x86 type architecture you should also enable 'PC-style hardware.'
</para>
<para>
If modprobe returns an error when you attempt to load the module note that you may need to determine and supply the hardware address when invoking <command>modprobe</command>.
The most common address is 0x378 for an x86 system; 0x278 and 0x3BC are other possibilities for integrated or ISA parallel ports.
Add-in PCI parallel ports may have unusual base addresses.
One can also arrange multiple devices with either the parport_pc or parport_arc modules, though that topic is beyond the scope of this document.
WARNING: Be sure you have the correct address before entering this information at the command line or else your machine may become unstable, crash or otherwise implode.
</para>
<para>
Your parallel port should be set to preferably <quote>EPP</quote> mode, or alternatively ECP/EPP.
<quote>Bidirectional</quote> (also known as <quote>BPP</quote> or <quote>PS/2</quote>) may work, albeit much more slowly.
<quote>Unidirectional</quote> mode is unsuitable for scanning.
The above setting can usually be accessed through your BIOS menu, at least on x86 systems.</para>
<para>
Depending on whether your parallel port scanner requires SCSI support, you may need to patch your kernel for parport-SCSI support.
You can find that suite of tools at <ulink url="http://www.torque.net/parport/ppscsi.html">www.torque.net/parport/ppscsi.html</ulink>. If this is required you will also need to enable the following:
</para>
<para>
<itemizedlist>
<listitem>
<para>
SCSI support
</para>
</listitem>
<listitem>
<para>
SCSI generic support
</para>
</listitem>
<listitem>
<para>
Support for the core module of your ppSCSI controller (t348 for the APA-348 and T348, t358 for the APA-358 and T358, epsa2 for the older Shuttle EPSA-2, epst for the Shuttle EPST and APA-1350, onscsi for the OnSpec 90c26, and sparcsi for the SparCSI and ParaSCSI)
</para>
</listitem>
</itemizedlist>
</para>
<para>Once these are compiled in, it's simply a matter of loading the appropriate modules.
</para>
</sect3>
</sect2>
</sect1>
<sect1 id="dev-intro">
<title>Making and Accessing the Scanner Devices</title>
<para>
The following section applies to all hardware types.
Some specifics with regard to scanner interface types are mentioned in the paragraphs at the end of this section.</para>
<sect2 id="devfsd">
<title>Device Filesystem and Udev</title>
<para>
<ulink url="http://www.atnf.csiro.au/~rgooch/linux/docs/devfs.html">Devfs</ulink>, or 'device filesystem' has been an option in the Linux kernel since the late 2.2-series.
Devfsd, the device filesystem daemon, creates and removes devices on your system dynamically without the need to manually create devices. If you are running devfsd/devfs you can probably skip the following sections as the process of creating device nodes will be done for you and it's simply a matter of finding the appropriate device node in <filename>/dev</filename>.
</para>
<para>
Devfs does not obviate the need to change permissions of devices for access by users.</para>
<para>
Beginning in the 2.6-series kernel devfs has been deprecated in favor of a userspace daemon known as udev, though devfs remains as an option.
You can find information on udev <ulink url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ">here</ulink>.
</para>
</sect2>
<sect2 id="dev-manual">
<title>Creating Devices Manually</title>
<para>If you are running a system with correctly configured devfs, udev or libusb, you can skip this step and go to <xref linkend="SANE">.
There are two ways to accomplish the creation of necessary devices manually. One is to use <command>MAKEDEV</command> and the other is to create the device nodes at the command line.
</para>
<para>
The <command>MAKEDEV</command> script is the easier of the two methods, the executable of which may be located in <filename>/dev</filename> or the usual places for storing binary executables (<filename>/bin</filename>,<filename>/sbin</filename> and so on).
I direct you to <command>man MAKEDEV</command>, and would caution you to pay attention to the device-specific command options so that you can be sure the major and minor numbers are correct (see the next paragraph for more on this and why it is important, especially if <command>MAKEDEV</command> doesn't work or you prefer doing things the hard way).</para>
<para>A device can be created as a block (such as a drive), a fifo (file-in-file-out or pipe, as in xconsole) or a character device, which represents other hardware.
Each device has a major and a minor number <quote>coordinate</quote> to tell the kernel what it is and where to access it.
These numbers are not arbitrary.</para>
<sect3 id="scsi-manual-dev">
<title>SCSI Devices</title><para>
If you are running a 2.4-series kernel you should consider becoming familiar with <ulink url="http://tldp.org/HOWTO/SCSI-2.4-HOWTO/mlproc.html">SCSI proc interface access</ulink>, and whichever kernel you are running, you should read <command>man sane-scsi</command> before reading further.
When the system boots up, generic SCSI device files are mapped on <filename>/dev/sgN</filename>, where N is a numeric value starting at zero.
The major and minor numbers for SCSI devices are 21 and 0,1,2,3... respectively.
You can find out what devices are loaded already with <command>ls -l /dev/sg*</command>, which should yield output similar to this:</para>
<para><screen>
crw------- 1 root sys 21, 0 Jan 06 2003 /dev/sg0
crw------- 1 root sys 21, 0 Jan 06 2003 /dev/sg1
crw------- 1 root sys 21, 0 Jan 06 2003 /dev/sg2
crw------- 1 root sys 21, 0 Jan 06 2003 /dev/sg3
crw------- 1 root sys 21, 0 Jan 06 2003 /dev/sg4
crw------- 1 root sys 21, 0 Jan 06 2003 /dev/sg5
</screen></para>
<para>
You will need to make a <filename>/dev/scanner</filename> symbolic link to an existing device (for reasons clarified later).
For example, if your scanner is connected to the first scsi-bus (and lun and target) of your SCSI host device, you should link it to the corresponding device:
</para>
<para><screen>
# ln -s /dev/sg0 /dev/scanner
</screen></para>
</sect3>
<sect3 id="usb-manual">
<title>Manually creating USB Devices</title>
<para>
Again, you can skip this step if using libusb.
USB scanner devices have the major number 180 and minor 48, 49, etc., up to 63.
First, check <filename>/dev</filename> to see what directory your distribution lays out its USB directory devices in, as some distributions might have these devices <filename>scanner0, scanner1...</filename>etc., within <filename>/dev/usb</filename> or as <filename>usbscanner0, usbscanner1...</filename> and so on, in the base <filename>/dev/</filename> directory.
If you find that in the <filename>/dev/</filename> directory the scanner devices have already been made for you then your work is done.
If not, you will need to create them yourself.
As root, make a character device for your scanner like so:</para>
<para><screen># mknod /dev/usbscanner0 c 180 48
</screen></para>
<para>...or if your distribution has a '/dev/usb' subdirectory:</para>
<para><screen># mknod /dev/usb/scanner0 c 180 48
</screen></para>
</sect3>
<sect3 id="parport-manual">
<title>Manually creating Parallel Port Devices</title>
<para>
Follow the example outlined in the above section to create the following generic parport devices:</para>
<para><screen>
crw------- 1 root root 99, 0 Jun 24 13:47 parport0
crw------- 1 root root 99, 1 Jun 24 13:47 parport1
crw------- 1 root root 99, 2 Jun 24 13:47 parport2
crw------- 1 root root 99, 3 Jun 24 13:47 parport3
crw-r----- 1 root root 1, 4 Jan 1 1970 port
</screen></para>
<para>
You may also need to create <filename>/dev/port</filename> and/or <filename>/dev/parport</filename> depending on the backend you will use, so be prepared to return to this step if your application dictates it.
</para>
</sect3>
</sect2>
<sect2 id="permissions">
<title>Groups and Permissions</title>
<para>
It is a good idea to be sure that your user account can access the device once all modules are loaded and device nodes created.
The most security-conscious way to do that is to add scanner access to a particular group.
On my system, the members of the group 'scanner' are allowed to use the scanner.
The way to accomplish this is to first change the ownership of the devices in <filename>/dev</filename> like so (as root):
</para>
<para><screen>
# chown root.scanner /dev/usb/scanner*
</screen></para>
<para>...where <command>root.scanner</command> are the owner and group the device will now belong to.
Obviously the specific command will vary by your system and the type of device, whether <filename>/dev/sg*</filename> on SCSI scanners, etc.
It is important that you change the ownership of the device node itself and not the symlink; symlinks' ownerships are affected only by changing the parent devices or files they point to.
</para>
<para>To see if your user account is a member of the group in question, as root issue the following command: <command>grep -e scanner /etc/group</command>.
You should see something like the following:</para>
<para><screen>
scanner:x:103:
</screen></para>
<para>...where '103' is the group number.
Since no members follow the last colon in the 'scanner' group we can add them, let's say user 'jhs' with the command</para>
<para><screen>
# adduser jhs scanner </screen></para>
<para>After this it's simply a matter of allowing read and write access for the user in question of the device like so:</para>
<para><screen>
# chmod g+rw /dev/usb/scanner0</screen></para>
<para>...where <command>g+rw</command> means add <command>r</command>ead and <command>w</command>rite access for <command>g</command>roup.
See the documentation for chmod (<command>man chmod</command> or <command>info chmod</command>) for further info.</para>
</sect2>
</sect1>
<sect1 id="SANE">
<title>SANE</title>
<para>The final prerequisite for scanner access is the SANE backend(s) and optionally, a suitable SANE-frontend.
The former are the drivers and low-level access tools that interface with your scanner, and the latter are graphical applications for access and use of your scanner within X.
Only the former are required for scanner access, though a frontend is highly recommended in order to manipulate images and to actually be able to see your images in a windowed environment without having to print them.</para>
<sect2 id="getting-SANE">
<title>Getting SANE</title>
<para>
You can acquire the suite of SANE backends at <ulink url="http://www.sane-project.org/source.html"> http://www.sane-project.org/source.html</ulink>, where you can obtain binaries for nearly all Linux distributions as well as source code.
If you are planning on compiling from source, you probably already know what to do, but the following link is available for those that want a refresher, that of the <ulink url="http://tldp.org/HOWTO/Software-Building-HOWTO.html">Software Building HOWTO</ulink>.
In addition, be sure that if you have a previous sane installation that it is removed prior to installing your freshly-compiled version, and that you should acquire the most recently released stable version of the source code for compiling.
</para>
<para>
Those who wish to install binaries should download the corresponding file and then install as usual, i.e. for rpm-based distributions:</para>
<para>
<screen># rpm -iVh sane-backends-VERSION.rpm</screen></para>
<para>
For Debian users there is a SANE package in stable (Woody), testing (Sarge) and unstable (Sid) package repositories, so a simple <command>apt-get install sane</command> is all that is required, whatever version you are using.</para>
<para>
Those who prefer compiling the latest version of SANE from source can acquire it from <ulink url="ftp://ftp.mostang.com/pub/sane/">ftp.mostang.com/pub/sane</ulink>.
There is a more in-depth (though rather pessimistic) write-up of how to compile SANE from source and get a SCSI scanner working from scratch, at <ulink url="http://www.xs4all.nl/~ljm/SANE/howto.html">Laurent-jan's HOWTO page originally written by Steve Sheriff</ulink> (the graphics are interesting, too).
</para>
</sect2>
<sect2 id="config-SANE">
<title>Configuring SANE</title>
<sect3 id="mfgr">
<title>SANE Backends</title>
<para>
Whether you obtained your distribution's official SANE package, obtained a binary from the SANE homepage or compiled your own SANE binary from source, SANE should identify the appropriate backend to use for your hardware when you call <command>scanimage</command> or any other frontend.
If no device is found when you run <command>scanimage -L</command> or your chosen frontend, see <xref linkend="troubleshooting"> for more info. </para>
</sect3>
<sect3 id="networked">
<title>Across a Network</title>
<para>
If you are interested in making scanner services available across a network from or to a remote machine, you will need to edit the <filename>saned.conf</filename> file in the configuration directory of the <emphasis>server</emphasis> (the computer with the scanner), whether <filename>/etc/sane.d</filename> or <filename>/usr/local/etc/sane.d</filename>.
It usually consists of an entry 'scan-client.somedomain.firm' that will need to be replaced with the hostname of the client you want to be able to use the server's scanner.
If you prefer an IP address this can be used instead.
</para>
<para>
The saned daemon will need to be run as well as inetd or xined on the server.
See <command>man saned</command> for the exact changes required to inetd.conf or xined.conf.
In addition port 6566 will need to be added to the <filename>/etc/services</filename> file:
</para>
<para><screen>
sane 6566/tcp
</screen></para>
<para>
The client computer (without the scanner) will need net.conf edited to include the server machine name, i.e., 'scan-server.somedomain.firm.'
</para>
<para>
Also for the client(s), be sure the entry <quote>net</quote> isn't commented out in the <filename>dll.conf</filename> file.
</para>
</sect3>
<sect3 id="v4l">
<title>Using SANE with a Video4linux Device</title>
<para>
Video4linux devices include webcams, still cameras and video capture devices.
SANE is capable of accessing these.
To do this, locate the file in the configuration directory (<filename>/etc/sane.d</filename> or <filename>/usr/local/etc/sane.d</filename>) named <filename>v4l.conf</filename>.
Opening this file yields something similar to the following content:
</para>
<para>
<screen># In order to use the v4linux backend you have to give the device
# You can enable multiple lines if
# you really have multible <emphasis>[sic]</emphasis> v4l devices.
#
/dev/bttv0
/dev/video0
/dev/video1
/dev/video2
/dev/video3</screen>
</para>
<para>The initial line of this file really tells you all you need to know, so remember this when we get to the sections on testing the scanner hardware.
Just be sure that whatever device your kernel identifies your camera or other v4l device as is uncommented (i.e., has the # removed from in front of it as above).
You will obviously need to do this as root.
In addition, be sure the line 'v4l' isn't commented out in the <filename>dll.conf</filename> file.
</para>
</sect3>
</sect2>
</sect1>
<sect1 id="testing">
<title>Testing Your Scanner</title>
<para>
Once you've completed all of the above, you're ready to test your scanner equipment.
This section assumes your scanner is turned on and has been attached through the appropriate interface.
If you have a SCSI or a USB scanner, at the command line you can issue the following command:
</para>
<para>
<screen>$ sane-find-scanner</screen></para>
<para>...which should find and identify your scanner from a list of possible devices. (Note to Debian users: starting with Sarge, or unstable, sane-find-scanner is available in the 'sane-utils' package. In Woody it is available in the 'libsane' package.)
If your scanner is a type not looked for by <command>sane-find-scanner</command>, you can try as root
<command>scanimage --list-devices</command>
which should yield information about attached devices. For example, this is the output on my system:
<screen>
device `v4l:/dev/video0' is a Noname BT878 video (Hauppauge (bt878)) virtual device
device `epson:/dev/scanner0' is a Epson Perfection1240 flatbed scanner
</screen>
whereas when using libusb it registers as
<screen>
device `v4l:/dev/video0' is a Noname BT878 video (Hauppauge (bt878)) virtual device
device `epson:libusb:001:003' is a Epson Perfection1240 flatbed scanner
</screen>
Make note of the 'backend:device' information obtained; this will be our device name to specifically access the scanner from the command line.
Also, be aware that sane-find-scanner is a separate utility that does not guarantee support under SANE, it only looks for devices that claim to be scanners.
</para>
<para>Next you should test the scanner's image grabbing ability.
You can use either one of the frontends listed in <xref linkend="frontends"> or at the command line if you wish with the following:
</para>
<para>
<screen>$ scanimage -d backend:/dev/scanner --format pnm > outfile.pnm</screen>
</para>
<para>Thus if you use the Epson backend, for example, the command would be as follows:</para>
<para>
<screen>$ scanimage -d epson:/dev/scanner --format pnm > outfile.pnm</screen></para>
<para>
You only need the <command>-d</command> option if you have more than one scanner and want to select which one to use.
For example, if you have an Epson and a Mustek scanner, using "-d epson" or "-d mustek" should be enough.
The complete path is only needed if you have more that one scanner supported by the same backend.
Obviously <command>/dev/scanner</command> should be substituted with whatever scanner device you've configured (e.g., <filename>/dev/video0</filename> in the case of a v4l device, and libusb as seen in the sane-find-scanner example above).
The <command>--format</command> switch can be either pnm or tiff, but if left out will default to pnm.
See <command>man scanimage</command> for more obscure but useful options.
The '.pnm' format stands for 'portable anymap,' a common image format for graphical files in Linux that can be converted to nearly any other image format with <ulink url="http://www.imagemagick.org/">Imagemagick</ulink> or <ulink url="http://netpbm.sourceforge.net/">netpbm</ulink>.
</para>
</sect1>
<sect1 id="frontends">
<title>SANE Frontends</title>
<para>
Now that you've got the hardware working, you should probably acquire a suitable frontend if you plan on using your scanner device in X11, which is probably a good idea to look at what you've scanned.
My personal favorite is as elegant and functional as any proprietary solution I've seen, <ulink url="http://www.xsane.org">xsane</ulink>.
It has an attractive GTK+ based GUI, can save the image to a variety of formats, send an image to the printer, and interface easily with the <ulink url="http://www.gimp.org">GIMP</ulink>.
It makes accessing the full color and other potential of your hardware quite easy.</para>
<para>The GIMP, or GNU Image Manipulation Program, is an outstanding application for image editing if you are interested in scanning from within a <trademark>Photoshop</trademark>-like application.
The xsane module may be available as a separate package depending on your Linux distribution.
After starting GIMP, click 'File,' then 'Acquire' followed by 'Xsane:device dialog' to access your scanner.
</para>
<para>
Another highly recommended frontend is <ulink url="http://www.kde.org/apps/kooka/">Kooka</ulink> of the <ulink url="http://www.kde.org/">KDE desktop environment</ulink>.
It has an intuitive interface that integrates easily with other KDE applications and can greatly simplify management of large image collections.</para>
<para>
Xscanimage is a somewhat simpler (but still powerful) scanner application for X11 to acquire images from your scanner.
It may or may not come bundled with the SANE backends depending on your distribution. See <command>man xscanimage</command> for more info.</para>
<para>
You can find a more complete list of SANE frontends at <ulink url="http://www.sane-project.org/sane-frontends.html">the SANE frontends page</ulink>.</para>
</sect1>
<sect1 id="troubleshooting">
<title>Troubleshooting</title>
<sect2 id="initial-hints">
<title>Help, my scanner cannot be found by scanimage or xsane!</title>
<para>
First, don't despair.
If you're sure you've done everything correctly up to this point, all the right modules are loaded and all the configuration files tweaked as outlined and you know you're hardware is supported, check your permissions.
In order to access scanner hardware you must have read and write access.
See <xref linkend="permissions"> for more info.
If this isn't the problem, go to <filename class="directory">/etc/sane.d/</filename> (or <filename>/usr/local/etc/sane.d</filename>) and edit the file <filename>dll.conf</filename>, commenting out any backend or other (i.e. v4l) protocol that you don't need. </para>
<para>If none of the above work, from within the directory containing the SANE configuration files, open the one named after the backend for your particular scanner.
There are (among others) two important entries in the file: interface type (scsi vs. usb), and the device name.
If you have a usb scanner, you will usually need to comment out (make a # mark in front of) the 'scsi' line, and uncomment the line containing 'usb.'
In addition the device name may need to be changed, depending on your distribution (i.e., <filename>/dev/usbscanner0</filename> may become <filename>/dev/usb/usbscanner0</filename>).
As you may have noted, there may be several other options available to your scanner in this file depending on the model, so if your scanner doesn't operate as planned, you may want to take a look at this file and the accompanying model-specific documentation if any; see <command>man sane-scsi</command> or <command>sane-usb</command>, or whichever manufacturer made your scanner (including <command>sane-plustek</command>, <command>sane-qcam</command>, <command>sane-ricoh</command>, <command>sane-sharp</command>, <command>sane-snapscan</command>, <command>sane-umax</command> and so on.
For a full list try <command>apropos sane</command>.
The exact protocols and manufacturers available may depend on your version of SANE.</para>
<para>
If none of the above work, see <xref linkend="lists">.
Also, if you're particularly daring you should check the <ulink url="http://www.meier-geinitz.de/sane/sts/">sane-troubleshoot Homepage</ulink>, still in an early development stage at the time of this writing.</para>
</sect2>
<sect2 id="usb-hard">
<title>Help, I'm not sure my USB hardware is working!</title>
<para>
Assuming you have usbdevfs and /proc filesystem support, you should issue the following command: <command>cat /proc/bus/usb/devices</command>.
It should give you an output of the USB bus status and the connected devices and troubleshoot your hardware.
If your scanner is supported and you can see your hardware you'll know your problem lies elsewhere.</para>
</sect2>
<sect2 id="backend-config">
<title>Help, scanimage or the frontend I am using identifies the wrong device!</title>
<para>First, locate your configuration files, located in one of the usual places: <filename>/etc/sane.d</filename> or <filename>/usr/local/etc/sane.d</filename>.
In general, if you obtained a precompiled package from your distribution or a binary from the SANE homepage it is in <filename class="directory">/etc</filename>, while if you compiled it from source it is in <filename>/usr/local/etc/sane.d</filename>.
Change (<command>cd</command>) to that particular directory.
In <xref linkend="interfaces"> you were referred to the <ulink url="http://www.sane-project.org/sane-mfgs.html">SANE list of supported and not-yet-supported</ulink> hardware.
There you will find among the charts of individual manufacturers listed the <quote>Backend,</quote> or SANE driver for each model in addition to the support status.
Within <filename>/etc/sane.d</filename> or <filename>/usr/local/etc/sane.d</filename> there are similarly named files for each backend.
You should select the file named <filename>dll.conf</filename>.
This will list the backend protocols one by one.
Check to be sure your scanner's backend is not commented out (i.e., has a hash mark in front of it).
If it is you will need to (as root, and using your editor program) remove the '#.'
If you still can't get things to work, see <xref linkend="lists"></para>
</sect2>
<sect2 id="parport-root">
<title>Help, I can only access my parallel-port scanner as root!</title>
<para>
The SANE driver for your scanner accesses the parallel port directly (via <filename>/dev/port</filename>).
This only works for root for security reasons.
See <ulink url="http://www.linuxprinting.org/download/digitalimage/Scanning-as-Normal-User-on-Wierd-Scanner-Mini-HOWTO.txt">this mini-HOWTO</ulink> by Till Kamppeter for instructions on how to approach this problem.
</para>
</sect2>
<sect2 id="lists">
<title>Help, I have an <trademark>Acme Whizzbang</trademark> or other model scanner and you haven't addressed my particular problem!</title>
<para>
Go to <ulink url="http://www.sane-project.org/mailing-lists.html"> the mailing list and irc channel </ulink> at the SANE website.
Check the link for instructions on how to subscribe, etc.
Also, you should read the <ulink url="http://www.xs4all.nl/~ljm/SANE-faq.html">SANE FAQ</ulink> which has several hardware-specific questions, answers and links to relevant documentation.
</para>
</sect2>
</sect1>
<sect1 id="gfdpl">
<title>Gnu Free Documentation License</title>
<para>
Version 1.2, November 2002
</para>
<para>
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</para>
<para>
0. PREAMBLE
</para>
<para>
The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
</para>
<para>
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
cense designed for free software.
</para>
<para>
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
</para>
<para>
1. APPLICABILITY AND DEFINITIONS
</para>
<para>
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The "Document", below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as "you". You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
</para>
<para>
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
</para>
<para>
A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (Thus, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
</para>
<para>
The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
</para>
<para>
The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
</para>
<para>
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not "Transparent" is called "Opaque".
</para>
<para>
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification. Examples of
transparent image formats include PNG, XCF and JPG. Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
</para>
<para>
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
</para>
<para>
A section "Entitled XYZ" means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".) To "Preserve the Title"
of such a section when you modify the Document means that it remains a
section "Entitled XYZ" according to this definition.
</para>
<para>
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
</para>
<para>
2. VERBATIM COPYING
</para>
<para>
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
</para>
<para>
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
</para>
<para>
3. COPYING IN QUANTITY
</para>
<para>
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
</para>
<para>
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
</para>
<para>
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
</para>
<para>
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
</para>
<para>
4. MODIFICATIONS
</para>
<para>
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
</para>
<para>
A. Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
</para>
<para>
B. List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
</para>
<para>
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
</para>
<para>
D. Preserve all the copyright notices of the Document.
</para>
<para>
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
</para>
<para>
F. Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
</para>
<para>
G. Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
</para>
<para>
H. Include an unaltered copy of this License.
</para>
<para>
I. Preserve the section Entitled "History", Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled "History" in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
</para>
<para>
J. Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the "History" section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
</para>
<para>
K. For any section Entitled "Acknowledgements" or "Dedications",
Preserve the Title of the section, and preserve in the section all
the substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
</para>
<para>
L. Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
</para>
<para>
M. Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
</para>
<para>
N. Do not retitle any existing section to be Entitled "Endorsements"
or to conflict in title with any Invariant Section.
</para>
<para>
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
</para>
<para>
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
</para>
<para>
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
</para>
<para>
5. COMBINING DOCUMENTS
</para>
<para>
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
</para>
<para>
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
</para>
<para>
In the combination, you must combine any sections Entitled "History"
in the various original documents, forming one section Entitled
"History"; likewise combine any sections Entitled "Acknowledgements",
and any sections Entitled "Dedications". You must delete all sections
Entitled "Endorsements".
</para>
<para>
6. COLLECTIONS OF DOCUMENTS
</para>
<para>
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
</para>
<para>
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
</para>
<para>
7. AGGREGATION WITH INDEPENDENT WORKS
</para>
<para>
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an "aggregate" if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
</para>
<para>
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
</para>
<para>
8. TRANSLATION
</para>
<para>
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
</para>
<para>
If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
</para>
<para>
9. TERMINATION
</para>
<para>
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
</para>
<para>
10. FUTURE REVISIONS OF THIS LICENSE
</para>
<para>
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation 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. See
http://www.gnu.org/copyleft/.
</para>
<para>
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
</para>
<para>
ADDENDUM: How to use this License for your documents
</para>
<para>
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
</para>
<para>
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
</para>
<para>
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the "with...Texts." line with this:
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
</para>
<para>
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
</para>
</sect1>
<!-- Section1: examples: END -->
</article>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-namecase-general:t
sgml-general-insert-case:lower
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:nil
sgml-parent-document:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->