[Pkg-cryptsetup-devel] Bug#488271: Bug#488271: Bug#488271: cryptsetup: use a loop to wait for the root device

David Härdeman david at hardeman.nu
Tue Jul 1 18:11:37 UTC 2008


On Tue, Jul 01, 2008 at 05:46:15PM +0200, Reinhard Tartler wrote:
>David Härdeman <david at hardeman.nu> writes:
>
>> On Fri, Jun 27, 2008 at 02:31:50PM +0100, James Westby wrote:
>>>  https://launchpad.net/bugs/164044
>>>
>>>a user said that he was unable to boot with the root device
>>>being a slow USB device, as the udevsettle call was only
>>>sufficient if the kernel was currently processing an event
>>>which would cause the device to appear. If the event is so slow
>>>that the udevsettle call is made prior to it's arrival
>>>the boot will fail.
>>>
>>>The attached patch is used in Ubuntu to implement a sleeping
>>>loop waiting for the device to appear, as is done for a
>>>normal root device. Please consider applying the patch.
>>
>> initramfs-tools already has a rootdelay parameter which is executed
>> before the cryptsetup initramfs script. What is the advantage of
>> duplicating that functionality?
>
>the rootdelay parameter makes the initramfs loop until the root device
>appears. It does not help the cryptsetup hook in any way.

Well, unless my memory serves me wrong, it does....with a rootdelay=5, 
initramfs-tools will sleep 5 secs extra before cryptsetup gets a chance 
of executing which might be enough for the USB device to show up.

>If the control
>flow reaches the point the patch adds the loop and the device holding
>the crypted volume it will silently fail and pass control to the
>initramfs, which itself fails after 5 minutes (by default). This usually
>happens with slow devices like usb sticks, according to bug reports in
>launchpad.
>
>I agree that it would be nice if we could re-use the functionality from
>initramfs-tools. However it is not written in a reusable way.
>
>Do you see a better way solving the problem? 

Yes, teach initramfs-tools to take a path as an argument to rootdelay 
and make it wait until that path appears.

-- 
David Härdeman





More information about the Pkg-cryptsetup-devel mailing list