Re: Waiting for the current usb devices to be scanned, how?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 ;)

Thanks!

/mjt

to

> 
> thanks,
> 
> greg k-h

--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux