To install USB Scanner in Gentoo (kernel 2.6.4 & higher) follow the steps below:
Note that all of these information is based on assumption that SANE supports your scanner. You will find a list of SANE supported scanners at:
http://www.sane-project.org/sane-supported-devices.html
1.) Before emerging any packages make sure you have "USE=usb" variable in your /etc/make.config; if not add "usb" variable using your favorable editor.
The packages we will need are:
libusb
sane-backends
hotplug
Check if you have any of them intalled:
Code: Select all
# emerge -s libusb sane-backends hotplug(the option you select will depend on your motherboard shipset, select "OHCI HCD" or "UHCI HCD") check your manual or select both options and see which one your motherboad will recognize (might not be the professional way of doing it but it will work if you have no manual or not sure which chipset you have).
In my case above I've VT82xxxxx motherboard with UHCI support so I selected the kernel below: "UHCI HCD"
Code: Select all
# cd /usr/src/linux
# make menuconfig
Device Drivers --->
USB support --->
<*> EHCI HCD (USB 2.0) support
< > OHCI HCD support
<*> UHCI HCD (most Intel and VIA) support NOTE: I compiled the options into kernel though you can compile it as Modules <M>
Connect your scanner to USB port when you issue a command:
Code: Select all
# cat /proc/bus/usb/devicesT: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.7-gentoo-r11 uhci_hcd
S: Product=VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (#2)
S: SerialNumber=0000:00:11.3
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
T: Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS=64 #Cfgs= 1
P: Vendor=04b8 ProdID=011b Rev= 1.00
S: Manufacturer=EPSON
S: Product=EPSON Scanner
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 2mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
(you might or might not have a USB 2 support, it depends on your motherboard). Though at this point you should notice on "P" section (of the EPSON Scanner) the output: Vendor=04b8 ProdID=011b (you might have different values depending on your scanner model). Write it down as you will use this output in some configuration files later on.
3.) Next, you will emerge libusb, sane-backends and hotplug
Code: Select all
# emerge libusbCode: Select all
# emerge sane-backendsQuick check: was sane-backends compiled with the usb USE flag? etcat should have "+ + besides usb" like:
Code:
Code: Select all
# etcat -u sane-backends
[ Colour Code : set unset ]
[ Legend : (U) Col 1 - Current USE flags ]
[ : (I) Col 2 - Installed With USE flags ]
U I [ Found these USE variables in : media-gfx/sane-backends-1.0.14-r3 ]
+ + usb : Adds USB support to applications that have optional USB support (e.g. cups)
+ + gphoto2 : Adds digital camera support5.)
Code: Select all
# emerge hotplugCode: Select all
# nano -w /etc/hotplug/usb.usermapIMPORTANT: make this script executable-------- copy ------------
You have to add one or more lines (for one or more scanners) to the file /etc/hotplug/usb.usermap. Every line in this file is for one device, the line starts with a name that will also be used for a handler script. We are trying to get an EPSON scanner working, so let's call the entry "epson_scanner". The next entry is always 0x0003, and I don't know - and don't care - what it stands for, so let's just keep it set to 0x0003. The following two entries are the vendor ID (0x4b8 for EPSON) and the product ID (e.g. 0x11c for the Perfection 3200). The remaining fields are all set to 0, so let's just add the following after the product ID: 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
You can make this a lot simpler by just copying an existing line and replacing the script name and the two IDs. The line for the Perfection 3200 should look like this (the whole string should be on one line, I split it up so that it does not make this page unreasonable wide):
epson_scanner 0x0003 0x04b8 0x011b 0x0000 0x0000
0x00 0x00 0x00 0x00 0x00
0x00 0x00000000
I already mentioned a handler script that gets started when the device is connected or disconnected. Save the following script as /etc/hotplug/usb/epson_scanner
------- epson_scanner ----------------------- epson_scanner -----------Code: Select all
#!/bin/bash if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ] then chown root "${DEVICE}" chgrp scanner "${DEVICE}" chmod 660 "${DEVICE}" fi
------------end copy ---------------
Code: Select all
# chmod 755 /etc/hotplug/usb/epson_scannerCode: Select all
# Scanner
none /proc/bus/usb usbfs defaults,devmode=0666 0 0Code: Select all
usb 0x4b8 0x011b Code: Select all
# rc-update add hotplug default
# /etc/init.d/hotplug startIf you type sane-find-scanner you should see:
Code: Select all
# sane-find-scanner7.) One last importand change, when you emerge xsane the program will add group scanner to your /etc/group file. At the end of the file you will find (your number might be different - DO Not change this number):# No SCSI scanners found. If you expected something different, make sure that
# you have loaded a SCSI driver for your SCSI adapter.
found USB scanner (vendor=0x04b8 [EPSON], product=0x011b [EPSON Scanner]) at libusb:001:003
# Your USB scanner was (probably) detected. It may or may not be supported by
# SANE. Try scanimage -L and read the backend's manpage.
# Not checking for parallel port scanners.
# Most Scanners connected to the parallel port or other proprietary ports
# can't be detected by this program.
# You may want to run this program as root to find all devices. Once you
# found the scanner devices, be sure to adjust access permissions as
# necessary.
scanner
add to the end root and yourself (or any other users that will have access to the scanner):
scanner
Exit and login your session for group to take effect.
Now in console as user type:
In console type groups
$ groups
tty wheel uucp audio games users scanner
Make sure you see "scanner" word above.
Code: Select all
$ xsaneIf you find that I missed anything or your scanner requires an additional configuration post your message here with additional instructions.
Final ERROR NOTES:
Sometimes when you restart your hotplug you will get an error:
Starting usb hotplugging...
chown: cannot access `/proc/bus/usb/001/005': No such file or directory
chmod: cannot access `/proc/bus/usb/001/005': No such file or directory
See this thread:
http://forums.gentoo.org/viewtopic.php?t=172556
and bug report:
http://bugs.gentoo.org/show_bug.cgi?id=50934
If you have a solutions share it with us, I was not able to resolve this bug.






