r6017 - trunk/BOOK/general/genlib

bdubbs at linuxfromscratch.org bdubbs at linuxfromscratch.org
Sun May 7 00:34:23 PDT 2006

Author: bdubbs
Date: 2006-05-07 01:34:22 -0600 (Sun, 07 May 2006)
New Revision: 6017

Update to libusb configuration.

Modified: trunk/BOOK/general/genlib/libusb.xml
--- trunk/BOOK/general/genlib/libusb.xml	2006-05-07 05:29:07 UTC (rev 6016)
+++ trunk/BOOK/general/genlib/libusb.xml	2006-05-07 07:34:22 UTC (rev 6017)
@@ -142,17 +142,42 @@
 <screen role='root'><userinput>groupadd -g 14 usb</userinput></screen>
-    <para id="libusb-kernel">Ensure that you have compiled the <quote>USB device
-    filesystem</quote> directly into the kernel or compiled it as a module
-    (listing the resulting <quote>usbcore</quote> module in the
-    <filename>/etc/sysconfig/modules</filename> file). You should also have an
-    entry similar to the line below in your <filename>/etc/fstab</filename>
-    file:</para>
+    <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>
     <indexterm zone="libusb libusb-kernel">
-    <primary sortas="d-USB-device-filesystem">USB device filesystem</primary>
+    <primary sortas="d-USB-device-filesystem">Support for Host-side USB</primary>
+    <para>To have USB devices set up properly, add the followng 
+    <application>udev</application> rule and add any users 
+    that need USB devices to the "usb" group.</para>
+<screen><literal>cat > /etc/udev/rules.d/23-usb-rules << "EOF"
+# Set group ownership for USB devices 
+SUBSYSTEM=="usb_device", \
+PROGRAM="/bin/sh -c 'X=%k X=$${X#usbdev} B=$${X%%%%.*} D=$${X#*.}; \
+echo bus/usb/$$B/$$D'", SYMLINK+="%c", GROUP="usb"
+    <para>Fine-tunuing of permissions is also possible by creating extra rules,
+    matching on something like this (on one line).  The vendor and product can
+    be found by searchng the <filename
+    class='directory'>/sys/devices</filename> directory entries after
+    the device has been attached.</para>
+<screen><literal>SUBSYSTEM=="usb_device", SYSFS{idVendor}=="05d8", 
+SYSFS{idProduct}=="4002", GROUP:="scanner"</literal></screen>
+    <para>Some older applications need the following deprecated entry in
+    the <filename>/etc/fstab</filename> file.  Do not use it unless you 
+    know its needed.</para>
 <screen><literal>usbfs  /proc/bus/usb  usbfs  devgid=14,devmode=0660  0  0</literal></screen>

More information about the blfs-book mailing list