Revision [1052]

Last edited on 2007-09-23 10:34:42 by MreimeR [Hinweis, dass Tutorial veraltet ist.]

No Differences

Revision [1051]

Edited on 2007-09-23 10:33:31 by MreimeR [Hinweis, dass Tutorial veraltet ist.]
Additions:
''Achtung: Dieses Tutorial ist mit Slackware 12.0 und dem dort standardmäßig aktiven UDEV nicht mehr nötig. Das Setzen der Gruppe "scanner" und der Berechtigungen auf "664" sollte durch das UDEV-Ruleset ##/etc/udev/rules.d/80-libsane.rules## erledigt werden, und wird dann auch beim Einstecken des Scanners automatisch durchgeführt (kein erneutes Aufrufen von rc.usbscanner mehr, wenn das USB-Gerät später zugesteckt wird). Die Datei 80-libsane.rules ist weitestgehend selbsterklärend. Fehlende Scanner können hier einfach durch Anfügen einer neuen Zeile mit den passender Produkt-ID und Hersteller-ID aufgenommen werden.''


Revision [988]

Edited on 2007-07-10 23:03:43 by MreimeR [[Wiederhergestellt (Spam)]]
Additions:
Genau hierfür habe ich das Skript rc.usbscanner geschrieben. Ich verwende es unter Slackware, aber es sollte eigentlich unter jeder Linuxdistribution funktionieren und kann als Startskript verwendet werden. Dazu einfach das Skript nach /etc/rc.d/rc.usbscanner kopieren, es mittels chmod u+x ausführbar machen und in die /etc/rc.d/rc.local folgende Zeilen anhängen:
sed -rn "s/.*\(vendor=${vendor}[ ,].*product=${product}[ \)].*libusb:([0-9]+:[0-9]+)$/\1/p" | \
chmod g+w "$devicepath"
Deletions:
Genau hierfür habe ich das Skript rc.usbscanner geschrieben. Ich verwende es unter Slackware, aber es sollte eigentlich unter jeder Linuxdistribution funktionieren und kann als Startskript verwendet werden. Dazu einfach das Skript nach /etc/rc.d/rc.usbscanner kopieren, es mittels chmod u x ausführbar machen und in die /etc/rc.d/rc.local folgende Zeilen anhängen:
sed -rn "s/.*\(vendor=${vendor}[ ,].*product=${product}[ \)].*libusb:([0-9] :[0-9] )$/\1/p" | \
chmod g w "$devicepath"


Revision [986]

Edited on 2007-07-10 21:09:33 by McxUhg [[Wiederhergestellt (Spam)]]
Additions:
Genau hierfür habe ich das Skript rc.usbscanner geschrieben. Ich verwende es unter Slackware, aber es sollte eigentlich unter jeder Linuxdistribution funktionieren und kann als Startskript verwendet werden. Dazu einfach das Skript nach /etc/rc.d/rc.usbscanner kopieren, es mittels chmod u x ausführbar machen und in die /etc/rc.d/rc.local folgende Zeilen anhängen:
sed -rn "s/.*\(vendor=${vendor}[ ,].*product=${product}[ \)].*libusb:([0-9] :[0-9] )$/\1/p" | \
chmod g w "$devicepath"
Deletions:
Genau hierfür habe ich das Skript rc.usbscanner geschrieben. Ich verwende es unter Slackware, aber es sollte eigentlich unter jeder Linuxdistribution funktionieren und kann als Startskript verwendet werden. Dazu einfach das Skript nach /etc/rc.d/rc.usbscanner kopieren, es mittels chmod u+x ausführbar machen und in die /etc/rc.d/rc.local folgende Zeilen anhängen:
sed -rn "s/.*\(vendor=${vendor}[ ,].*product=${product}[ \)].*libusb:([0-9]+:[0-9]+)$/\1/p" | \
chmod g+w "$devicepath"


Revision [838]

Edited on 2007-01-28 15:01:28 by MreimeR [added support for /dev/bus]
Additions:
# Last Change: 28.01.2007
usbscanner_main() {
### fetch the "data line" for the scanner definded by "vendor" and "product" ###
line=`/usr/bin/sane-find-scanner -q | \
sed -rn "s/.*\(vendor=${vendor}[ ,].*product=${product}[ \)].*libusb:([0-9]+:[0-9]+)$/\1/p" | \
head -n1`
# You determine the full Path of the Binary "sane-find-scanner"
# with the Command "find /usr -name sane-find-scanner".
### Check if we got a match from sane-find-scanner ###
if [ "$line" == "" ]; then
### cut the parts from our "data line" ###

### Try to find the device path ###
devicepath="/proc/bus/usb/${bus}/${device}"
if [ ! -w "$devicepath" ]; then
devicepath="/dev/bus/usb/${bus}/${device}"
if [ ! -w "$devicepath" ]; then
echo "Scanner initialization error! Device cannot be found!"
### Set privileges ###
case "$1" in
'start' | 'restart')
chown "root:${group}" "$devicepath"
chmod g+w "$devicepath"
;;
'stop')
chown "root:root" "$devicepath"
chmod g-w "$devicepath"
;;
esac
usbscanner_main start
usbscanner_main stop
usbscanner_main restart
Deletions:
# Last Change: 21.01.2007
### fetch the "data line" for the scanner definded by "vendor" and "product" ###
line=`/usr/bin/sane-find-scanner -q | \
sed -rn "s/.*\(vendor=${vendor}[ ,].*product=${product}[ \)].*:([0-9]+:[0-9]+)$/\1/p" | \
head -n1`
# You determine the full Path of the Binary "sane-find-scanner"
# with the Command "find /usr -name sane-find-scanner".
### Get the values out of our data line ###
bus=''
device=''
if [ "$line" != "" ]; then
# cut the parts from our "data line"
# Add zeros, if they are missing, to get a 3-char value
bus=`echo "00${bus}" | sed -rn 's/.*([0-9][0-9][0-9])$/\1/p'`
device=`echo "00${device}" | sed -rn 's/.*([0-9][0-9][0-9])$/\1/p'`
fi
usbscanner_check() {
if [ "$bus" == "" ] || [ "$device" = "" ]; then
if [ ! -w "/proc/bus/usb/${bus}/${device}" ]; then
echo "sane-find-scanner returned wrong information!"
echo "no scanner found on '/proc/bus/usb/${bus}/${device}'"
usbscanner_start() {
usbscanner_check
cd "/proc/bus/usb/${bus}"
chown "root:${group}" "${device}"
chmod g+w "${device}"
usbscanner_stop() {
usbscanner_check
cd "/proc/bus/usb/${bus}"
chown root:root "${device}"
chmod g-w "${device}"
usbscanner_restart() {
usbscanner_start
usbscanner_start
usbscanner_stop
usbscanner_restart


Revision [835]

Edited on 2007-01-21 11:10:54 by MreimeR [Aktualisiert mit meiner Version des Scriptes]
Additions:
%%(bash)#!/bin/sh
#
# /etc/rc.d/rc.usbscanner:
#
# Since Linux-Kernel 2.6x doesn't support a generic usb-scanner-modul
# (it is obsolete ;) there is no devicenode in /dev or /dev/usb for your
# scanner.
# But xsane and other programs can acces your scanner via libusb.
# Therefore the permissions for your scanner in /proc/bus/usb/ must be set.
# This does this script for you.
#
# I have written it for Slackware, but it also should work with other
# Linux distributions.
#
# Just adjust the vendorid and productid for your scanner in line
# 36 and 37 and assure, that the skript will be executed at startup.
# sane-find-scanner -q prints this values
#
# initially written by: Thomas Flaig, t.gf@freenet.de
#
# current version by Manuel Reimer, (Manuel _dot_ Reimer _at_ gmx _dot_ de)
#
# Last Change: 21.01.2007
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
vendor=0x04b8
product=0x0122
group=scanner # Group which should be able to access the scanner
# You shouldn't have to worry about anything from this line on.
### fetch the "data line" for the scanner definded by "vendor" and "product" ###
line=`/usr/bin/sane-find-scanner -q | \
sed -rn "s/.*\(vendor=${vendor}[ ,].*product=${product}[ \)].*:([0-9]+:[0-9]+)$/\1/p" | \
head -n1`
# You determine the full Path of the Binary "sane-find-scanner"
# with the Command "find /usr -name sane-find-scanner".
### Get the values out of our data line ###
bus=''
device=''
if [ "$line" != "" ]; then
# cut the parts from our "data line"
bus=`echo "$line" | cut -d : -f 1`
device=`echo "$line" | cut -d : -f 2`
# Add zeros, if they are missing, to get a 3-char value
bus=`echo "00${bus}" | sed -rn 's/.*([0-9][0-9][0-9])$/\1/p'`
device=`echo "00${device}" | sed -rn 's/.*([0-9][0-9][0-9])$/\1/p'`
fi
usbscanner_check() {
if [ "$bus" == "" ] || [ "$device" = "" ]; then
echo "Scanner initialization error! No USB scanner found!"
exit 1
fi
if [ ! -w "/proc/bus/usb/${bus}/${device}" ]; then
echo "sane-find-scanner returned wrong information!"
echo "no scanner found on '/proc/bus/usb/${bus}/${device}'"
exit 1
fi
}
usbscanner_start() {
usbscanner_check
cd "/proc/bus/usb/${bus}"
chown "root:${group}" "${device}"
chmod g+w "${device}"
}
usbscanner_stop() {
usbscanner_check
cd "/proc/bus/usb/${bus}"
chown root:root "${device}"
chmod g-w "${device}"
}
usbscanner_restart() {
usbscanner_start
}
case "$1" in
'start')
'stop')
'restart')
*)
esac
Deletions:
%%(bash) #!/bin/sh
#
# /etc/rc.d/rc.usbscanner:
#
# Since Linux-Kernel 2.6x doesn't support a generic usb-scanner-modul
# (it is obsolete ;) there is no devicenode in /dev or /dev/usb for your scanner.
# But xsane and other programs can acces your scanner via libusb.
# Therefore the permissions for your scanner in /proc/bus/usb/ must be set.
# This does this script for you.
#
# I have written it for Slackware, but it also should work with other
# Linux distributions.
# Just adjust the vendorid and productid for your scanner in line
# 36 and 37 and assure, that the skript will be executed at startup.
# sane-find-scanner -q prints this values
#
# written by: Thomas Flaig, t.gf@freenet.de
#
# Last Change: 20.05.2004
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
vendor=04a9
product=2206
group=scanner#Group which should be able to access the scanner
# You shouldn't have to worry about anything from this line on.
line=`/usr/bin/sane-find-scanner -q | grep ${vendor} | grep ${product} | sed -r 's/:/\n/'| sed -r 's/:/\n/' | sed 1d `
#You determine the full Path of the Binary "sane-find-scanner" with the Command "find /usr -name sane-find-scanner".
bus=`echo $line | sed 's/\ /\n/' | sed 2d `
device=`echo $line | sed 's/\ /\n/' | sed 1d `
usbscanner_start(){
cd /proc/bus/usb/${bus}
chown root:${group} ${device}
chmod g+w ${device}
}
usbscanner_stop(){
cd /proc/bus/usb/${bus}
chown root:root ${device}
chmod g-w ${device}
}
usbscanner_restart(){
}
case "$1" in
'start')
'stop')
'restart')
*)
esac


Revision [716]

Edited on 2006-08-26 22:49:23 by ThomasPreuss [Aktualisiert mit meiner Version des Scriptes]
Additions:
line=`/usr/bin/sane-find-scanner -q | grep ${vendor} | grep ${product} | sed -r 's/:/\n/'| sed -r 's/:/\n/' | sed 1d `
#You determine the full Path of the Binary "sane-find-scanner" with the Command "find /usr -name sane-find-scanner".
Deletions:
line=`/usr/bin/sane-find-scanner -q | grep ${vendor} | grep ${product} | sed -r 's/:/\n/'| sed -r 's/:/\n/' | sed 1d `


Revision [715]

Edited on 2006-08-26 22:30:58 by MreimeR [Pfad korrigiert]
Additions:
line=`/usr/bin/sane-find-scanner -q | grep ${vendor} | grep ${product} | sed -r 's/:/\n/'| sed -r 's/:/\n/' | sed 1d `
Deletions:
line=`/usr/local/bin/sane-find-scanner -q | grep ${vendor} | grep ${product} | sed -r 's/:/\n/'| sed -r 's/:/\n/' | sed 1d `


Revision [714]

Edited on 2006-08-26 19:36:04 by MreimeR [absoluter Pfad für sane-find-scanner]
Additions:
line=`/usr/local/bin/sane-find-scanner -q | grep ${vendor} | grep ${product} | sed -r 's/:/\n/'| sed -r 's/:/\n/' | sed 1d `
Deletions:
line=`sane-find-scanner -q | grep ${vendor} | grep ${product} | sed -r 's/:/\n/'| sed -r 's/:/\n/' | sed 1d `


Revision [351]

Edited on 2006-01-07 13:48:13 by MreimeR [absoluter Pfad für sane-find-scanner]
Additions:
[[CategoryTipps]] [[CategoryHardware]]
Deletions:
[[CategoryTipps]]


Revision [332]

Edited on 2006-01-07 13:29:54 by MreimeR [absoluter Pfad für sane-find-scanner]
Additions:
==Kategorien==
[[CategoryTipps]]


Revision [291]

Edited on 2006-01-06 00:34:55 by MreimeR [absoluter Pfad für sane-find-scanner]
Additions:
%%(bash) #!/bin/sh
#EOF
%%
Deletions:
#!/bin/sh
#EOF


Revision [256]

Edited on 2005-12-02 22:13:32 by ChaOS [absoluter Pfad für sane-find-scanner]
Additions:
# (it is obsolete ;) there is no devicenode in /dev or /dev/usb for your scanner.
# Therefore the permissions for your scanner in /proc/bus/usb/ must be set.
# This does this script for you.
# Linux distributions.
Deletions:
# (it is obsolete ;) there is no devicenode in /dev or /dev/usb.
# Therefore the permissions for your scanner in /proc/bus/usb/ must be set
# right. This does this script you.
# distributions.


Revision [255]

Edited on 2005-12-02 22:10:58 by ChaOS [absoluter Pfad für sane-find-scanner]
Additions:
Aber nun das Skript:
Deletions:
Aber nun das Skript (Es steht auf http://home.in.tum.de/flaig/linux/rc.usbscanner/rc.usbscanner zum Download bereit):


Revision [65]

The oldest known version of this page was created on 2005-08-22 12:22:07 by ChaOS [absoluter Pfad für sane-find-scanner]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki