[Bug 164044] Re: Gutsy: cryptsetup fails for encrypted rootfs on slow devices (USB)

Bug Watch Updater 164044 at bugs.launchpad.net
Thu Aug 11 03:12:15 UTC 2011


** Changed in: cryptsetup (Debian)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to cryptsetup in Ubuntu.
https://bugs.launchpad.net/bugs/164044

Title:
  Gutsy: cryptsetup fails for encrypted rootfs on slow devices (USB)

Status in “cryptsetup” package in Ubuntu:
  Fix Released
Status in “cryptsetup” package in Debian:
  Fix Released

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/initramfs-tools/scripts/local-top/cryptroot
  by integrating into it the same kind of "waiting loop" that already
  exists for a non-encrypted rootfs, in /usr/share/initramfs-
  tools/scripts/local .

  This patch to /usr/share/initramfs-tools/scripts/local-top/cryptroot
  solves the issue and perfectly does the trick. Please consider
  integrating this fix.

  
  --- /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=${ROOTDELAY}
  +		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="/sbin/cryptsetup luksOpen $cryptsource $crypttarget"

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/164044/+subscriptions




More information about the foundations-bugs mailing list