On Fri, 23 Nov 2018 at 21:41:42 +0100, Mikhail Morfikov wrote:
> On 23/11/2018 20:37, Guilhem Moulin wrote:
>> Did you also add a loop to wait for the block device holding the LUKS
>> header?  Since the device is discovered asynchronously you need to wait
>> for it in order to eliminate the race.
>
> What exactly should I add?

Something along the lines (you might want to add a timeout too) of

DEVICE=/path/to/block/device
if [ ! -b "$DEVICE" ]; then
    echo "Waiting for device..." >&2
    until [ -b "$DEVICE" ]; do
        sleep 1
    done
fi

mount -t ext4 -o ro "$DEVICE" /boot

-- 
Guilhem.

Attachment: signature.asc
Description: PGP signature

Reply via email to