Skip to contentSkip to conversation

udev rule for usb printer

DISCUSSION Bob Barry 3 participants 7 messages Jan 21, 2004 – Jan 27, 2004

lore
Share & tools
lore

Bob Barry

author
#0 lore raw

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.

TIA,

Bob Barry

-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 22 lines · Bob Barry

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> 
Quoted 4 lines

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#2 lore raw
In reply to Bob Barry

Kay -

Quoted 2 lines · On Thursday 22 January 2004 you wrote:

You may try the extras/udevinfo/udevinfo program. This is quite new, so I want to know if this can help.

I tried the udevinfo of udev-014. It has no man; no help for --help, -h, or no args; it does not seem to accept wild cards; it does not take arguments from standard input ("find ... | xargs udevinfo" does not work); and "udevinfo -a" does not list "all", as would be useful.

I finally got an
"all dev" listing with:

	for d in $(find /sys -type f -name dev | sed 's~/dev$~~')
	do
		./udevinfo $d
	done

The list is attached. My printer is there, but all that's offered are cryptic numbers:
SYSFS_detach_state="0"
SYSFS_bInterfaceNumber="00"
SYSFS_bAlternateSetting=" 0"
SYSFS_bNumEndpoints="02"
SYSFS_bInterfaceClass="07"
SYSFS_bInterfaceSubClass="01" SYSFS_bInterfaceProtocol="02"
SYSFS_iInterface="00"

There's no sign of the "product" I'd found, or of "name" or "model". Am I missing something, or misconfigured?

TIA,

Bob Barry

device '/sys/block/hdd' has major:minor 22:64

looking at class device '/sys/block/hdd':
SYSFS_dev="22:64"
SYSFS_range="1"
SYSFS_size="0"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

follow class device's "device" link '/sys/block/hdd':
BUS="ide"
ID="1.1"
SYSFS_detach_state="0"

device '/sys/block/hdc' has major:minor 22:0

looking at class device '/sys/block/hdc':
SYSFS_dev="22:0"
SYSFS_range="1"
SYSFS_size="0"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

follow class device's "device" link '/sys/block/hdc':
BUS="ide"
ID="1.0"
SYSFS_detach_state="0"

device '/sys/block/hda/hda6' has major:minor 3:6

looking at class device '/sys/block/hda/hda6':
SYSFS_dev="3:6"
SYSFS_start="25414893"
SYSFS_size="13687317"
SYSFS_stat=" 9 66 1 8"

follow class device's "device" link '/sys/block/hda':
BUS="ide"
ID="0.0"
SYSFS_detach_state="0"

device '/sys/block/hda/hda5' has major:minor 3:5

looking at class device '/sys/block/hda/hda5':
SYSFS_dev="3:5"
SYSFS_start="16000803"
SYSFS_size="9414027"
SYSFS_stat=" 862 16314 8785 70280"

follow class device's "device" link '/sys/block/hda':
BUS="ide"
ID="0.0"
SYSFS_detach_state="0"

device '/sys/block/hda/hda4' has major:minor 3:4

looking at class device '/sys/block/hda/hda4':
SYSFS_dev="3:4"
SYSFS_start="16000740"
SYSFS_size="2"
SYSFS_stat=" 0 0 0 0"

follow class device's "device" link '/sys/block/hda':
BUS="ide"
ID="0.0"
SYSFS_detach_state="0"

device '/sys/block/hda/hda3' has major:minor 3:3

looking at class device '/sys/block/hda/hda3':
SYSFS_dev="3:3"
SYSFS_start="2313360"
SYSFS_size="13687380"
SYSFS_stat=" 7125 224858 3359 26872"

follow class device's "device" link '/sys/block/hda':
BUS="ide"
ID="0.0"
SYSFS_detach_state="0"

device '/sys/block/hda/hda2' has major:minor 3:2

looking at class device '/sys/block/hda/hda2':
SYSFS_dev="3:2"
SYSFS_start="208845"
SYSFS_size="2104515"
SYSFS_stat=" 1 8 0 0"

follow class device's "device" link '/sys/block/hda':
BUS="ide"
ID="0.0"
SYSFS_detach_state="0"

device '/sys/block/hda/hda1' has major:minor 3:1

looking at class device '/sys/block/hda/hda1':
SYSFS_dev="3:1"
SYSFS_start="63"
SYSFS_size="208782"
SYSFS_stat=" 12 24 1 2"

follow class device's "device" link '/sys/block/hda':
BUS="ide"
ID="0.0"
SYSFS_detach_state="0"

device '/sys/block/hda' has major:minor 3:0

looking at class device '/sys/block/hda':
SYSFS_dev="3:0"
SYSFS_range="64"
SYSFS_size="39102336"
SYSFS_stat=" 7891 156 241574 82575 5517 6595 97162 212182 0 65746 294757"

follow class device's "device" link '/sys/block/hda':
BUS="ide"
ID="0.0"
SYSFS_detach_state="0"

device '/sys/block/ram15' has major:minor 1:15

looking at class device '/sys/block/ram15':
SYSFS_dev="1:15"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram14' has major:minor 1:14

looking at class device '/sys/block/ram14':
SYSFS_dev="1:14"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram13' has major:minor 1:13

looking at class device '/sys/block/ram13':
SYSFS_dev="1:13"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram12' has major:minor 1:12

looking at class device '/sys/block/ram12':
SYSFS_dev="1:12"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram11' has major:minor 1:11

looking at class device '/sys/block/ram11':
SYSFS_dev="1:11"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram10' has major:minor 1:10

looking at class device '/sys/block/ram10':
SYSFS_dev="1:10"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram9' has major:minor 1:9

looking at class device '/sys/block/ram9':
SYSFS_dev="1:9"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram8' has major:minor 1:8

looking at class device '/sys/block/ram8':
SYSFS_dev="1:8"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram7' has major:minor 1:7

looking at class device '/sys/block/ram7':
SYSFS_dev="1:7"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram6' has major:minor 1:6

looking at class device '/sys/block/ram6':
SYSFS_dev="1:6"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram5' has major:minor 1:5

looking at class device '/sys/block/ram5':
SYSFS_dev="1:5"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram4' has major:minor 1:4

looking at class device '/sys/block/ram4':
SYSFS_dev="1:4"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram3' has major:minor 1:3

looking at class device '/sys/block/ram3':
SYSFS_dev="1:3"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram2' has major:minor 1:2

looking at class device '/sys/block/ram2':
SYSFS_dev="1:2"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram1' has major:minor 1:1

looking at class device '/sys/block/ram1':
SYSFS_dev="1:1"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/ram0' has major:minor 1:0

looking at class device '/sys/block/ram0':
SYSFS_dev="1:0"
SYSFS_range="1"
SYSFS_size="16384"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/block/fd0' has major:minor 2:0

looking at class device '/sys/block/fd0':
SYSFS_dev="2:0"
SYSFS_range="1"
SYSFS_size="0"
SYSFS_stat=" 0 0 0 0 0 0 0 0 0 0 0"

device '/sys/class/usb/lp0' has major:minor 180:0

looking at class device '/sys/class/usb/lp0':
SYSFS_dev="180:0"

follow class device's "device" link '/sys/class/usb/lp0':
BUS="usb"
ID="1-1:1.0"
SYSFS_detach_state="0" SYSFS_bInterfaceNumber="00" SYSFS_bAlternateSetting=" 0" SYSFS_bNumEndpoints="02" SYSFS_bInterfaceClass="07" SYSFS_bInterfaceSubClass="01" SYSFS_bInterfaceProtocol="02" SYSFS_iInterface="00"

device '/sys/class/tty/ttyLT0' has major:minor 62:64

looking at class device '/sys/class/tty/ttyLT0':
SYSFS_dev="62:64"

device '/sys/class/tty/tty63' has major:minor 4:63

looking at class device '/sys/class/tty/tty63':
SYSFS_dev="4:63"

device '/sys/class/tty/tty62' has major:minor 4:62

looking at class device '/sys/class/tty/tty62':
SYSFS_dev="4:62"

device '/sys/class/tty/tty61' has major:minor 4:61

looking at class device '/sys/class/tty/tty61':
SYSFS_dev="4:61"

device '/sys/class/tty/tty60' has major:minor 4:60

looking at class device '/sys/class/tty/tty60':
SYSFS_dev="4:60"

device '/sys/class/tty/tty59' has major:minor 4:59

looking at class device '/sys/class/tty/tty59':
SYSFS_dev="4:59"

device '/sys/class/tty/tty58' has major:minor 4:58

looking at class device '/sys/class/tty/tty58':
SYSFS_dev="4:58"

device '/sys/class/tty/tty57' has major:minor 4:57

looking at class device '/sys/class/tty/tty57':
SYSFS_dev="4:57"

device '/sys/class/tty/tty56' has major:minor 4:56

looking at class device '/sys/class/tty/tty56':
SYSFS_dev="4:56"

device '/sys/class/tty/tty55' has major:minor 4:55

looking at class device '/sys/class/tty/tty55':
SYSFS_dev="4:55"

device '/sys/class/tty/tty54' has major:minor 4:54

looking at class device '/sys/class/tty/tty54':
SYSFS_dev="4:54"

device '/sys/class/tty/tty53' has major:minor 4:53

looking at class device '/sys/class/tty/tty53':
SYSFS_dev="4:53"

device '/sys/class/tty/tty52' has major:minor 4:52

looking at class device '/sys/class/tty/tty52':
SYSFS_dev="4:52"

device '/sys/class/tty/tty51' has major:minor 4:51

looking at class device '/sys/class/tty/tty51':
SYSFS_dev="4:51"

device '/sys/class/tty/tty50' has major:minor 4:50

looking at class device '/sys/class/tty/tty50':
SYSFS_dev="4:50"

device '/sys/class/tty/tty49' has major:minor 4:49

looking at class device '/sys/class/tty/tty49':
SYSFS_dev="4:49"

device '/sys/class/tty/tty48' has major:minor 4:48

looking at class device '/sys/class/tty/tty48':
SYSFS_dev="4:48"

device '/sys/class/tty/tty47' has major:minor 4:47

looking at class device '/sys/class/tty/tty47':
SYSFS_dev="4:47"

device '/sys/class/tty/tty46' has major:minor 4:46

looking at class device '/sys/class/tty/tty46':
SYSFS_dev="4:46"

device '/sys/class/tty/tty45' has major:minor 4:45

looking at class device '/sys/class/tty/tty45':
SYSFS_dev="4:45"

device '/sys/class/tty/tty44' has major:minor 4:44

looking at class device '/sys/class/tty/tty44':
SYSFS_dev="4:44"

device '/sys/class/tty/tty43' has major:minor 4:43

looking at class device '/sys/class/tty/tty43':
SYSFS_dev="4:43"

device '/sys/class/tty/tty42' has major:minor 4:42

looking at class device '/sys/class/tty/tty42':
SYSFS_dev="4:42"

device '/sys/class/tty/tty41' has major:minor 4:41

looking at class device '/sys/class/tty/tty41':
SYSFS_dev="4:41"

device '/sys/class/tty/tty40' has major:minor 4:40

looking at class device '/sys/class/tty/tty40':
SYSFS_dev="4:40"

device '/sys/class/tty/tty39' has major:minor 4:39

looking at class device '/sys/class/tty/tty39':
SYSFS_dev="4:39"

device '/sys/class/tty/tty38' has major:minor 4:38

looking at class device '/sys/class/tty/tty38':
SYSFS_dev="4:38"

device '/sys/class/tty/tty37' has major:minor 4:37

looking at class device '/sys/class/tty/tty37':
SYSFS_dev="4:37"

device '/sys/class/tty/tty36' has major:minor 4:36

looking at class device '/sys/class/tty/tty36':
SYSFS_dev="4:36"

device '/sys/class/tty/tty35' has major:minor 4:35

looking at class device '/sys/class/tty/tty35':
SYSFS_dev="4:35"

device '/sys/class/tty/tty34' has major:minor 4:34

looking at class device '/sys/class/tty/tty34':
SYSFS_dev="4:34"

device '/sys/class/tty/tty33' has major:minor 4:33

looking at class device '/sys/class/tty/tty33':
SYSFS_dev="4:33"

device '/sys/class/tty/tty32' has major:minor 4:32

looking at class device '/sys/class/tty/tty32':
SYSFS_dev="4:32"

device '/sys/class/tty/tty31' has major:minor 4:31

looking at class device '/sys/class/tty/tty31':
SYSFS_dev="4:31"

device '/sys/class/tty/tty30' has major:minor 4:30

looking at class device '/sys/class/tty/tty30':
SYSFS_dev="4:30"

device '/sys/class/tty/tty29' has major:minor 4:29

looking at class device '/sys/class/tty/tty29':
SYSFS_dev="4:29"

device '/sys/class/tty/tty28' has major:minor 4:28

looking at class device '/sys/class/tty/tty28':
SYSFS_dev="4:28"

device '/sys/class/tty/tty27' has major:minor 4:27

looking at class device '/sys/class/tty/tty27':
SYSFS_dev="4:27"

device '/sys/class/tty/tty26' has major:minor 4:26

looking at class device '/sys/class/tty/tty26':
SYSFS_dev="4:26"

device '/sys/class/tty/tty25' has major:minor 4:25

looking at class device '/sys/class/tty/tty25':
SYSFS_dev="4:25"

device '/sys/class/tty/tty24' has major:minor 4:24

looking at class device '/sys/class/tty/tty24':
SYSFS_dev="4:24"

device '/sys/class/tty/tty23' has major:minor 4:23

looking at class device '/sys/class/tty/tty23':
SYSFS_dev="4:23"

device '/sys/class/tty/tty22' has major:minor 4:22

looking at class device '/sys/class/tty/tty22':
SYSFS_dev="4:22"

device '/sys/class/tty/tty21' has major:minor 4:21

looking at class device '/sys/class/tty/tty21':
SYSFS_dev="4:21"

device '/sys/class/tty/tty20' has major:minor 4:20

looking at class device '/sys/class/tty/tty20':
SYSFS_dev="4:20"

device '/sys/class/tty/tty19' has major:minor 4:19

looking at class device '/sys/class/tty/tty19':
SYSFS_dev="4:19"

device '/sys/class/tty/tty18' has major:minor 4:18

looking at class device '/sys/class/tty/tty18':
SYSFS_dev="4:18"

device '/sys/class/tty/tty17' has major:minor 4:17

looking at class device '/sys/class/tty/tty17':
SYSFS_dev="4:17"

device '/sys/class/tty/tty16' has major:minor 4:16

looking at class device '/sys/class/tty/tty16':
SYSFS_dev="4:16"

device '/sys/class/tty/tty15' has major:minor 4:15

looking at class device '/sys/class/tty/tty15':
SYSFS_dev="4:15"

device '/sys/class/tty/tty14' has major:minor 4:14

looking at class device '/sys/class/tty/tty14':
SYSFS_dev="4:14"

device '/sys/class/tty/tty13' has major:minor 4:13

looking at class device '/sys/class/tty/tty13':
SYSFS_dev="4:13"

device '/sys/class/tty/tty12' has major:minor 4:12

looking at class device '/sys/class/tty/tty12':
SYSFS_dev="4:12"

device '/sys/class/tty/tty11' has major:minor 4:11

looking at class device '/sys/class/tty/tty11':
SYSFS_dev="4:11"

device '/sys/class/tty/tty10' has major:minor 4:10

looking at class device '/sys/class/tty/tty10':
SYSFS_dev="4:10"

device '/sys/class/tty/tty9' has major:minor 4:9

looking at class device '/sys/class/tty/tty9':
SYSFS_dev="4:9"

device '/sys/class/tty/tty8' has major:minor 4:8

looking at class device '/sys/class/tty/tty8':
SYSFS_dev="4:8"

device '/sys/class/tty/tty7' has major:minor 4:7

looking at class device '/sys/class/tty/tty7':
SYSFS_dev="4:7"

device '/sys/class/tty/tty6' has major:minor 4:6

looking at class device '/sys/class/tty/tty6':
SYSFS_dev="4:6"

device '/sys/class/tty/tty5' has major:minor 4:5

looking at class device '/sys/class/tty/tty5':
SYSFS_dev="4:5"

device '/sys/class/tty/tty4' has major:minor 4:4

looking at class device '/sys/class/tty/tty4':
SYSFS_dev="4:4"

device '/sys/class/tty/tty3' has major:minor 4:3

looking at class device '/sys/class/tty/tty3':
SYSFS_dev="4:3"

device '/sys/class/tty/tty2' has major:minor 4:2

looking at class device '/sys/class/tty/tty2':
SYSFS_dev="4:2"

device '/sys/class/tty/tty1' has major:minor 4:1

looking at class device '/sys/class/tty/tty1':
SYSFS_dev="4:1"

device '/sys/class/tty/tty0' has major:minor 4:0

looking at class device '/sys/class/tty/tty0':
SYSFS_dev="4:0"

device '/sys/class/tty/ptmx' has major:minor 5:2

looking at class device '/sys/class/tty/ptmx':
SYSFS_dev="5:2"

device '/sys/class/tty/console' has major:minor 5:1

looking at class device '/sys/class/tty/console':
SYSFS_dev="5:1"

device '/sys/class/tty/tty' has major:minor 5:0

looking at class device '/sys/class/tty/tty':
SYSFS_dev="5:0"

#3 lore raw
In reply to Bob Barry
Quoted 11 lines · Bob Barry

Kay -

Quoted 2 lines · On Thursday 22 January 2004 you wrote:

You may try the extras/udevinfo/udevinfo program. This is quite new, so I want to know if this can help.

I tried the udevinfo of udev-014. It has no man; no help for --help, -h, or no args; it does not seem to accept wild cards; it does not take arguments from standard input ("find ... | xargs udevinfo" does not work); and "udevinfo -a" does not list "all", as would be useful.

Sorry, udevinfo accepts only one sysfs path for one specific device, not a list what xargs expects.
There are no options besides this one argument.

"./udevinfo /sys/class/usb/lp0" should work, but it seems that it doesn't get the information you looking for.

I don't have any usb printer, what does:

"tree /sys/class/usb"
"tree /sys/devices/pci0000:00/0000:00:02.0/usb1"

print on your machine?

thanks,
Kay

Quoted 5 lines

device '/sys/class/usb/lp0' has major:minor 180:0

looking at class device '/sys/class/usb/lp0':
SYSFS_dev="180:0"

Quoted 11 lines

follow class device's "device" link '/sys/class/usb/lp0':
BUS="usb"
ID="1-1:1.0"
SYSFS_detach_state="0" SYSFS_bInterfaceNumber="00" SYSFS_bAlternateSetting=" 0" SYSFS_bNumEndpoints="02" SYSFS_bInterfaceClass="07" SYSFS_bInterfaceSubClass="01" SYSFS_bInterfaceProtocol="02" SYSFS_iInterface="00"

-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Bob Barry
Quoted 12 lines · Bob Barry

The list is attached. My printer is there, but all that's offered are cryptic numbers:
SYSFS_detach_state="0"
SYSFS_bInterfaceNumber="00"
SYSFS_bAlternateSetting=" 0"
SYSFS_bNumEndpoints="02"
SYSFS_bInterfaceClass="07"
SYSFS_bInterfaceSubClass="01" SYSFS_bInterfaceProtocol="02"
SYSFS_iInterface="00"

Quoted 2 lines

There's no sign of the "product" I'd found, or of "name" or "model". Am I missing something, or misconfigured?

No, you are correct. The "problem" is that usb drivers are bound to usb interfaces (which is the directory you see above). What you really want to compare using udev to is the usb device directory, which is one above this directory. I know about this problem and am working on fixing it in udev.

Sorry about this...

greg k-h

-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#5 lore raw
In reply to Bob Barry

Kay -

Quoted 6 lines · Kay Sievers

I don't have any usb printer, what does:

"tree /sys/class/usb"
"tree /sys/devices/pci0000:00/0000:00:02.0/usb1"

print on your machine?

I don't have tree. I replaced fileutils and others with coreutils; perhaps there was an oversight. Will have to hunt for it.

But I battled on with /proc, /sys, and find. I found where the files are, but udevinfo (and presumably udev itself) rejects that path. It's all in the attached file - please have a look.

Thanks,

Bob

Quoted 1 line

cat /proc/bus/usb/devices

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 3
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.1 ohci_hcd
S:  Product=OHCI Host Controller
S:  SerialNumber=0000:00:03.0
C:* #Ifs= 1 Cfg#= 1 Atr=40 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=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 3
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.1 ohci_hcd
S:  Product=OHCI Host Controller
S:  SerialNumber=0000:00:02.0
C:* #Ifs= 1 Cfg#= 1 Atr=40 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=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=16 #Cfgs=  1
P:  Vendor=043d ProdID=0018 Rev= 1.00
S:  Manufacturer=Lexmark
S:  Product=Lexmark Z52
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  4mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=07(print) Sub=01 Prot=02 Driver=usblp
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=83(I) Atr=02(Bulk) MxPS=  16 Ivl=0ms
Quoted 1 line

find /sys -follow -type f -name "*product" | xargs grep Z52

/sys/class/usb_host/usb2/driver/0000:00:02.0/usb1/1-1/product:Lexmark Z52 /sys/class/usb_host/usb1/driver/0000:00:02.0/usb1/1-1/product:Lexmark Z52 /sys/class/usb_host/usb1/device/usb1/1-1/product:Lexmark Z52 /sys/bus/usb/drivers/usb/1-1/product:Lexmark Z52 /sys/bus/usb/drivers/usb/usb1/1-1/product:Lexmark Z52 /sys/bus/usb/devices/1-1/product:Lexmark Z52 /sys/bus/usb/devices/usb1/1-1/product:Lexmark Z52 /sys/bus/pci/drivers/ohci_hcd/0000:00:02.0/usb1/1-1/product:Lexmark Z52 /sys/bus/pci/devices/0000:00:02.0/usb1/1-1/product:Lexmark Z52 /sys/devices/pci0000:00/0000:00:02.0/usb1/1-1/product:Lexmark Z52

Quoted 3 lines

cd udev/udev-014/extras/udevinfo/

ls /sys/class/usb_host/usb1/device/usb1/1-1

1-1:1.0              bDeviceProtocol  bNumConfigurations  idVendor      speed
bcdDevice            bDeviceSubClass  bNumInterfaces      manufacturer
bConfigurationValue  bmAttributes     detach_state        power
bDeviceClass         bMaxPower        idProduct           product
Quoted 1 line

./udevinfo /sys/class/usb_host/usb1/device/usb1/1-1/product

couldn't get the class device

Quoted 1 line

./udevinfo /sys/class/usb_host/usb1/device/usb1/1-1

couldn't get the "dev" file

Quoted 1 line

./udevinfo /sys/class/usb_host/usb1/device/usb1

couldn't get the "dev" file

Quoted 1 line

./udevinfo /sys/class/usb_host/usb1/device

couldn't get the class device

Quoted 1 line

./udevinfo /sys/class/usb_host/usb1

couldn't get the "dev" file

Quoted 1 line

ls /sys/bus/usb/devices/1-1

1-1:1.0              bDeviceProtocol  bNumConfigurations  idVendor      speed
bcdDevice            bDeviceSubClass  bNumInterfaces      manufacturer
bConfigurationValue  bmAttributes     detach_state        power
bDeviceClass         bMaxPower        idProduct           product
Quoted 1 line

./udevinfo /sys/bus/usb/devices/1-1/product

couldn't get the class device

Quoted 1 line

./udevinfo /sys/bus/usb/devices/1-1

couldn't get the class device

Quoted 1 line

./udevinfo /sys/bus/usb/devices

couldn't get the "dev" file

author
#6 lore raw
In reply to Bob Barry

Greg and Kay -

Thank you both for answering all my questions of this thread in the most comprehensive possible way: udev-015 is installed and working beautifully. My usb printer rule now works, and udevinfo is really useful now.

Kay -

A few small observations about udevinfo:
- when I run udevinfo -h, the "-V" line displayed is:
-V print udev version
it should be
-V print udevinfo version
'cuz that's what it gives when I run udevinfo -V
- I'd suggest a default "all" option for query, to show the entire database entry of the specified node, as is shown by udevinfo -d
- the man page does not mention the -a option
- for newbies, a few example command lines would be useful

Best Regards,

Bob

-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel