1141cc406Sopenharmony_ciThis is a report on how to build SANE on Solaris/x86 using a USB scanner. See 2141cc406Sopenharmony_cibelow for SCSI. 3141cc406Sopenharmony_ci 4141cc406Sopenharmony_ciAnother report for SANE on OpenSolaris can be found here: 5141cc406Sopenharmony_cihttp://ginfo.egim-mrs.fr/article.php3?id_article=44 6141cc406Sopenharmony_ci 7141cc406Sopenharmony_ciFrom: Tomasz Orlinski <tomasz.orlinski@wp.pl> 8141cc406Sopenharmony_ciTo: sane-devel@lists.alioth.debian.org 9141cc406Sopenharmony_ciSubject: [sane-devel] USB scanners DO work on Solaris 10 x86 10141cc406Sopenharmony_ciDate: Thu, 7 Oct 2004 20:26:50 +0200 11141cc406Sopenharmony_ci 12141cc406Sopenharmony_ciI would like to inform you, that I have compiled SANE on Sun Solaris 10 x86 13141cc406Sopenharmony_ciwith built-in USB scanner support. It was possible, because Sun had prepared 14141cc406Sopenharmony_cilibusb library wrapper for Solaris 10. I know, that Solaris 10 Software 15141cc406Sopenharmony_ciExpress Release 08/04 is required. I have done it in that way: 16141cc406Sopenharmony_ciLD_LIBRARY_PATH=/usr/sfw/lib:$LD_LIBRARY_PATH 17141cc406Sopenharmony_ciCFLAGS="-I/usr/sfw/include" 18141cc406Sopenharmony_ciCPPFLAGS="-I/usr/sfw/include" 19141cc406Sopenharmony_ciLDFLAGS="-L/usr/sfw/lib -R/usr/sfw/lib -lusb" 20141cc406Sopenharmony_ciexport LD_LIBRARY_PATH CFLAGS CPPFLAGS LDFLAGS 21141cc406Sopenharmony_ci./configure --prefix=/opt/sane --disable-fork-process 22141cc406Sopenharmony_cimake 23141cc406Sopenharmony_cimake install 24141cc406Sopenharmony_ciIt was also required to add a generic USB kernel driver. I had to look for 25141cc406Sopenharmony_cimy scanner device name in output of 26141cc406Sopenharmony_ciprtconf -D -v 27141cc406Sopenharmony_cicommand. My scanner is Plustek UT24 and the appropriate part of output looked 28141cc406Sopenharmony_cilike this: 29141cc406Sopenharmony_ciname='compatible' type=string items=8 value='usb7b3,17.100' + ... 30141cc406Sopenharmony_ciI had to remove the not used kernel driver 31141cc406Sopenharmony_cirem_drv ugen 32141cc406Sopenharmony_ciAnd add it again: 33141cc406Sopenharmony_ciadd_drv -i 'usb7b3,17.100' ugen 34141cc406Sopenharmony_ciThen, /opt/sane/bin/sane-find-scanner detected my scanner and everything 35141cc406Sopenharmony_ciworked fine. I to add " " signs around usb7b3,17.100 name in 36141cc406Sopenharmony_ci/etc/driver_aliases to have the scanner working after reboot. 37141cc406Sopenharmony_ciTo compile this packages SUNWlibusb and SUNWlibusbugen were needed. I used 38141cc406Sopenharmony_ciSolaris Software Companion CD gcc 2.95.3 compiler and Sun's /usr/ccs/bin/ld 39141cc406Sopenharmony_cilinker. USB support DOES NOT work in Solaris 9 and earlier versions. 40141cc406Sopenharmony_ciI hope, that this information would be useful for other USB scanner users. 41141cc406Sopenharmony_ci 42141cc406Sopenharmony_ciFrom: Tomasz Orlinski <tomasz.orlinski@wp.pl> 43141cc406Sopenharmony_ciTo: sane-devel@lists.alioth.debian.org 44141cc406Sopenharmony_ciSubject: Re: [sane-devel] USB scanners DO work on Solaris 10 x86 45141cc406Sopenharmony_ciDate: Fri, 8 Oct 2004 16:06:14 +0200 46141cc406Sopenharmony_ci 47141cc406Sopenharmony_ci[...] 48141cc406Sopenharmony_ci 49141cc406Sopenharmony_ciSun in Driver Development Kit v. 0.9 writes how to compile SANE, but it does not 50141cc406Sopenharmony_cireally work :) They write about compiling with gcc and give options for Sun 51141cc406Sopenharmony_ciForte compiler (cc) and forget about attaching a kernel driver. But they write, 52141cc406Sopenharmony_cithat versions earlier than 1.0.14 cannot be used. They want also to build SANE 53141cc406Sopenharmony_ciwith Posix threads enabled. So I think that can be true. Sun writes also, that 54141cc406Sopenharmony_ciSolaris Software Express release at least S10_62 is needed to use 55141cc406Sopenharmony_cilibusb. Release number can be checked in /etc/release. The newest version can be 56141cc406Sopenharmony_cidownloaded from www.sun.com/solaris for free. 57141cc406Sopenharmony_ci 58141cc406Sopenharmony_ciIn my opinion it is important to be cautious when using scanner or just libusb 59141cc406Sopenharmony_cion important Solaris machines (especially multi-processor ones), because unlike 60141cc406Sopenharmony_ciin other systems, Solaris kernel is fully preemtible, what means, that many 61141cc406Sopenharmony_ciinstances of the same driver can run simultaneously - it's dangerous, when 62141cc406Sopenharmony_cidrivers are not perfect. And Solaris USB framework is absolutely new, so it can 63141cc406Sopenharmony_cicontain bugs. I tried to crash my Solaris using USB subsystem and SANE, I didn't 64141cc406Sopenharmony_cimanage to, but it doesn't mean, it's impossible. 65141cc406Sopenharmony_ci 66141cc406Sopenharmony_ciSANE frontends work without any problems with Xsun and GIMP included in Solaris 67141cc406Sopenharmony_ciSoftware Companion CD. 68141cc406Sopenharmony_ci 69141cc406Sopenharmony_ci--------------------------------------------------------------------------- 70141cc406Sopenharmony_ciThe following text describes, how to use a SCSI scanner (2002-06-11). 71141cc406Sopenharmony_ci 72141cc406Sopenharmony_ciYou need a generic SCSI driver to run SANE on Solaris. There are at 73141cc406Sopenharmony_cileast three such drivers: the scg driver by Joerg Schillig, the 74141cc406Sopenharmony_cisg driver by Kevin Sheehan, and starting with Solaris 8 Sun's own 75141cc406Sopenharmony_cisgen(7D) driver. 76141cc406Sopenharmony_ci 77141cc406Sopenharmony_ciNOTE: You should install the SCSI generic driver BEFORE you run 78141cc406Sopenharmony_ci`configure' in the sane directory---otherwise configure won't set up 79141cc406Sopenharmony_ciSANE to work with the generic scsi driver. 80141cc406Sopenharmony_ci 81141cc406Sopenharmony_ci*** scg driver 82141cc406Sopenharmony_ci 83141cc406Sopenharmony_ciThe SCSI general driver scg is 84141cc406Sopenharmony_ci 85141cc406Sopenharmony_ci Copyright 1986-1995 Joerg Schilling, 86141cc406Sopenharmony_ci 87141cc406Sopenharmony_ciIt is supplied binary in pkgadd(1m) format and is tested from Solaris 88141cc406Sopenharmony_ci2.3 to Solaris 2.6 (sparc) and Solaris 2.3 to Solaris 2.5.1 (x86). It 89141cc406Sopenharmony_cican be found in 90141cc406Sopenharmony_ci 91141cc406Sopenharmony_ci ftp://ftp.fokus.gmd.de/pub/unix/kernel/scg/ 92141cc406Sopenharmony_ci 93141cc406Sopenharmony_ciTo install it on a SPARC do: 94141cc406Sopenharmony_ci 95141cc406Sopenharmony_ci cd /tmp 96141cc406Sopenharmony_ci get SCHILYscg.sparc.tar.Z 97141cc406Sopenharmony_ci uncompress SCHILYscg.sparc.tar.Z 98141cc406Sopenharmony_ci tar -xvf SCHILYscg.sparc.tar 99141cc406Sopenharmony_cias root: 100141cc406Sopenharmony_ci pkgadd -d . 101141cc406Sopenharmony_ci 102141cc406Sopenharmony_ciNOTE: Be very careful with pkgadd as it does not check for the correct 103141cc406Sopenharmony_ci target architecture. Do not install drivers for x86 on sparc 104141cc406Sopenharmony_ci and vice versa. You will get a corrupt system otherwise. 105141cc406Sopenharmony_ci 106141cc406Sopenharmony_ciFor Solaris on an x86 do: 107141cc406Sopenharmony_ci 108141cc406Sopenharmony_ci cd /tmp 109141cc406Sopenharmony_ci get SCHILYscg.i386.tar.Z 110141cc406Sopenharmony_ci uncompress SCHILYscg.i386.tar.Z 111141cc406Sopenharmony_ci tar -xvf SCHILYscg.i386.tar 112141cc406Sopenharmony_cias root: 113141cc406Sopenharmony_ci pkgadd -d . 114141cc406Sopenharmony_ci 115141cc406Sopenharmony_ciThen do a reboot --r 116141cc406Sopenharmony_ci 117141cc406Sopenharmony_ciOnce the system has rebooted, there should be a device node /dev/scgXX 118141cc406Sopenharmony_cifor each of your SCSI adapters (/dev/scg0 for the first adapter, 119141cc406Sopenharmony_ci/dev/scg1 for the second, and so on...) 120141cc406Sopenharmony_ci 121141cc406Sopenharmony_ciBecause the device name specifies a SCSI adapter, you need to use a 122141cc406Sopenharmony_cispecial device naming syntax so SANE can tell which device you want to 123141cc406Sopenharmony_citalk to. If the device is at SCSI id 0, the character 'a' should be 124141cc406Sopenharmony_ciappended, character 'b' should be used for SCSI id 1, and so on 125141cc406Sopenharmony_ci(see also the Solaris section in sane-scsi(5)). 126141cc406Sopenharmony_ci 127141cc406Sopenharmony_ciE.g., to configure an HP scanner, configuration file 128141cc406Sopenharmony_ci/opt/local/etc/sane.d/hp.conf might contain: 129141cc406Sopenharmony_ci 130141cc406Sopenharmony_ci /dev/scg0c if the scanner has the SCSI target id 2 131141cc406Sopenharmony_ci 132141cc406Sopenharmony_ciWARNING! Everybody who can read/write a generic SCSI device can do 133141cc406Sopenharmony_ciwith all your disks whatever he/she wants. It takes only a few lines 134141cc406Sopenharmony_ciof code to send a FORMAT control block... Rather than giving users 135141cc406Sopenharmony_ciaccess to the SCSI adapter special device, it may be a better idea to 136141cc406Sopenharmony_ciinstall scanimage/xscanimage setgid to a special "scanner" group and 137141cc406Sopenharmony_cithen turn on write permission for the scanner group. 138141cc406Sopenharmony_ci 139141cc406Sopenharmony_ci*** sg driver 140141cc406Sopenharmony_ci 141141cc406Sopenharmony_ciAnother solution to the permission problem is to use the generic SCSI 142141cc406Sopenharmony_cidriver sg by Kevin Sheehan. This driver is not free but uses separate 143141cc406Sopenharmony_cidevice node for each SCSI target: 144141cc406Sopenharmony_ci 145141cc406Sopenharmony_ci /dev/sg/0, /dev/sg/1, ... 146141cc406Sopenharmony_ci 147141cc406Sopenharmony_ciThis allows to control device access on a per-device basis. 148141cc406Sopenharmony_ci 149141cc406Sopenharmony_ci*** sgen driver 150141cc406Sopenharmony_ci 151141cc406Sopenharmony_ciThe solaris 8 sgen driver must be configured before it can be used. 152141cc406Sopenharmony_ciSee /kernel/drv/sgen.conf and the manual page sgen(7D). 153141cc406Sopenharmony_ci 154141cc406Sopenharmony_ciThe minimal config includes defining the correct 155141cc406Sopenharmony_ci"device-type-config-list" property in /kernel/drv/sgen.conf. The 156141cc406Sopenharmony_citypical SCSI device type for a scanner is either "scanner" or 157141cc406Sopenharmony_ci"processor". You can optionally restrict the devices sgen attaches to, 158141cc406Sopenharmony_ciby defining the "inquiry-config-list" property. You also have to 159141cc406Sopenharmony_ciuncomment the scanner's "target/lun" entry, so that the sgen driver is 160141cc406Sopenharmony_ciallowed to attach to the SCSI scanner hardware. 161141cc406Sopenharmony_ci 162141cc406Sopenharmony_ciAfter the configuration file /kernel/drv/sgen.conf is set up for the 163141cc406Sopenharmony_ciscanner, run the command "devfsadm -v -i sgen" to create sgen device 164141cc406Sopenharmony_cinodes for the scanner. In case you need to rerun devfsadm to 165141cc406Sopenharmony_ciincorporate changes to the sgen.conf file, make sure the sgen driver 166141cc406Sopenharmony_ciis unloaded from the kernel before you re-run devfsadm. The driver is 167141cc406Sopenharmony_ciunloaded using the "modunload -i {id}" command; the {id} of the sgen 168141cc406Sopenharmony_cidriver can be determined with the modinfo command. 169141cc406Sopenharmony_ci 170141cc406Sopenharmony_ci 171141cc406Sopenharmony_ciThe device nodes use names of the following form: 172141cc406Sopenharmony_ci 173141cc406Sopenharmony_ci /dev/scsi/device-type/cXtXdX 174141cc406Sopenharmony_ci 175141cc406Sopenharmony_ciExample: A HP Scanjet 4c (SCSI device type: "processor") on controller 176141cc406Sopenharmony_ci#1, target #6, lun #0 uses the device name 177141cc406Sopenharmony_ci 178141cc406Sopenharmony_ci /dev/scsi/processor/c1t6d0 179141cc406Sopenharmony_ci 180141cc406Sopenharmony_ci/kernel/drv/sgen.conf contains: 181141cc406Sopenharmony_ci 182141cc406Sopenharmony_ci device-type-config-list="processor"; 183141cc406Sopenharmony_ci name="sgen" class="scsi" target=6 lun=0; 184141cc406Sopenharmony_ci 185141cc406Sopenharmony_ci 186141cc406Sopenharmony_ci 187141cc406Sopenharmony_ciIf you have questions or problems with the Solaris support in SANE, 188141cc406Sopenharmony_cisend mail to: 189141cc406Sopenharmony_ci 190141cc406Sopenharmony_ci hu@garfield.m.isar.de 191