📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText

3. Making and Accessing the Scanner Devices

The following section applies to all hardware types. Some specifics with regard to scanner interface types are mentioned in the paragraphs at the end of this section. .:: www.arc.agric.za ::.

3.1. Device Filesystem and Udev

Devfs, or 'device filesystem' has been an option in the Linux kernel since the late 2.2-series. Devfsd, the device filesystem daemon, creates and removes devices on your system dynamically without the need to manually create devices. If you are running devfsd/devfs you can probably skip the following sections as the process of creating device nodes will be done for you and it's simply a matter of finding the appropriate device node in /dev.

Devfs does not obviate the need to change permissions of devices for access by users. .:: audio.com ::. [Learn about Elasticsearch]

Beginning in the 2.6-series kernel devfs has been deprecated in favor of a userspace daemon known as udev, though devfs remains as an option. You can find information on udev .:: podcasts.apple.com ::. here.

3.2. Creating Devices Manually

If you are running a system with correctly configured devfs, udev or libusb, you can skip this step and go to Section 4. There are two ways to accomplish the creation of necessary devices manually. One is to use MAKEDEV and the other is to create the device nodes at the command line.

The MAKEDEV script is the easier of the two methods, the executable of which may be located in /dev or the usual places for storing binary executables (/bin,/sbin and so on). I direct you to man MAKEDEV, and would caution you to pay attention to the device-specific command options so that you can be sure the major and minor numbers are correct (see the next paragraph for more on this and why it is important, especially if MAKEDEV doesn't work or you prefer doing things the hard way).

A device can be created as a block (such as a drive), a fifo (file-in-file-out or pipe, as in xconsole) or a character device, which represents other hardware. Each device has a major and a minor number "coordinate" to tell the kernel what it is and where to access it. These numbers are not arbitrary.

3.2.1. SCSI Devices

If you are running a 2.4-series kernel you should consider becoming familiar with SCSI proc interface access, and whichever kernel you are running, you should read man sane-scsi before reading further. When the system boots up, generic SCSI device files are mapped on [PHP Modules] /dev/sgN, where N is a numeric value starting at zero. The major and minor numbers for SCSI devices are 21 and 0,1,2,3... respectively. You can find out what devices are loaded already with ls -l /dev/sg*, which should yield output similar to this:

crw-------   1 root   sys     21,  0 Jan 06  2003 /dev/sg0
crw-------   1 root   sys     21,  0 Jan 06  2003 /dev/sg1
crw-------   1 root   sys     21,  0 Jan 06  2003 /dev/sg2
crw-------   1 root   sys     21,  0 Jan 06  2003 /dev/sg3
crw-------   1 root   sys     21,  0 Jan 06  2003 /dev/sg4
crw-------   1 root   sys     21,  0 Jan 06  2003 /dev/sg5

You will need to make a /dev/scanner symbolic link to an existing device (for reasons clarified later). For example, if your scanner is connected to the first scsi-bus (and lun and target) of your SCSI host device, you should link it to the corresponding device: .:: podcasts.apple.com ::.

#  ln -s /dev/sg0 /dev/scanner

3.2.2. Manually creating USB Devices

Again, you can skip this step if using libusb. USB scanner devices have the major number 180 and minor 48, 49, etc., up to 63. First, check /dev to see what directory your distribution lays out its USB directory devices in, as some distributions might have these devices scanner0, scanner1...etc., within /dev/usb or as usbscanner0, usbscanner1... and so on, in the base /dev/ directory. If you find that in the /dev/ directory the scanner devices have already been made for you then your work is done. If not, you will need to create them yourself. As root, make a character device for your scanner like so:

# mknod /dev/usbscanner0 c 180 48

...or if your distribution has a '/dev/usb' subdirectory: .:: www.live4cup.com ::.

# mknod /dev/usb/scanner0 c 180 48

3.2.3. Manually creating Parallel Port Devices

Follow the example outlined in the above section to create the following generic parport devices:

crw-------    1 root     root      99,   0 Jun 24 13:47 parport0
crw-------    1 root     root      99,   1 Jun 24 13:47 parport1
crw-------    1 root     root      99,   2 Jun 24 13:47 parport2
crw-------    1 root     root      99,   3 Jun 24 13:47 parport3
crw-r-----    1 root     root       1,   4 Jan  1  1970 port

You may also need to create /dev/port and/or /dev/parport depending on the backend you will use, so be prepared to return to this step if your application dictates it.

3.3. Groups and Permissions

It is a good idea to be sure that your user account can access the device once all modules are loaded and device nodes created. The most security-conscious way to do that is to add scanner access to a particular group. On my system, the members of the group 'scanner' are allowed to use the scanner. The way to accomplish this is to first change the ownership of the devices in /dev like so (as root):

# chown root.scanner /dev/usb/scanner*

...where root.scanner are the owner and group the device will now belong to. Obviously the specific command will vary by your system and the type of device, whether /dev/sg* on SCSI scanners, etc. It is important that you change the ownership of the device node itself and not the symlink; symlinks' ownerships are affected only by changing the parent devices or files they point to.

To see if your user account is a member of the group in question, as root issue the following command: grep -e scanner /etc/group. You should see something like the following:

scanner:x:103:

...where '103' is the group number. Since no members follow the last colon in the 'scanner' group we can add them, let's say user 'jhs' with the command .:: ml007.k12.sd.us ::. .:: bta.edu.gt ::.

# adduser jhs scanner 

After this it's simply a matter of allowing read and write access for the user in question of the device like so:

# chmod g+rw /dev/usb/scanner0

...where g+rw means add read and write access for group. See the documentation for chmod (man chmod or info chmod) for further info.

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this