Author: B.Prathibha <prathibhab@cdac.in>
Description: Fixes the issue in booting LVM encrypted partition.

--- live-installer.postinst.orig	2013-09-03 18:43:41.665317265 +0530
+++ live-installer.postinst	2013-09-02 19:30:56.000000000 +0530
@@ -40,6 +40,12 @@
 		mv /target/etc/fstab /target/etc/fstab.live-installer
 	fi
 
+        # Backup pre-existing /etc/crypttab as it will be overwritten by the
+	# copy of the live system
+	if [ -e /target/etc/crypttab ] && [ ! -e /target/etc/crypttab.live-installer ]; then
+		mv /target/etc/crypttab /target/etc/crypttab.live-installer
+	fi
+
 	for place in $PLACES; do
 		[ ! -e $place ] && continue
 
@@ -88,6 +94,11 @@
 		mv /target/etc/fstab.live-installer /target/etc/fstab
 	fi
 
+        # Restore the crypttab file created by d-i
+	if [ -e /target/etc/crypttab.live-installer ]; then
+		mv /target/etc/crypttab.live-installer /target/etc/crypttab
+	fi
+
 	if [ ${PLACE_FOUND} -eq 0 ]; then
 		error "Could not find any live images"
 		exit 1
