Re: Need to know when usb drive probing finished

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

 



On Fri, Feb 24, 2012 at 10:15:48AM +0800, Barry Kauler wrote:
> On 2/24/12, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> > You haven't said what you need.
> >
> > For example, suppose you're running an older kernel, and your init
> > script finds a bunch of USB devices and then exits.  At that moment you
> > plug in a USB flash drive.  Clearly the script will not have been able
> > to find it.  How do you deal with that?
> >
> > There's still more to this.  The "scan complete" message you mentioned
> > earlier gets printed when the SCSI layer has been told to scan the
> > device.  But the SCSI layer can perform its scanning asynchronously,
> > and in particular, SCSI disks are always registered asynchronously.
> > Therefore the "scan complete" message doesn't mean that the attached
> > device has been fully scanned.
> >
> 
> Yes I have said what I need. The 'init' script finds drives present at
> bootup. Any USB drive, usually when Puppy is booting off that drive,
> will be present.

The problem is, you really never know when "all drives present at
bootup" are there by virtue of how USB works.  So while your script
might be working now, on some hardware I know of (buggy, I'll give you
that), it will not.

> As I said, udev is used after switch_root, and anything plugged in
> after bootup is handled.

What's wrong with devtmpfs for all of this?  Just wait until your root
disk shows up, all you need to do is sit and spin in your initramfs, no
fancy logic like this is needed at all.

That's what most embedded systems do, and their footprint is even
smaller than yours.

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