Re: Need to know when usb drive probing finished

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

 



On Fri, 24 Feb 2012, 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.

Why?  What difference does it make whether a drive is present at bootup 
or is not connected until later?

>  Any USB drive, usually when Puppy is booting off that drive,
> will be present.

That's simply not true.  A USB drive can be plugged in at any time; it 
doesn't have to be present at bootup.

Now, the boot drive _does_ have to be present at bootup.  But that 
doesn't matter as far as you're concerned, because once the kernel and 
initramfs have been loaded, the boot drive isn't needed any more.

Similarly, the drive containing the root fs had better be present at
bootup.  But as Greg mentioned earlier, this means you only have to
wait until that one drive has been detected.  You don't have to wait
for _all_ the attached drives.

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

Won't udev also handle things that were plugged in before boot?  
Therefore all you need to do is wait long enough for the switch_root to 
work.

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


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

  Powered by Linux