Re: Wait for console to become available, v3.2

From: Jamie Lokier
Date: Sun Apr 26 2009 - 19:12:45 EST


Kay Sievers wrote:
> > _If_ the system doesn't wait for all block devices present at boot to
> > be enumerated before the boot script, then when the script looks in
> > that directory for a specific UUID, it would be good to wait until
> > "has everything present at boot been enumerated?" says yes.
>
> That's what distros do with initramfs today.

I don't see how that's possible. Haven't we been discussing how the
USB driver does not have any support (yet) for saying when it's found
every device present at boot time, and that it can probably be added?

I have a boot script which does this:

1. *If* USB disk plugged in, mount it on /mnt/usb, do some stuff.
2. If not, do something else.

If I'm not mistaken, the only way to do that right now is pick an
arbitrary time, wait, and proceed with 2 if you didn't see the disk.

The desired USB console behaviour is very similar. Use it if it's
plugged in at boot, use something else otherwise, and no arbitrary
delays.

Did I miss something?
> > Since this is all about making boot faster, it would be quite nice not
> > to wait for all block devices before starting the boot script, or at
> > least the initramfs module-loading script :-)
>
> You wait in initramfs until the device show up. Usually dynamic udev
> rules created from the root= string of the kernel commandline create a
> rule which matches on the UUID, and creates a /dev/root symlink when
> the device shows up. As soon as this link shows up, init mounts it
> and goes ahead.

That's fine when you're waiting for a device to appear that you know
will appear.

The USB console excitement, and my mention of USB disks and such, is
how to decide when the device _isn't_ going to appear, without an
arbitrary timeout.

-- Jamie
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/