On Mon, 22 Nov 2010, Michael Tokarev wrote: > 21.11.2010 20:25, Greg KH пиÑ?еÑ?: > > On Sun, Nov 21, 2010 at 01:42:06PM +0300, Michael Tokarev wrote: > >> Hello. > >> > >> Is there a way to trigger or wait for all the _currently_ > >> connected USB devices to be probed? > >> > >> The most common case of this, I think, is when a system > >> is booting from a USB storage device. Initramfs loads > >> the USB controller driver, which triggers USB device > >> scan and discovers and initializes usb-storage and other > >> devices. But the discover is done after quite some pause, > >> definitely after modprobe of the USB controller module > >> returns. > [] > > As Alan pointed out, no, there isn't. > > > > What type of problem are you trying to resolve here? > > The "problem" is described above. I've seen various live images, > installers, other things like that use different ways to determine > where the drive with their components is. > > Currently udev provides a way to check for particular filesystem > label or UUID, sometimes it is necessary to check for particular > file (content), or maybe some other more exotic way. This all > can be done using udev too, but this has two questions: first, > not all the world is udev (for one, it become just too "twisted" > to embed it into even regular initramfs), and second, this approach > is just various combinations of dirty tricks to reduce asyncronous > processing to syncronous: userspace is just waiting for the "needed" > device to appear, checking for it and sleeping in a loop. > > To me, more appropriate way is to wait till the scan of _current_ > devices is complete, and perform all the findings in one go - be > it filesystem label/uuid or anything else, and if that fails, > tell user "there's no device of interest found", or better yet, > "error reading device $foo which may be a bootable device", instead > of waiting for much more than needed and say cryptic "root device > not appeared in $N seconds". > > That's not a problem per se, just a cosmetic thing, and in most > cases invisible anyway. But every time I implement this the next > time I'm crying for the "right" way ;) See this message from last year and the ones following it: http://marc.info/?l=linux-usb&m=124425570902124&w=2 Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html