From: Jérôme P. <ng...@gm...> - 2011-05-24 10:02:31
|
On 05/24/11 05:00, Mike Blumenkrantz wrote: > > root@comet:/tmp/eeze/src/bin# ./eeze_udev_test > > For my first trick, I will find all of your keyboards and return their > > syspaths. Found > > keyboard: /sys/devices/platform/i8042/serio0/input/input72/event0 > > > > Next, I will find all of your mice and print the corresponding manufacturer. > > > > Now let's try something a little more difficult. Mountable filesystems! > > Found > > device: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-7/1-7:1.0/host2/target2:0:0/2:0:0:0/block/sdb/sdb1 > > You probably know it better as /dev/sdb1 It's formatted as ext3! > > Found > > device: /sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1 > > You probably know it better as /dev/sda1 It's formatted as ext2, and gets > > mounted at /boot! Found > > device: /sys/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0 > > You probably know it better as /dev/sr0 It's formatted as iso9660! > > Found device: /sys/devices/virtual/block/dm-1 > > You probably know it better as /dev/dm-1 > > It's formatted as ext4! > > Found device: /sys/devices/virtual/block/dm-2 > > You probably know it better as /dev/dm-2 > > It's formatted as ext4, and gets mounted at /lfs! > > > > Network devices! > > Found device: /sys/devices/pci0000:00/0000:00:1c.1/0000:0c:00.0/net/wlan0 > > You probably know it better as wlan0 > > Found > > device: /sys/devices/pci0000:00/0000:00:1e.0/0000:03:00.0/ssb0:0/net/eth0 You > > probably know it better as eth0 Found device: /sys/devices/virtual/net/lo > > You probably know it better as lo > > > > Internal drives, anyone? With serial numbers? > > /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-7/1-7:1.0/host2/target2:0:0/2:0:0:0/block/sdb: > > SAMSUNG_HM500JI_1F90179626FF-0:0 /sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda: > > ST910021AS_5MH0A42E > > > > Got any removables? I'm gonna find em! > > > > And now for something more complicated. Plug or unplug your keyboard or > > mouse for me. Sneaky sneaky! > > But /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1 is not a keyboard or a > > mouse!! Sneaky sneaky! > > But /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0 is not a keyboard > > or a mouse!! Sneaky sneaky! > > But /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0/0003:04F3:0210.00A7 > > is not a keyboard or a mouse!! Sneaky sneaky! > > But /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0/0003:04F3:0210.00A7/hidraw/hidraw0 > > is not a keyboard or a mouse!! Sneaky sneaky! > > But /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0/input/input179 is > > not a keyboard or a mouse!! Sneaky sneaky! > > But /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/usb_device/usbdev2.2 is not > > a keyboard or a mouse!! You plugged in /dev/input/event12! All tests > > completed, exiting successfully! > > > > > you have no removable media devices? I had plug an external USB hard drive which was detected here: device: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-7/1-7:1.0/host2/target2:0:0/2:0:0:0/block/sdb/sdb1 You probably know it better as /dev/sdb1 It's formatted as ext3! and there: Internal drives, anyone? With serial numbers? /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-7/1-7:1.0/host2/target2:0:0/2:0:0:0/block/sdb: SAMSUNG_HM500JI_1F90179626FF-0:0 /sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda: ST910021AS_5MH0A42E /dev/sdb is the external one, on USB, /dev/sda the internal one. The output doesn't seem right and I understand your questioni now. On the other hand, there was a CD in /dev/sr0, as shown here: device: /sys/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0 You probably know it better as /dev/sr0 It's formatted as iso9660! I plugged an USB mouse at the end of the test, as asked. -- Jérôme Pinot http://ngc891.blogdns.net/ |