Re: Why this flash drive not detected in devd?
On Sat, 11 Jul 2009 03:36:09 -0500 Sagara Wijetunga wrote: Again, maybe you should check out sysutils/hal. I prefer to handle mounting through an automounter even without KDE running. It's not a KDE only instance. BTW, this port is maintained by a FreeBSD gnome@ team. Hal is widely used by xorg. So you may take a look at it. -- WBR, Boris Samorodov (bsam) Research Engineer, http://www.ipt.ru Telephone Internet SP FreeBSD Committer, http://www.FreeBSD.org The Power To Serve ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Why this flash drive not detected in devd?
Mel Flynn writes: On Saturday 11 July 2009 00:36:09 Sagara Wijetunga wrote: I prefer to handle mounting through an automounter even without KDE running. I think most users want to handle the disk based on the content not on the device that has the disk. Ideally I would want my desktop to: 1) automount below a root that I can configure 2) when a disk is labeled, use the lowercase version of the label as mountpoint, resolving conflicts using 2-digit serial suffixes. 3) when a disk is not labeled, mount it temporarily using a unique name (f.e. using uuid(3)), provide me with an option to label it a) if yes, label and remount, asking me to abort if this means disk content gets lost b) if no, show me where it's mounted. Of course, YMMV, but I really don't care if my SD card with my photos is in the built-in SD card holder, in the camera itself or on an USB SD card reader I plugged in. I want my photos to be under ~/photos each time. -- Mel Hi Mel Thanks for your feedback. Our Tomahawk Desktop (http://www.tomahawkcomputers.com/) is targeted for end users, from years two (2) onwards :) My son is now two and quarter. He plays music, just drag and drop music files (flac) to Xine, play videos, draw stars, circles, cars, parrots, etc. on Inkscape, see his photos, etc. on Tomahawk Desktop. Here is what we have done five years ago based on Linux and how people used Tomahawk Desktop 1.x series. You plug in your Thumb drive and go to /media/thumdrive and access your thumb drive. Close your app (eg. Konqueror), system automatically unmount the thumb drive for you. An average Tomahawk Desktop 1.x user is not even aware that there is such thing as mount and unmount of devices. Its just plug and play for them. You plug in your camera and go to /media/camera and access your camera. Just drag and drop your photos or videos to your computer or transfer to another thumb drive. Now we have switched to FreeBSD from Linux. We would still like to offer this feature as a minimum for Tomahawk Desktop users. We do not want to tell our users it is not supported on FreeBSD, therefore, you are crippled now. Knowing that a device has been created with the device name da0 or da0s1 is insufficient for us to determine whether that device is a thumb drive, camera, audio player, etc. We need another event to devd once the device (eg. da0, da1, etc) is known with minimum vendor and product ids. For this purpose, we would like to modify the USB sub system. We need help in this regard. I have posted another post to freebsd-stable list titled “FreeBSD 7.2 USB stack info needed”. Please reply if you do have time. Best regards Sagara ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Why this flash drive not detected in devd?
On Saturday 11 July 2009 00:36:09 Sagara Wijetunga wrote: I prefer to handle mounting through an automounter even without KDE running. I think most users want to handle the disk based on the content not on the device that has the disk. Ideally I would want my desktop to: 1) automount below a root that I can configure 2) when a disk is labeled, use the lowercase version of the label as mountpoint, resolving conflicts using 2-digit serial suffixes. 3) when a disk is not labeled, mount it temporarily using a unique name (f.e. using uuid(3)), provide me with an option to label it a) if yes, label and remount, asking me to abort if this means disk content gets lost b) if no, show me where it's mounted. Of course, YMMV, but I really don't care if my SD card with my photos is in the built-in SD card holder, in the camera itself or on an USB SD card reader I plugged in. I want my photos to be under ~/photos each time. -- Mel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Why this flash drive not detected in devd?
Roland Smith writes: On Thu, Jul 09, 2009 at 08:41:28PM -0500, Sagara Wijetunga wrote: Roland Smith writes: On Thu, Jul 09, 2009 at 11:22:16PM +0800, Sagara Wijetunga wrote: Hi FreeBSD community This is FreeBSD 7.2 on i386. sysctl -a | grep dev.umass dev.umass.1.%desc: Imation Flash Drive, class 0/0, rev 2.00/1.03, addr 3 dev.umass.1.%driver: umass dev.umass.1.%location: port=6 interface=0 dev.umass.1.%pnpinfo: vendor=0x0718 product=0x0081 devclass=0x00 devsubclass=0x00 release=0x0103 sernum=14925B00 intclass=0x08 intsubclass=0x06 dev.umass.1.%parent: uhub4 Following added to /etc/devd.conf: 1. Imation Flash Drive, class 0/0, rev 2.00/1.03, addr 3 attach 200 { match vendor 0x0718; match product 0x0081; match serial 14925B00; action touch /tmp/Imation-Flash-Drive-detected; }; Could I know why the flash drive is not detected on attach? The USB subsystem isn't currently equipped to notify devd (technically, the devctl_notify function isn't used in the USB stack). So the only notification you'll get is when devfs creates a device. Since there is no predictable link between a USB device and a disk device, info from the USB stack would be less then usefull. You can check this by reading from /dev/devctrl (when devd is not running, since this device can only be opened by one program at a time) just after you plugged in the device. For my usb thumbdrive I get: cat /dev/devctl !system=DEVFS subsystem=CDEV type=CREATE cdev=pass2 !system=DEVFS subsystem=CDEV type=CREATE cdev=da0 !system=DEVFS subsystem=CDEV type=CREATE cdev=da0s1 !system=DEVFS subsystem=CDEV type=CREATE cdev=msdosfs/RFS1 While sysctl gives: dev.umass.0.%desc: vendor 0x3538 USB Mass Storage Device, class 0/0, rev 2.00/1.00, addr 2 dev.umass.0.%driver: umass dev.umass.0.%location: port=4 interface=0 dev.umass.0.%pnpinfo: vendor=0x3538 product=0x0042 devclass=0x00 devsubclass=0x00 release=0x0100 sernum=0004E1 intclass=0x08 intsubclass=0x06 dev.umass.0.%parent: uhub4 So for now, you'll have to match on the creation of da* devices, or labels if you use those. Roland, thanks for the reply. Here is my side info on FreeBSD 7.2: cat /dev/devctl ? at port=6 vendor=0x0718 product=0x0081 devclass=0x00 devsubclass=0x00 release=0x0103 sernum=14925B00 on uhub4 The ? means Unknown device detected. See devctl(4). This is _not_ noticed be devd, I think +umass1 vendor=0x0718 product=0x0081 devclass=0x00 devsubclass=0x00 release=0x0103 sernum=14925B00 intclass=0x08 intsubclass=0x06 at port=6 interface=0 vendor=0x0718 product=0x0081 devclass=0x00 devsubclass=0x00 release=0x0103 sernum=14925B00 intclass=0x08 intsubclass=0x06 on uhub4 Note that while + denotes a device creation event, it is for umass1, not for a disk device. !system=DEVFS subsystem=CDEV type=CREATE cdev=pass4 !system=DEVFS subsystem=CDEV type=CREATE cdev=da4 !system=DEVFS subsystem=CDEV type=CREATE cdev=da4s1 !system=DEVFS subsystem=CDEV type=CREATE cdev=msdosfs/ I have few questions: 1. Above shows info we need available under '?' and '+' lines. What we need is vendor, product and sernum. Can these be accessed in addition to cdev? Not currently. The hooks into the USB subsystem are missing. But even if they were there, that info is not very usefull in itself. You also need to know the disk device number that the USB drive gets! If there were hooks in the USB system, you would get _multiple_ events in devd: 1) USB device plugged in. (serial no etc...) 2) pass device created by devfs 3) da devices created by devfs 4) msdodfs/ devices created by devfs. So you would need to remember the first event until the device creation happens. Devd itself has no facilities for that. Sure, you can cobble something together with tempoeary files etc., but that would be fragile. And as I've said before, there is no one-on-one link between a USB device that gets plugged in and the disk device that is assigned to it! 2. Is this issue been fixed in FreeBSD 8.0? I don't know. The USB stack was rewritten for 8.0. Ask on the -current or -hackers list. 3. Can you or someone think of a patch against FreeBSD 7.2 to provide vendor, product and sernum in addition to cdev? It's very big help someone could extend to us to release Tomahawk Desktop As I explained above, this would not accomplish what you want. Again, maybe you should check out sysutils/hal. I prefer to handle mounting through an automounter even without KDE running. Could I know which program print following lines to the /dev/devctl: !system=DEVFS subsystem=CDEV type=CREATE cdev=pass4 !system=DEVFS subsystem=CDEV type=CREATE cdev=da4 !system=DEVFS subsystem=CDEV type=CREATE cdev=da4s1 !system=DEVFS subsystem=CDEV type=CREATE cdev=msdosfs/ Is there a way in FreeBSD 7.2 to
Re: Why this flash drive not detected in devd?
On Sat, Jul 11, 2009 at 03:36:09AM -0500, Sagara Wijetunga wrote: Could I know which program print following lines to the /dev/devctl: !system=DEVFS subsystem=CDEV type=CREATE cdev=pass4 !system=DEVFS subsystem=CDEV type=CREATE cdev=da4 !system=DEVFS subsystem=CDEV type=CREATE cdev=da4s1 !system=DEVFS subsystem=CDEV type=CREATE cdev=msdosfs/ These lines are printed by the kernel. Is there a way in FreeBSD 7.2 to know what devices (eg. da0, da1, etc) are attached to a given USB driver (umass0, umass1, etc)? One way I can think of is using 'camcontrol inquiry' and 'camcontrol tags' commands on the daX devices. Obviously the information you seek is available in the kernel. But I don't know how to get at it. Roland -- R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) pgpUXpvqO7xyY.pgp Description: PGP signature
Re: Why this flash drive not detected in devd?
On Thu, Jul 09, 2009 at 08:41:28PM -0500, Sagara Wijetunga wrote: Roland Smith writes: On Thu, Jul 09, 2009 at 11:22:16PM +0800, Sagara Wijetunga wrote: Hi FreeBSD community This is FreeBSD 7.2 on i386. sysctl -a | grep dev.umass dev.umass.1.%desc: Imation Flash Drive, class 0/0, rev 2.00/1.03, addr 3 dev.umass.1.%driver: umass dev.umass.1.%location: port=6 interface=0 dev.umass.1.%pnpinfo: vendor=0x0718 product=0x0081 devclass=0x00 devsubclass=0x00 release=0x0103 sernum=14925B00 intclass=0x08 intsubclass=0x06 dev.umass.1.%parent: uhub4 Following added to /etc/devd.conf: 1. Imation Flash Drive, class 0/0, rev 2.00/1.03, addr 3 attach 200 { match vendor 0x0718; match product 0x0081; match serial 14925B00; action touch /tmp/Imation-Flash-Drive-detected; }; Could I know why the flash drive is not detected on attach? The USB subsystem isn't currently equipped to notify devd (technically, the devctl_notify function isn't used in the USB stack). So the only notification you'll get is when devfs creates a device. Since there is no predictable link between a USB device and a disk device, info from the USB stack would be less then usefull. You can check this by reading from /dev/devctrl (when devd is not running, since this device can only be opened by one program at a time) just after you plugged in the device. For my usb thumbdrive I get: cat /dev/devctl !system=DEVFS subsystem=CDEV type=CREATE cdev=pass2 !system=DEVFS subsystem=CDEV type=CREATE cdev=da0 !system=DEVFS subsystem=CDEV type=CREATE cdev=da0s1 !system=DEVFS subsystem=CDEV type=CREATE cdev=msdosfs/RFS1 While sysctl gives: dev.umass.0.%desc: vendor 0x3538 USB Mass Storage Device, class 0/0, rev 2.00/1.00, addr 2 dev.umass.0.%driver: umass dev.umass.0.%location: port=4 interface=0 dev.umass.0.%pnpinfo: vendor=0x3538 product=0x0042 devclass=0x00 devsubclass=0x00 release=0x0100 sernum=0004E1 intclass=0x08 intsubclass=0x06 dev.umass.0.%parent: uhub4 So for now, you'll have to match on the creation of da* devices, or labels if you use those. Roland, thanks for the reply. Here is my side info on FreeBSD 7.2: cat /dev/devctl ? at port=6 vendor=0x0718 product=0x0081 devclass=0x00 devsubclass=0x00 release=0x0103 sernum=14925B00 on uhub4 The ? means Unknown device detected. See devctl(4). This is _not_ noticed be devd, I think +umass1 vendor=0x0718 product=0x0081 devclass=0x00 devsubclass=0x00 release=0x0103 sernum=14925B00 intclass=0x08 intsubclass=0x06 at port=6 interface=0 vendor=0x0718 product=0x0081 devclass=0x00 devsubclass=0x00 release=0x0103 sernum=14925B00 intclass=0x08 intsubclass=0x06 on uhub4 Note that while + denotes a device creation event, it is for umass1, not for a disk device. !system=DEVFS subsystem=CDEV type=CREATE cdev=pass4 !system=DEVFS subsystem=CDEV type=CREATE cdev=da4 !system=DEVFS subsystem=CDEV type=CREATE cdev=da4s1 !system=DEVFS subsystem=CDEV type=CREATE cdev=msdosfs/ I have few questions: 1. Above shows info we need available under '?' and '+' lines. What we need is vendor, product and sernum. Can these be accessed in addition to cdev? Not currently. The hooks into the USB subsystem are missing. But even if they were there, that info is not very usefull in itself. You also need to know the disk device number that the USB drive gets! If there were hooks in the USB system, you would get _multiple_ events in devd: 1) USB device plugged in. (serial no etc...) 2) pass device created by devfs 3) da devices created by devfs 4) msdodfs/ devices created by devfs. So you would need to remember the first event until the device creation happens. Devd itself has no facilities for that. Sure, you can cobble something together with tempoeary files etc., but that would be fragile. And as I've said before, there is no one-on-one link between a USB device that gets plugged in and the disk device that is assigned to it! 2. Is this issue been fixed in FreeBSD 8.0? I don't know. The USB stack was rewritten for 8.0. Ask on the -current or -hackers list. 3. Can you or someone think of a patch against FreeBSD 7.2 to provide vendor, product and sernum in addition to cdev? It's very big help someone could extend to us to release Tomahawk Desktop As I explained above, this would not accomplish what you want. Again, maybe you should check out sysutils/hal. Roland -- R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) pgp4KKxENKdn6.pgp Description: PGP signature
Why this flash drive not detected in devd?
Hi FreeBSD community This is FreeBSD 7.2 on i386. sysctl -a | grep dev.umass dev.umass.1.%desc: Imation Flash Drive, class 0/0, rev 2.00/1.03, addr 3 dev.umass.1.%driver: umass dev.umass.1.%location: port=6 interface=0 dev.umass.1.%pnpinfo: vendor=0x0718 product=0x0081 devclass=0x00 devsubclass=0x00 release=0x0103 sernum=14925B00 intclass=0x08 intsubclass=0x06 dev.umass.1.%parent: uhub4 Following added to /etc/devd.conf: # Imation Flash Drive, class 0/0, rev 2.00/1.03, addr 3 attach 200 { match vendor 0x0718; match product 0x0081; match serial 14925B00; action touch /tmp/Imation-Flash-Drive-detected; }; Could I know why the flash drive is not detected on attach? Kind regards Sagara ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Why this flash drive not detected in devd?
On Thu, Jul 09, 2009 at 11:22:16PM +0800, Sagara Wijetunga wrote: Hi FreeBSD community This is FreeBSD 7.2 on i386. sysctl -a | grep dev.umass dev.umass.1.%desc: Imation Flash Drive, class 0/0, rev 2.00/1.03, addr 3 dev.umass.1.%driver: umass dev.umass.1.%location: port=6 interface=0 dev.umass.1.%pnpinfo: vendor=0x0718 product=0x0081 devclass=0x00 devsubclass=0x00 release=0x0103 sernum=14925B00 intclass=0x08 intsubclass=0x06 dev.umass.1.%parent: uhub4 Following added to /etc/devd.conf: # Imation Flash Drive, class 0/0, rev 2.00/1.03, addr 3 attach 200 { match vendor 0x0718; match product 0x0081; match serial 14925B00; action touch /tmp/Imation-Flash-Drive-detected; }; Could I know why the flash drive is not detected on attach? The USB subsystem isn't currently equipped to notify devd (technically, the devctl_notify function isn't used in the USB stack). So the only notification you'll get is when devfs creates a device. Since there is no predictable link between a USB device and a disk device, info from the USB stack would be less then usefull. You can check this by reading from /dev/devctrl (when devd is not running, since this device can only be opened by one program at a time) just after you plugged in the device. For my usb thumbdrive I get: cat /dev/devctl !system=DEVFS subsystem=CDEV type=CREATE cdev=pass2 !system=DEVFS subsystem=CDEV type=CREATE cdev=da0 !system=DEVFS subsystem=CDEV type=CREATE cdev=da0s1 !system=DEVFS subsystem=CDEV type=CREATE cdev=msdosfs/RFS1 While sysctl gives: dev.umass.0.%desc: vendor 0x3538 USB Mass Storage Device, class 0/0, rev 2.00/1.00, addr 2 dev.umass.0.%driver: umass dev.umass.0.%location: port=4 interface=0 dev.umass.0.%pnpinfo: vendor=0x3538 product=0x0042 devclass=0x00 devsubclass=0x00 release=0x0100 sernum=0004E1 intclass=0x08 intsubclass=0x06 dev.umass.0.%parent: uhub4 So for now, you'll have to match on the creation of da* devices, or labels if you use those. Roland -- R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) pgpKszeapBeuv.pgp Description: PGP signature
Re: Why this flash drive not detected in devd?
Roland Smith writes: On Thu, Jul 09, 2009 at 11:22:16PM +0800, Sagara Wijetunga wrote: Hi FreeBSD community This is FreeBSD 7.2 on i386. sysctl -a | grep dev.umass dev.umass.1.%desc: Imation Flash Drive, class 0/0, rev 2.00/1.03, addr 3 dev.umass.1.%driver: umass dev.umass.1.%location: port=6 interface=0 dev.umass.1.%pnpinfo: vendor=0x0718 product=0x0081 devclass=0x00 devsubclass=0x00 release=0x0103 sernum=14925B00 intclass=0x08 intsubclass=0x06 dev.umass.1.%parent: uhub4 Following added to /etc/devd.conf: # Imation Flash Drive, class 0/0, rev 2.00/1.03, addr 3 attach 200 { match vendor 0x0718; match product 0x0081; match serial 14925B00; action touch /tmp/Imation-Flash-Drive-detected; }; Could I know why the flash drive is not detected on attach? The USB subsystem isn't currently equipped to notify devd (technically, the devctl_notify function isn't used in the USB stack). So the only notification you'll get is when devfs creates a device. Since there is no predictable link between a USB device and a disk device, info from the USB stack would be less then usefull. You can check this by reading from /dev/devctrl (when devd is not running, since this device can only be opened by one program at a time) just after you plugged in the device. For my usb thumbdrive I get: cat /dev/devctl !system=DEVFS subsystem=CDEV type=CREATE cdev=pass2 !system=DEVFS subsystem=CDEV type=CREATE cdev=da0 !system=DEVFS subsystem=CDEV type=CREATE cdev=da0s1 !system=DEVFS subsystem=CDEV type=CREATE cdev=msdosfs/RFS1 While sysctl gives: dev.umass.0.%desc: vendor 0x3538 USB Mass Storage Device, class 0/0, rev 2.00/1.00, addr 2 dev.umass.0.%driver: umass dev.umass.0.%location: port=4 interface=0 dev.umass.0.%pnpinfo: vendor=0x3538 product=0x0042 devclass=0x00 devsubclass=0x00 release=0x0100 sernum=0004E1 intclass=0x08 intsubclass=0x06 dev.umass.0.%parent: uhub4 So for now, you'll have to match on the creation of da* devices, or labels if you use those. Roland, thanks for the reply. Here is my side info on FreeBSD 7.2: cat /dev/devctl ? at port=6 vendor=0x0718 product=0x0081 devclass=0x00 devsubclass=0x00 release=0x0103 sernum=14925B00 on uhub4 +umass1 vendor=0x0718 product=0x0081 devclass=0x00 devsubclass=0x00 release=0x0103 sernum=14925B00 intclass=0x08 intsubclass=0x06 at port=6 interface=0 vendor=0x0718 product=0x0081 devclass=0x00 devsubclass=0x00 release=0x0103 sernum=14925B00 intclass=0x08 intsubclass=0x06 on uhub4 !system=DEVFS subsystem=CDEV type=CREATE cdev=pass4 !system=DEVFS subsystem=CDEV type=CREATE cdev=da4 !system=DEVFS subsystem=CDEV type=CREATE cdev=da4s1 !system=DEVFS subsystem=CDEV type=CREATE cdev=msdosfs/ I have few questions: 1. Above shows info we need available under '?' and '+' lines. What we need is vendor, product and sernum. Can these be accessed in addition to cdev? 2. Is this issue been fixed in FreeBSD 8.0? 3. Can you or someone think of a patch against FreeBSD 7.2 to provide vendor, product and sernum in addition to cdev? It's very big help someone could extend to us to release Tomahawk Desktop without further delay. Best regards Sagara ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org