The officially official Devuan Forum!

You are not logged in.

#1 Re: Hardware & System Configuration » Dropbear-initramfs: cryptroot-unlock says "Try again later" forever » 2024-09-27 20:42:15

This is how I fixed it. Seems to be a timing issue.

I edited /usr/share/cryptsetup/initramfs/bin/cryptroot-unlock

Found the block

if [ ! -f "$TABFILE" ] || [ "$TABFILE" -ot "/proc/1" ]; then
    echo "Try again later" >&2
    exit 1
fi

And then changed it to this

MAX_RETRIES=10
RETRY_INTERVAL=3

# Retry mechanism to check if TABFILE is ready
for i in $(seq 1 $MAX_RETRIES); do
    if [ -f "$TABFILE" ] && [ "$TABFILE" -nt "/proc/1" ]; then
        break
    fi
    
    if [ $i -eq $MAX_RETRIES ]; then
        echo "Error: $TABFILE still not ready after $MAX_RETRIES attempts. Exiting." >&2
        exit 1
    fi

    echo "Waiting for cryptroot to be ready... attempt $i/$MAX_RETRIES"
    sleep $RETRY_INTERVAL
done

Don't forget to apply changes

update-initramfs -u -k all

Board footer

Forum Software