Bug#604814: [pkg-cryptsetup-devel] Bug#604814: upgrade-reports: Upgrade lenny to squeeze mostly successful

2010-11-24 Thread Jonas Meurer
hey,

On 24/11/2010 Julien Cristau wrote:
 On Wed, Nov 24, 2010 at 14:53:59 +0100, David Kuehling wrote:
 
  Some warnings were printed during upgrade:
  
***
  update-initramfs: Generating /boot/initrd.img-2.6.26-2-686
  cryptsetup: WARNING: target sda2_crypt has a random key, skipped
  /tmp/mkinitramfs_vkMxi2/scripts/local-top/cryptroot: line 11: [: too many 
  arguments
***
  
  No problems so far, my crypto-root is booting without problems.
  
  1  #!/bin/sh
  2  
  3  #
  4  # Standard initramfs preamble
  5  #
  6  prereqs()
  7  {
  8  # Make sure that cryptroot is run last in local-top
  9  for req in $(dirname $0)/*; do
 10  script=${req##*/}
 11  if [ $script != cryptroot ]; then
 12  echo $script
 13  fi
 14  done
 15  }
 16  
 17  case $1 in
 18  prereqs)
 19  prereqs
 20  exit 0
 
 Weird.  Maybe the cryptsetup or initramfs-tools maintainer will have an
 idea.

for some reason, $script seems to contain a space.

David, please apply attached patch to
/usr/share/initramfs-tools/scripts/local-top/cryptroot and see, whether
that fixes the bug for you. you can try this by invoking
'update-initramfs -u' after applying the patch.

greetings,
 jonas
--- /usr/share/initramfs-tools/scripts/local-top/cryptroot.orig
+++ /usr/share/initramfs-tools/scripts/local-top/cryptroot
@@ -8,8 +8,8 @@
 	# Make sure that cryptroot is run last in local-top
 	for req in $(dirname $0)/*; do
 		script=${req##*/}
-		if [ $script != cryptroot ]; then
-			echo $script
+		if [ $script != cryptroot ]; then
+			echo $script
 		fi
 	done
 }
@@ -90,9 +90,9 @@
 			;;
 		source=*)
 			cryptsource=${x#source=}
-			if [ ${cryptsource#UUID=} != $cryptsource ]; then
+			if [ ${cryptsource#UUID=} != $cryptsource ]; then
 cryptsource=/dev/disk/by-uuid/${cryptsource#UUID=}
-			elif [ ${cryptsource#LABEL=} != $cryptsource ]; then
+			elif [ ${cryptsource#LABEL=} != $cryptsource ]; then
 cryptsource=/dev/disk/by-label/${cryptsource#LABEL=}
 			fi
 			export CRYPTTAB_SOURCE=$cryptsource
@@ -198,7 +198,7 @@
 	modprobe -q dm_crypt
 
 	# Make sure the cryptsource device is available
-	if [ ! -e $cryptsource ]; then
+	if [ ! -e $cryptsource ]; then
 		activate_vg
 		activate_evms
 	fi
@@ -226,10 +226,10 @@
 		while [ ! -e $cryptsource ]; do
 			/bin/sleep 0.1
 			slumber=$(( ${slumber} - 1 ))
-			[ ${slumber} -gt 0 ] || break
+			[ ${slumber} -gt 0 ] || break
 		done
 
-		if [ ${slumber} -gt 0 ]; then
+		if [ ${slumber} -gt 0 ]; then
 			log_end_msg 0
 		else
 			log_end_msg 1 || true
@@ -258,14 +258,14 @@
 
 	# Try to get a satisfactory password $crypttries times
 	count=0
-	while [ $crypttries -le 0 ] || [ $count -lt $crypttries ]; do
+	while [ $crypttries -le 0 ] || [ $count -lt $crypttries ]; do
 		count=$(( $count + 1 ))
 
-		if [ $count -gt 1 ]; then
+		if [ $count -gt 1 ]; then
 			/bin/sleep 3
 		fi
 
-		if [ $crypttries -gt 0 ]  [ $count -gt $crypttries ]; then
+		if [ $crypttries -gt 0 ]  [ $count -gt $crypttries ]; then
 			message cryptsetup: maximum number of tries exceeded for $crypttarget
 			return 1
 		fi


signature.asc
Description: Digital signature


Bug#604814: [pkg-cryptsetup-devel] Bug#604814: upgrade-reports: Upgrade lenny to squeeze mostly successful

2010-11-24 Thread David Kuehling
Hi,

first let me thank you all for the quick and helpful responses.

 Jonas Meurer jo...@freesources.org writes:

 Weird.  Maybe the cryptsetup or initramfs-tools maintainer will have
 an idea.

 for some reason, $script seems to contain a space.

 David, please apply attached patch to
 /usr/share/initramfs-tools/scripts/local-top/cryptroot and see,
 whether that fixes the bug for you. you can try this by invoking
 'update-initramfs -u' after applying the patch.

$ patch --dry-run  cryptroot-script.diff

patching file cryptroot
Hunk #1 FAILED at 8.
Hunk #2 FAILED at 90.
Hunk #3 FAILED at 198.
Hunk #4 FAILED at 226.
Hunk #5 FAILED at 258.
5 out of 5 hunks FAILED -- saving rejects to file cryptroot.rej

Ok, Squeeze seems to be a qickly moving target:

$ apt-get update  apt-get upgrade
$ patch  cryptroot-script.diff
patching file cryptroot

$update-initramfs -u
update-initramfs: Generating /boot/initrd.img-2.6.32-5-686
cryptsetup: WARNING: target sda2_crypt has a random key, skipped

Seems to fix the problem.  Didn't yet try to reboot my system, though.

cheers,

David
-- 
GnuPG public key: http://user.cs.tu-berlin.de/~dvdkhlng/dk.gpg
Fingerprint: B17A DC95 D293 657B 4205  D016 7DEF 5323 C174 7D40


pgptqGOw56D7f.pgp
Description: PGP signature