[52d29f7] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[52d29f7] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[fce275e] | 7 | <!ENTITY libusb-download-http "&sourceforge-repo;/libusb/libusb-&libusb-version;.tar.gz">
|
---|
[de49ebd] | 8 | <!ENTITY libusb-download-ftp " ">
|
---|
| 9 | <!ENTITY libusb-md5sum "caf182cbc7565dac0fd72155919672e6">
|
---|
| 10 | <!ENTITY libusb-size "389 KB">
|
---|
| 11 | <!ENTITY libusb-buildsize "8.4 MB (includes installing all documentation)">
|
---|
| 12 | <!ENTITY libusb-time "0.3 SBU (includes building all documentation)">
|
---|
[52d29f7] | 13 | ]>
|
---|
| 14 |
|
---|
[bdf5806e] | 15 | <sect1 id="libusb" xreflabel="libusb-&libusb-version;">
|
---|
[fc3e01f] | 16 | <?dbhtml filename="libusb.html"?>
|
---|
[4c3474fe] | 17 |
|
---|
[fc3e01f] | 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
[4c3474fe] | 22 |
|
---|
[1f3b7a7] | 23 | <title>libusb-&libusb-version;</title>
|
---|
[4c3474fe] | 24 |
|
---|
[fc3e01f] | 25 | <indexterm zone="libusb">
|
---|
| 26 | <primary sortas="a-Libusb">Libusb</primary>
|
---|
| 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
[1f3b7a7] | 30 | <title>Introduction to libusb</title>
|
---|
[4c3474fe] | 31 |
|
---|
[fc3e01f] | 32 | <para>The <application>libusb</application> package contains a library
|
---|
| 33 | used by some applications for USB device access.</para>
|
---|
[4c3474fe] | 34 |
|
---|
[fc3e01f] | 35 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 36 | <itemizedlist spacing="compact">
|
---|
| 37 | <listitem>
|
---|
| 38 | <para>Download (HTTP): <ulink url="&libusb-download-http;"/></para>
|
---|
| 39 | </listitem>
|
---|
| 40 | <listitem>
|
---|
| 41 | <para>Download (FTP): <ulink url="&libusb-download-ftp;"/></para>
|
---|
| 42 | </listitem>
|
---|
| 43 | <listitem>
|
---|
| 44 | <para>Download MD5 sum: &libusb-md5sum;</para>
|
---|
| 45 | </listitem>
|
---|
| 46 | <listitem>
|
---|
| 47 | <para>Download size: &libusb-size;</para>
|
---|
| 48 | </listitem>
|
---|
| 49 | <listitem>
|
---|
| 50 | <para>Estimated disk space required: &libusb-buildsize;</para>
|
---|
| 51 | </listitem>
|
---|
| 52 | <listitem>
|
---|
| 53 | <para>Estimated build time: &libusb-time;</para>
|
---|
| 54 | </listitem>
|
---|
| 55 | </itemizedlist>
|
---|
[4c3474fe] | 56 |
|
---|
[1f3b7a7] | 57 | <bridgehead renderas="sect3">libusb Dependencies</bridgehead>
|
---|
[4c3474fe] | 58 |
|
---|
[de49ebd] | 59 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 60 | <para role="optional"><xref linkend="pkgconfig"/></para>
|
---|
| 61 |
|
---|
| 62 | <bridgehead renderas="sect4">Optional
|
---|
| 63 | (Required to Build the HTML User Manual)</bridgehead>
|
---|
[4f26c54] | 64 | <para role="optional"><xref linkend="openjade"/> and
|
---|
[74390482] | 65 | <ulink url="http://www.docbook.org/sgml/4.2/index.html"> DocBOOK SGML
|
---|
[4c3474fe] | 66 | DTD-4.2</ulink></para>
|
---|
| 67 |
|
---|
[de49ebd] | 68 | <bridgehead renderas="sect4">Optional
|
---|
| 69 | (Required to Build the API Documentation)</bridgehead>
|
---|
[4f26c54] | 70 | <para role="optional"><xref linkend="doxygen"/> and
|
---|
[6722219] | 71 | <xref linkend="graphviz"/></para>
|
---|
[4c3474fe] | 72 |
|
---|
[1039de3] | 73 | <para condition="html" role="usernotes">User Notes:
|
---|
| 74 | <ulink url="&blfs-wiki;/libusb"/></para>
|
---|
| 75 |
|
---|
[fc3e01f] | 76 | </sect2>
|
---|
[4c3474fe] | 77 |
|
---|
[fc3e01f] | 78 | <sect2 role="installation">
|
---|
[1f3b7a7] | 79 | <title>Installation of libusb</title>
|
---|
[fc3e01f] | 80 |
|
---|
[74390482] | 81 | <para>Install <application>libusb</application> by running the following
|
---|
[fc3e01f] | 82 | commands:</para>
|
---|
| 83 |
|
---|
| 84 | <screen><userinput>./configure --prefix=/usr --disable-build-docs &&
|
---|
| 85 | make</userinput></screen>
|
---|
| 86 |
|
---|
[1f3b7a7] | 87 | <para>If you wish to build the API documentation (see the required
|
---|
| 88 | dependencies), issue the following command:</para>
|
---|
[fc3e01f] | 89 |
|
---|
| 90 | <screen><userinput>make apidox</userinput></screen>
|
---|
[4c3474fe] | 91 |
|
---|
[1f3b7a7] | 92 | <para>To test the results, issue <command>make -k check</command>.</para>
|
---|
| 93 |
|
---|
[fc3e01f] | 94 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[4c3474fe] | 95 |
|
---|
[fc3e01f] | 96 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
| 97 |
|
---|
[1f3b7a7] | 98 | <para>If you built the HTML user manual (by having the required
|
---|
| 99 | dependencies installed and removing the
|
---|
| 100 | <parameter>--disable-build-docs</parameter> parameter from the
|
---|
| 101 | <command>configure</command> command), install it using the following
|
---|
| 102 | commands as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[fc3e01f] | 103 |
|
---|
| 104 | <screen role="root"><userinput>install -v -d -m755 /usr/share/doc/libusb-&libusb-version;/html &&
|
---|
| 105 | install -v -m644 doc/html/* /usr/share/doc/libusb-&libusb-version;/html</userinput></screen>
|
---|
| 106 |
|
---|
[1f3b7a7] | 107 | <para>If you built the API documentation, install it using the following
|
---|
| 108 | commands as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[fc3e01f] | 109 |
|
---|
| 110 | <screen role="root"><userinput>install -v -d -m755 /usr/share/doc/libusb-&libusb-version;/apidocs &&
|
---|
[4c288b0] | 111 | install -v -m644 apidocs/html/* \
|
---|
| 112 | /usr/share/doc/libusb-&libusb-version;/apidocs</userinput></screen>
|
---|
[4c3474fe] | 113 |
|
---|
[fc3e01f] | 114 | </sect2>
|
---|
[4c3474fe] | 115 |
|
---|
[fc3e01f] | 116 | <sect2 role="commands">
|
---|
| 117 | <title>Command Explanations</title>
|
---|
| 118 |
|
---|
[1f3b7a7] | 119 | <para><parameter>--disable-build-docs</parameter>: This switch avoids
|
---|
[de49ebd] | 120 | building the HTML user manual. Remove it if you have the required
|
---|
| 121 | dependencies installed and wish to build the manual.</para>
|
---|
[4412b30b] | 122 |
|
---|
[fc3e01f] | 123 | </sect2>
|
---|
[4c3474fe] | 124 |
|
---|
[fc3e01f] | 125 | <sect2 role="configuration">
|
---|
| 126 | <title>Configuring Libusb</title>
|
---|
| 127 |
|
---|
[33ca2b6] | 128 | <!--
|
---|
[74390482] | 129 | <para><application>libusb</application> requires the
|
---|
| 130 | <systemitem class="filesystem">usbfs</systemitem> kernel filesystem
|
---|
| 131 | to be mounted on <filename class="directory">/proc/bus/usb</filename>.
|
---|
| 132 | Applications require the files in this directory to be accessible to the user,
|
---|
| 133 | sometimes for both reading and writing. To restrict access to USB devices,
|
---|
| 134 | ensure the <systemitem class="filesystem">usb</systemitem> group exits
|
---|
| 135 | on your system. If necessary, create the <systemitem
|
---|
[fc3e01f] | 136 | class="filesystem">usb</systemitem> group using the following command:</para>
|
---|
| 137 |
|
---|
| 138 | <screen role='root'><userinput>groupadd -g 14 usb</userinput></screen>
|
---|
[33ca2b6] | 139 | -->
|
---|
[fc3e01f] | 140 |
|
---|
[7bcc1669] | 141 | <para id="libusb-kernel">To access raw USB devices (those not treated as a
|
---|
| 142 | disk by the mass-storage driver), appropriate support must be available in
|
---|
| 143 | the kernel. Check your kernel configuration for Device Drivers ⇒ USB
|
---|
| 144 | support ⇒ Support for Host-side USB. Select any USB hardware device
|
---|
| 145 | drivers you may need on the same page.</para>
|
---|
[9f12e36] | 146 |
|
---|
[fc3e01f] | 147 | <indexterm zone="libusb libusb-kernel">
|
---|
[7bcc1669] | 148 | <primary sortas="d-USB-device-filesystem">Support for Host-side USB</primary>
|
---|
[fc3e01f] | 149 | </indexterm>
|
---|
[9f12e36] | 150 |
|
---|
| 151 | <para>To have raw USB devices set up properly, add the following
|
---|
[3a79861] | 152 | <application>udev</application> rule.</para>
|
---|
[9f12e36] | 153 |
|
---|
[4e4fa01] | 154 | <screen><literal>cat > /etc/udev/rules.d/23-usb.rules << "EOF"
|
---|
[9f12e36] | 155 | # Set group ownership for raw USB devices
|
---|
[3e50349d] | 156 | SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
|
---|
[7bcc1669] | 157 | EOF</literal></screen>
|
---|
| 158 |
|
---|
[e73e361] | 159 | <!--
|
---|
[531886d] | 160 | <para>Fine-tuning of permissions is also possible by creating extra rules,
|
---|
[7bcc1669] | 161 | matching on something like this (on one line). The vendor and product can
|
---|
| 162 | be found by searchng the <filename
|
---|
[531886d] | 163 | class='directory'>/sys/devices</filename> directory entries or using
|
---|
| 164 | <command>udevinfo</command> after the device has been attached. See the
|
---|
| 165 | documentation in the current udev directory of <filename
|
---|
| 166 | class='directory'>/usr/share/doc></filename> for details.</para>
|
---|
[7bcc1669] | 167 |
|
---|
[9f12e36] | 168 | <screen><literal>SUBSYSTEM=="usb_device", SYSFS{idVendor}=="05d8",
|
---|
[7bcc1669] | 169 | SYSFS{idProduct}=="4002", GROUP:="scanner"</literal></screen>
|
---|
| 170 |
|
---|
[531886d] | 171 | <para>Some older applications, such as <application>VMware</application>,
|
---|
| 172 | need the following deprecated entry in the <filename>/etc/fstab</filename>
|
---|
[93b8f83d] | 173 | file. This is not normally needed.</para>
|
---|
[fc3e01f] | 174 |
|
---|
| 175 | <screen><literal>usbfs /proc/bus/usb usbfs devgid=14,devmode=0660 0 0</literal></screen>
|
---|
[e73e361] | 176 | -->
|
---|
[4c3474fe] | 177 |
|
---|
[410e228b] | 178 | <para>Add any users that need to access raw USB devices to the
|
---|
[3a79861] | 179 | <systemitem class="groupname">usb</systemitem> group.</para>
|
---|
[c5923846] | 180 |
|
---|
[3a79861] | 181 | <screen role="root"><userinput>usermod -a -G usb <replaceable><username></replaceable></userinput></screen>
|
---|
| 182 |
|
---|
[fc3e01f] | 183 | </sect2>
|
---|
[4c3474fe] | 184 |
|
---|
[fc3e01f] | 185 | <sect2 role="content">
|
---|
| 186 | <title>Contents</title>
|
---|
| 187 |
|
---|
| 188 | <segmentedlist>
|
---|
| 189 | <segtitle>Installed Program</segtitle>
|
---|
| 190 | <segtitle>Installed Libraries</segtitle>
|
---|
| 191 | <segtitle>Installed Directory</segtitle>
|
---|
[4c3474fe] | 192 |
|
---|
[fc3e01f] | 193 | <seglistitem>
|
---|
[7833af6] | 194 | <seg>libusb-config</seg>
|
---|
[1039de3] | 195 | <seg>libusb.{so,a} and libusbpp.{so,a}</seg>
|
---|
[fc3e01f] | 196 | <seg>/usr/share/doc/libusb-&libusb-version;</seg>
|
---|
| 197 | </seglistitem>
|
---|
| 198 | </segmentedlist>
|
---|
[4c3474fe] | 199 |
|
---|
[fc3e01f] | 200 | <variablelist>
|
---|
| 201 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 202 | <?dbfo list-presentation="list"?>
|
---|
| 203 | <?dbhtml list-presentation="table"?>
|
---|
[4c3474fe] | 204 |
|
---|
[7833af6] | 205 | <varlistentry id="libusb-config">
|
---|
| 206 | <term><command>libusb-config</command></term>
|
---|
[fc3e01f] | 207 | <listitem>
|
---|
[74390482] | 208 | <para>is a script that provides the right compiler and linker
|
---|
| 209 | flags for programs using
|
---|
[fc3e01f] | 210 | <filename class='libraryfile'>libusb</filename>.</para>
|
---|
[7833af6] | 211 | <indexterm zone="libusb libusb-config">
|
---|
| 212 | <primary sortas="b-libusb-config">libusb-config</primary>
|
---|
[fc3e01f] | 213 | </indexterm>
|
---|
| 214 | </listitem>
|
---|
| 215 | </varlistentry>
|
---|
[4c3474fe] | 216 |
|
---|
[fc3e01f] | 217 | <varlistentry id="libusb-lib">
|
---|
[1039de3] | 218 | <term><filename class='libraryfile'>libusb.{so,a}</filename></term>
|
---|
[fc3e01f] | 219 | <listitem>
|
---|
[74390482] | 220 | <para> libraries contain C functions for accessing
|
---|
[fc3e01f] | 221 | USB hardware.</para>
|
---|
| 222 | <indexterm zone="libusb libusb-lib">
|
---|
[1039de3] | 223 | <primary sortas="c-libusb">libusb.{so,a}</primary>
|
---|
[fc3e01f] | 224 | </indexterm>
|
---|
| 225 | </listitem>
|
---|
| 226 | </varlistentry>
|
---|
[4c3474fe] | 227 |
|
---|
[fc3e01f] | 228 | </variablelist>
|
---|
| 229 |
|
---|
| 230 | </sect2>
|
---|
[bdf5806e] | 231 |
|
---|
| 232 | </sect1>
|
---|