From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: udev rule for usb printer
Date: Wed, 21 Jan 2004 19:36:39 +0000 [thread overview]
Message-ID: <20040121193639.GA31628@vrfy.org> (raw)
In-Reply-To: <200401211924.08672.bobb@absamail.co.za>
On Wed, Jan 21, 2004 at 07:24:08PM +0200, Bob Barry wrote:
> I have a Lexmark Z52 usb printer. To get it going I put the following into /etc/udev/udev.rules:
> # USB Lexmark Z52 printer to be called lp_Z52
> BUS="usb", SYSFS_product="Lexmark Z52", NAME="lp_Z52", SYMLINK="usblp0"
> But hotplug/udev ignored it and started:
> crw-rw---- 1 root lp 180, 0 2004-01-08 17:46 /dev/lp0
> with no symlink.
>
> I got the "product" label from:
> asterix:udev> cd /sys
> asterix:sys> find . -type f | xargs grep Z52 2>/dev/null
> ./devices/pci0000:00/0000:00:02.0/usb1/1-1/product:Lexmark Z52
>
> To be very sure of what was in the string:
> asterix:sys> s=$(find . -type f | xargs grep Z52 2>/dev/null); s=${s}"XX"; echo $s
> ./devices/pci0000:00/0000:00:02.0/usb1/1-1/product:Lexmark Z52XX
> asterix:sys> echo ${s##*:}
> Lexmark Z52XX
> asterix:sys> echo ${s##*:} | od -t x1
> 0000000 4c 65 78 6d 61 72 6b 20 5a 35 32 58 58 0a
> 0000016
> asterix:sys>
>
> Should my rule with SYSFS_product have worked?
> Is my syntax wrong?
> Where am I misunderstanding?
> Newbies like me could use heaps more rule examples.
You may try the extras/udevinfo/udevinfo program.
This is quite new, so I want to know if this can help.
Change into the directory and type "make me" to build it.
Then execute "./udevinfo /sys/class/video4linux/video0" and it will print
all possible attributes in the key format for a rule.
looking at class device '/sys/class/video4linux/video0':
SYSFS_dev="81:0"
SYSFS_name="OV511 USB Camera"
SYSFS_custom_id="21"
SYSFS_model="Creative Labs WebCam 3"
SYSFS_bridge="OV511+"
SYSFS_sensor="OV7620"
SYSFS_brightness="97"
SYSFS_saturation="192"
SYSFS_contrast="86"
SYSFS_hue="128"
SYSFS_exposure="0"
...
Good luck,
Kay
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2004-01-21 19:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-21 17:24 udev rule for usb printer Bob Barry
2004-01-21 19:36 ` Kay Sievers [this message]
2004-01-22 8:10 ` Bob Barry
2004-01-22 10:04 ` Kay Sievers
2004-01-22 15:51 ` Greg KH
2004-01-22 20:56 ` Bob Barry
2004-01-27 14:24 ` Bob Barry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040121193639.GA31628@vrfy.org \
--to=kay.sievers@vrfy.org \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).