Gutsy: cryptsetup fails for encrypted rootfs on slow devices (USB)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cryptsetup (Debian) |
Fix Released
|
Unknown
|
|||
cryptsetup (Ubuntu) |
Fix Released
|
Low
|
Reinhard Tartler | ||
Bug Description
Binary package hint: cryptsetup
This bug is *not* a duplicate of bug #85460
cryptsetup fails for encrypted rootfs on a device that is slow to come up (i.e. an external USB HD). The "udevsettle" solution proposed in bug #85460 does not help.
I have patched /usr/share/
This patch to /usr/share/
--- /old/cryptroot 2007-10-11 22:39:56.000000000 +0200
+++ cryptroot 2007-11-20 12:21:25.000000000 +0100
@@ -25,6 +25,9 @@
#
# Helper functions
#
+
+. /scripts/functions
+
parse_options()
{
local cryptopts
@@ -158,11 +161,45 @@
/sbin/udevsettle --timeout=30
fi
- if [ ! -e $cryptsource ]; then
- echo "cryptsetup: Source device $cryptsource not found"
- return 1
+ # If the encrypted source device hasn't shown up yet, give it a little while
+ # to deal with removable devices
+ if [ ! -e "$cryptsource" ] || ! /lib/udev/vol_id "$cryptsource" >/dev/null 2>&1; then
+ log_begin_msg "Waiting for encrypted source device..."
+
+ # Default delay is 180s
+ if [ -z "${ROOTDELAY}" ]; then
+ slumber=180
+ else
+ slumber=
+ fi
+ if [ -x /sbin/usplash_write ]; then
+ /sbin/usplash_write "TIMEOUT ${slumber}" || true
+ fi
+
+ slumber=$(( ${slumber} * 10 ))
+ while [ ! -e "$cryptsource" ] || ! /lib/udev/vol_id "$cryptsource" >/dev/null 2>&1; do
+ /bin/sleep 0.1
+ slumber=$(( ${slumber} - 1 ))
+ [ ${slumber} -gt 0 ] || break
+ done
+
+ if [ ${slumber} -gt 0 ]; then
+ log_end_msg 0
+ else
+ log_end_msg 1 || true
+ fi
+ if [ -x /sbin/usplash_write ]; then
+ /sbin/usplash_write "TIMEOUT 15" || true
+ fi
fi
+ # We've given up, but we'll let the user fix matters if they can
+ while [ ! -e "$cryptsource" ]; do
+ echo " Check cryptopts=source= bootarg cat /proc/cmdline"
+ echo " or missing modules, devices: cat /proc/modules ls /dev"
+ panic "ALERT! $cryptsource does not exist. Dropping to a shell!"
+ done
+
# Prepare commands
if /sbin/cryptsetup isLuks $cryptsource > /dev/null 2>&1; then
cryptcreate=
Changed in cryptsetup: | |
status: | Unknown → New |
Changed in cryptsetup (Debian): | |
status: | New → Fix Released |
could you add information about target version of cryptsetup for which this patch will work?