2004-06-13 06:56:28 +08:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2007-04-05 03:42:53 +08:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
2004-06-13 06:56:28 +08:00
|
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
|
2007-01-16 07:25:53 +08:00
|
|
|
<!ENTITY libusb-download-http "http://downloads.sourceforge.net/libusb/libusb-&libusb-version;.tar.gz">
|
2006-04-02 23:50:30 +08:00
|
|
|
<!ENTITY libusb-download-ftp " ">
|
|
|
|
<!ENTITY libusb-md5sum "caf182cbc7565dac0fd72155919672e6">
|
|
|
|
<!ENTITY libusb-size "389 KB">
|
|
|
|
<!ENTITY libusb-buildsize "8.4 MB (includes installing all documentation)">
|
|
|
|
<!ENTITY libusb-time "0.3 SBU (includes building all documentation)">
|
2004-06-13 06:56:28 +08:00
|
|
|
]>
|
|
|
|
|
2004-05-10 22:58:36 +08:00
|
|
|
<sect1 id="libusb" xreflabel="libusb-&libusb-version;">
|
2005-05-01 21:07:45 +08:00
|
|
|
<?dbhtml filename="libusb.html"?>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
<sect1info>
|
|
|
|
<othername>$LastChangedBy$</othername>
|
|
|
|
<date>$Date$</date>
|
|
|
|
</sect1info>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-12-17 01:18:12 +08:00
|
|
|
<title>libusb-&libusb-version;</title>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
<indexterm zone="libusb">
|
|
|
|
<primary sortas="a-Libusb">Libusb</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<sect2 role="package">
|
2005-12-17 01:18:12 +08:00
|
|
|
<title>Introduction to libusb</title>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
<para>The <application>libusb</application> package contains a library
|
|
|
|
used by some applications for USB device access.</para>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
|
|
<itemizedlist spacing="compact">
|
|
|
|
<listitem>
|
|
|
|
<para>Download (HTTP): <ulink url="&libusb-download-http;"/></para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Download (FTP): <ulink url="&libusb-download-ftp;"/></para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Download MD5 sum: &libusb-md5sum;</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Download size: &libusb-size;</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Estimated disk space required: &libusb-buildsize;</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Estimated build time: &libusb-time;</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-12-17 01:18:12 +08:00
|
|
|
<bridgehead renderas="sect3">libusb Dependencies</bridgehead>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2006-04-02 23:50:30 +08:00
|
|
|
<bridgehead renderas="sect4">Optional</bridgehead>
|
|
|
|
<para role="optional"><xref linkend="pkgconfig"/></para>
|
|
|
|
|
|
|
|
<bridgehead renderas="sect4">Optional
|
|
|
|
(Required to Build the HTML User Manual)</bridgehead>
|
2005-12-02 04:50:08 +08:00
|
|
|
<para role="optional"><xref linkend="openjade"/> and
|
2005-05-31 05:33:35 +08:00
|
|
|
<ulink url="http://www.docbook.org/sgml/4.2/index.html"> DocBOOK SGML
|
2005-05-31 00:29:22 +08:00
|
|
|
DTD-4.2</ulink></para>
|
|
|
|
|
2006-04-02 23:50:30 +08:00
|
|
|
<bridgehead renderas="sect4">Optional
|
|
|
|
(Required to Build the API Documentation)</bridgehead>
|
2005-12-02 04:50:08 +08:00
|
|
|
<para role="optional"><xref linkend="doxygen"/> and
|
2006-04-14 05:57:57 +08:00
|
|
|
<xref linkend="graphviz"/></para>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2006-04-11 02:35:56 +08:00
|
|
|
<para condition="html" role="usernotes">User Notes:
|
|
|
|
<ulink url="&blfs-wiki;/libusb"/></para>
|
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
</sect2>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
<sect2 role="installation">
|
2005-12-17 01:18:12 +08:00
|
|
|
<title>Installation of libusb</title>
|
2005-05-01 21:07:45 +08:00
|
|
|
|
2005-05-31 05:33:35 +08:00
|
|
|
<para>Install <application>libusb</application> by running the following
|
2005-05-01 21:07:45 +08:00
|
|
|
commands:</para>
|
|
|
|
|
|
|
|
<screen><userinput>./configure --prefix=/usr --disable-build-docs &&
|
|
|
|
make</userinput></screen>
|
|
|
|
|
2005-12-17 01:18:12 +08:00
|
|
|
<para>If you wish to build the API documentation (see the required
|
|
|
|
dependencies), issue the following command:</para>
|
2005-05-01 21:07:45 +08:00
|
|
|
|
|
|
|
<screen><userinput>make apidox</userinput></screen>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-12-17 01:18:12 +08:00
|
|
|
<para>To test the results, issue <command>make -k check</command>.</para>
|
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
<para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
<screen role="root"><userinput>make install</userinput></screen>
|
|
|
|
|
2005-12-17 01:18:12 +08:00
|
|
|
<para>If you built the HTML user manual (by having the required
|
|
|
|
dependencies installed and removing the
|
|
|
|
<parameter>--disable-build-docs</parameter> parameter from the
|
|
|
|
<command>configure</command> command), install it using the following
|
|
|
|
commands as the <systemitem class="username">root</systemitem> user:</para>
|
2005-05-01 21:07:45 +08:00
|
|
|
|
|
|
|
<screen role="root"><userinput>install -v -d -m755 /usr/share/doc/libusb-&libusb-version;/html &&
|
|
|
|
install -v -m644 doc/html/* /usr/share/doc/libusb-&libusb-version;/html</userinput></screen>
|
|
|
|
|
2005-12-17 01:18:12 +08:00
|
|
|
<para>If you built the API documentation, install it using the following
|
|
|
|
commands as the <systemitem class="username">root</systemitem> user:</para>
|
2005-05-01 21:07:45 +08:00
|
|
|
|
|
|
|
<screen role="root"><userinput>install -v -d -m755 /usr/share/doc/libusb-&libusb-version;/apidocs &&
|
2005-07-28 00:35:22 +08:00
|
|
|
install -v -m644 apidocs/html/* \
|
|
|
|
/usr/share/doc/libusb-&libusb-version;/apidocs</userinput></screen>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
</sect2>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
<sect2 role="commands">
|
|
|
|
<title>Command Explanations</title>
|
|
|
|
|
2005-12-17 01:18:12 +08:00
|
|
|
<para><parameter>--disable-build-docs</parameter>: This switch avoids
|
2006-04-02 23:50:30 +08:00
|
|
|
building the HTML user manual. Remove it if you have the required
|
|
|
|
dependencies installed and wish to build the manual.</para>
|
2005-08-13 00:48:30 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
</sect2>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
<sect2 role="configuration">
|
|
|
|
<title>Configuring Libusb</title>
|
|
|
|
|
2006-05-01 02:06:51 +08:00
|
|
|
<!--
|
2005-05-31 05:33:35 +08:00
|
|
|
<para><application>libusb</application> requires the
|
|
|
|
<systemitem class="filesystem">usbfs</systemitem> kernel filesystem
|
|
|
|
to be mounted on <filename class="directory">/proc/bus/usb</filename>.
|
|
|
|
Applications require the files in this directory to be accessible to the user,
|
|
|
|
sometimes for both reading and writing. To restrict access to USB devices,
|
|
|
|
ensure the <systemitem class="filesystem">usb</systemitem> group exits
|
|
|
|
on your system. If necessary, create the <systemitem
|
2005-05-01 21:07:45 +08:00
|
|
|
class="filesystem">usb</systemitem> group using the following command:</para>
|
|
|
|
|
|
|
|
<screen role='root'><userinput>groupadd -g 14 usb</userinput></screen>
|
2006-05-01 02:06:51 +08:00
|
|
|
-->
|
2005-05-01 21:07:45 +08:00
|
|
|
|
2006-05-07 15:34:22 +08:00
|
|
|
<para id="libusb-kernel">To access raw USB devices (those not treated as a
|
|
|
|
disk by the mass-storage driver), appropriate support must be available in
|
|
|
|
the kernel. Check your kernel configuration for Device Drivers ⇒ USB
|
|
|
|
support ⇒ Support for Host-side USB. Select any USB hardware device
|
|
|
|
drivers you may need on the same page.</para>
|
2006-06-22 00:26:07 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
<indexterm zone="libusb libusb-kernel">
|
2006-05-07 15:34:22 +08:00
|
|
|
<primary sortas="d-USB-device-filesystem">Support for Host-side USB</primary>
|
2005-05-01 21:07:45 +08:00
|
|
|
</indexterm>
|
2006-06-22 00:26:07 +08:00
|
|
|
|
|
|
|
<para>To have raw USB devices set up properly, add the following
|
|
|
|
<application>udev</application> rule and add any users
|
2006-05-08 10:46:36 +08:00
|
|
|
that need to access raw USB devices to the "usb" group.</para>
|
2006-06-22 00:26:07 +08:00
|
|
|
|
2006-07-06 21:52:47 +08:00
|
|
|
<screen><literal>cat > /etc/udev/rules.d/23-usb.rules << "EOF"
|
2006-06-22 00:26:07 +08:00
|
|
|
# Set group ownership for raw USB devices
|
2007-08-02 21:18:31 +08:00
|
|
|
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
|
2006-05-07 15:34:22 +08:00
|
|
|
EOF</literal></screen>
|
|
|
|
|
2006-05-17 23:56:07 +08:00
|
|
|
<!--
|
2006-05-08 10:46:36 +08:00
|
|
|
<para>Fine-tuning of permissions is also possible by creating extra rules,
|
2006-05-07 15:34:22 +08:00
|
|
|
matching on something like this (on one line). The vendor and product can
|
|
|
|
be found by searchng the <filename
|
2006-05-08 10:46:36 +08:00
|
|
|
class='directory'>/sys/devices</filename> directory entries or using
|
|
|
|
<command>udevinfo</command> after the device has been attached. See the
|
|
|
|
documentation in the current udev directory of <filename
|
|
|
|
class='directory'>/usr/share/doc></filename> for details.</para>
|
2006-05-07 15:34:22 +08:00
|
|
|
|
2006-06-22 00:26:07 +08:00
|
|
|
<screen><literal>SUBSYSTEM=="usb_device", SYSFS{idVendor}=="05d8",
|
2006-05-07 15:34:22 +08:00
|
|
|
SYSFS{idProduct}=="4002", GROUP:="scanner"</literal></screen>
|
|
|
|
|
2006-05-08 10:46:36 +08:00
|
|
|
<para>Some older applications, such as <application>VMware</application>,
|
|
|
|
need the following deprecated entry in the <filename>/etc/fstab</filename>
|
2006-05-08 11:19:34 +08:00
|
|
|
file. This is not normally needed.</para>
|
2005-05-01 21:07:45 +08:00
|
|
|
|
|
|
|
<screen><literal>usbfs /proc/bus/usb usbfs devgid=14,devmode=0660 0 0</literal></screen>
|
2006-05-17 23:56:07 +08:00
|
|
|
-->
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
</sect2>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
<sect2 role="content">
|
|
|
|
<title>Contents</title>
|
|
|
|
|
|
|
|
<segmentedlist>
|
|
|
|
<segtitle>Installed Program</segtitle>
|
|
|
|
<segtitle>Installed Libraries</segtitle>
|
|
|
|
<segtitle>Installed Directory</segtitle>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
<seglistitem>
|
2006-04-15 01:11:09 +08:00
|
|
|
<seg>libusb-config</seg>
|
2006-04-11 02:35:56 +08:00
|
|
|
<seg>libusb.{so,a} and libusbpp.{so,a}</seg>
|
2005-05-01 21:07:45 +08:00
|
|
|
<seg>/usr/share/doc/libusb-&libusb-version;</seg>
|
|
|
|
</seglistitem>
|
|
|
|
</segmentedlist>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
<variablelist>
|
|
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
|
|
<?dbfo list-presentation="list"?>
|
|
|
|
<?dbhtml list-presentation="table"?>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2006-04-15 01:11:09 +08:00
|
|
|
<varlistentry id="libusb-config">
|
|
|
|
<term><command>libusb-config</command></term>
|
2005-05-01 21:07:45 +08:00
|
|
|
<listitem>
|
2005-05-31 05:33:35 +08:00
|
|
|
<para>is a script that provides the right compiler and linker
|
|
|
|
flags for programs using
|
2005-05-01 21:07:45 +08:00
|
|
|
<filename class='libraryfile'>libusb</filename>.</para>
|
2006-04-15 01:11:09 +08:00
|
|
|
<indexterm zone="libusb libusb-config">
|
|
|
|
<primary sortas="b-libusb-config">libusb-config</primary>
|
2005-05-01 21:07:45 +08:00
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
<varlistentry id="libusb-lib">
|
2006-04-11 02:35:56 +08:00
|
|
|
<term><filename class='libraryfile'>libusb.{so,a}</filename></term>
|
2005-05-01 21:07:45 +08:00
|
|
|
<listitem>
|
2005-05-31 05:33:35 +08:00
|
|
|
<para> libraries contain C functions for accessing
|
2005-05-01 21:07:45 +08:00
|
|
|
USB hardware.</para>
|
|
|
|
<indexterm zone="libusb libusb-lib">
|
2006-04-11 02:35:56 +08:00
|
|
|
<primary sortas="c-libusb">libusb.{so,a}</primary>
|
2005-05-01 21:07:45 +08:00
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2005-05-31 00:29:22 +08:00
|
|
|
|
2005-05-01 21:07:45 +08:00
|
|
|
</variablelist>
|
|
|
|
|
|
|
|
</sect2>
|
2004-05-10 22:58:36 +08:00
|
|
|
|
|
|
|
</sect1>
|