From: Alexander Clouter <alex@digriz.org.uk>
To: linux-kernel@vger.kernel.org
Subject: Re: fastboot/async and initramfs: How am I supposed to know when?devices are finished initializing?
Date: Sun, 29 Mar 2009 21:03:34 +0100 [thread overview]
Message-ID: <mp05a6-inv.ln1@woodchuck.wormnet.eu> (raw)
In-Reply-To: 49CFB553.1020800@archlinux.org
Thomas Bächler <thomas@archlinux.org> wrote:
>
> Kay Sievers schrieb:
>> In initramfs, you have to wait until the device shows up, not for a
>> random module to initialize, or a bus to be scanned -- that can never
>> work correctly, it's pure luck, that your logic was always slower than
>> the kernel.
>>
>> You need a block device -- so you should just wait for the block
>> device, instead of making assumptions about initialization of drivers
>> or buses. :)
>
> I am planning to do that but there is one problem: Usually, the user
> specifies a root device, or a device that I want to open with
> cryptsetup, or anything similar and I can wait until it shows up.
>
> For lvm however, the user does not specify a specific block device that
> I can wait for, instead lvm scans all available block devices. Now, how
> do I know that the block device that contains my physical volume is
> already there? Maybe I have several hard drives, and several volume
> groups, so should I now call vgchange -ay again and again until the
> right volume group shows up?
>
If the user is specifying the boot device, could you not 'teach' them to
LABEL the boot device and live off something slightly more fancy (but
akin to) the following:
----
while true
do
mount LABEL=root /whatever
if [ $? -eq 0 ]; then
break
fi
# do some md and lvm magic dance here
sleep 1
done
----
Your initramfs could do extra steps everytime the loop...erm...loops.
Now of course the downside is LABELing mounted devices, XFS for example,
is not an easy thing to do... :-/
Cheers
--
Alexander Clouter
.sigmonster says: Am I ranting? I hope so. My ranting gets raves.
next prev parent reply other threads:[~2009-03-29 20:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-29 16:02 fastboot/async and initramfs: How am I supposed to know when devices are finished initializing? Thomas Bächler
2009-03-29 16:11 ` Arjan van de Ven
2009-03-29 16:39 ` Thomas Bächler
2009-03-29 17:36 ` Kay Sievers
2009-03-29 17:52 ` Thomas Bächler
2009-03-29 18:06 ` Kay Sievers
2009-03-30 18:23 ` Dan Williams
2009-03-30 18:42 ` Kay Sievers
2009-03-30 19:08 ` Dan Williams
2009-03-29 20:03 ` Alexander Clouter [this message]
2009-03-30 20:20 ` fastboot/async and initramfs: How am I supposed to know when?devices " Thomas Bächler
[not found] ` <49CFA2CC.9080506@archlinux.org>
[not found] ` <20090329094220.4e80c267@infradead.org>
2009-03-29 17:23 ` fastboot/async and initramfs: How am I supposed to know when devices " Thomas Bächler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mp05a6-inv.ln1@woodchuck.wormnet.eu \
--to=alex@digriz.org.uk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.