[or-cvs] r15875: Adapted scripts for the new command line interface of TrueCr (in incognito/trunk/root_overlay: etc/modules.autoload.d usr/sbin)

anonym at seul.org anonym at seul.org
Sun Jul 13 17:19:48 UTC 2008


Author: anonym
Date: 2008-07-13 13:19:47 -0400 (Sun, 13 Jul 2008)
New Revision: 15875

Modified:
   incognito/trunk/root_overlay/etc/modules.autoload.d/kernel-2.6
   incognito/trunk/root_overlay/usr/sbin/create-homevol
   incognito/trunk/root_overlay/usr/sbin/enable-persistent-vol
   incognito/trunk/root_overlay/usr/sbin/mount-homevol
Log:
Adapted scripts for the new command line interface of TrueCrypt 6.0a.


Modified: incognito/trunk/root_overlay/etc/modules.autoload.d/kernel-2.6
===================================================================
--- incognito/trunk/root_overlay/etc/modules.autoload.d/kernel-2.6	2008-07-13 17:13:34 UTC (rev 15874)
+++ incognito/trunk/root_overlay/etc/modules.autoload.d/kernel-2.6	2008-07-13 17:19:47 UTC (rev 15875)
@@ -14,3 +14,4 @@
 ip_tables
 x_tables
 
+fuse

Modified: incognito/trunk/root_overlay/usr/sbin/create-homevol
===================================================================
--- incognito/trunk/root_overlay/usr/sbin/create-homevol	2008-07-13 17:13:34 UTC (rev 15874)
+++ incognito/trunk/root_overlay/usr/sbin/create-homevol	2008-07-13 17:19:47 UTC (rev 15875)
@@ -48,6 +48,7 @@
 LABEL_REPEAT="Re-enter your password:"
 MESSAGE_CREATING_TRUECRYPT_NORMAL="Creating TrueCrypt normal volume..."
 MESSAGE_CREATING_TRUECRYPT_HIDDEN="Creating TrueCrypt hidden volume..."
+CREATING_UNENCRYPTED_HOMEVOL="Creating unencrypted home volume. This can take a few minutes depending on the chosen size."
 
 DIM="0 0"
 
@@ -74,9 +75,11 @@
 	exit 1
 fi
 
-# Ask for size
+# Size of the outer volume in megabytes
 declare -i SIZE
 SIZE=0
+
+# Ask for the size of the outer volume in megabytes
 while [[ ${SIZE} -lt ${MIN_SIZE} || ${SIZE} -gt ${MAX_SIZE} ]]; do
 	# If there's much space (150+ MB, chosen quite arbitrarily) save 50 MB for updates, otherwise recommend using all available space for the volume
 	if [[ ${MAX_SIZE} -gt 150 ]]; then
@@ -124,27 +127,28 @@
 	clear
 
 	# Unmap all
-	truecrypt -d >/dev/null 2>&1
+	truecrypt -t -d >/dev/null 2>&1
 
 	# Create the TrueCrypt volume
 	echo
 	echo "*** ${MESSAGE_CREATING_TRUECRYPT_NORMAL}"
 	echo
-	truecrypt --hash RIPEMD-160 --encryption AES --filesystem ext3 --password "${NORMAL_PW}" --size ${SIZE}M --type normal --keyfile "" -c "${HOMEPART_TC}"
+	truecrypt -t --hash=RIPEMD-160 --encryption=AES --filesystem=none --password="${NORMAL_PW}" --size="$(( ${SIZE}*1024*1024 ))" --volume-type=normal --keyfiles="" -c "${HOMEPART_TC}"
 	[[ -e "${HOMEPART_TC}" ]] || exit 1
-	truecrypt -N 1 --password "${NORMAL_PW}" "${HOMEPART_TC}"
+	truecrypt -t --protect-hidden=no --filesystem=none --keyfiles="" --password="${NORMAL_PW}" "${HOMEPART_TC}"
 	if [[ $? -ne 0 ]]; then
 		rm "${HOMEPART_TC}"
 		exit 1
 	fi
-	mkfs.ext3 -q -F -T small /dev/mapper/truecrypt1
-	mkdir /tmp/home
-	mount -t ext3 /dev/mapper/truecrypt1 /tmp/home
+	TC_DEV=$( truecrypt -t -l | cut -d ' ' -f 3 )
+	mkfs.ext3 -q -F -T small ${TC_DEV}
+	mkdir -p /tmp/home
+	mount -t ext3 ${TC_DEV} /tmp/home
 	rm -rf /tmp/home/*
 	cp -a /home/* /tmp/home
 	umount /tmp/home
 	rmdir /tmp/home
-	truecrypt -d /dev/mapper/truecrypt1
+	truecrypt -t -d "${HOMEPART_TC}"
 
 	# Set up hidden volume
 	if [[ ${USE_HIDDEN_VOLUME} == "yes" ]]; then
@@ -157,7 +161,10 @@
 			exit 0
 		fi
 
+		# Size of the hidden volume in megabytes
+		declare -i HIDDEN_SIZE
 		HIDDEN_SIZE=-1
+
 		while [[ ${HIDDEN_SIZE} -gt ${MAX_HIDDEN_SIZE} || ${HIDDEN_SIZE} -lt ${MIN_HIDDEN_SIZE} ]]; do
 			# recommend max
 			HIDDEN_SIZE=${MAX_HIDDEN_SIZE}
@@ -189,20 +196,21 @@
 		echo
 		echo "*** ${MESSAGE_CREATING_TRUECRYPT_HIDDEN}"
 		echo
-		truecrypt --hash RIPEMD-160 --encryption AES --filesystem ext3 --password "${HIDDEN_PW}" --size ${HIDDEN_SIZE}M --type hidden --keyfile "" -c "${HOMEPART_TC}"
-		truecrypt -N 1 --password "${HIDDEN_PW}" "${HOMEPART_TC}"
+		truecrypt -t --hash=RIPEMD-160 --encryption=AES --filesystem=none --password="${HIDDEN_PW}" --size="$(( ${HIDDEN_SIZE}*1024*1024 ))" --volume-type=hidden --keyfiles="" -c "${HOMEPART_TC}"
+		truecrypt -t --protect-hidden=no --filesystem=none --keyfiles="" --password="${HIDDEN_PW}" "${HOMEPART_TC}"
 		if [[ $? -ne 0 ]]; then
 			rm "${HOMEPART_TC}"
 			exit 1
 		fi
-		mkfs.ext3 -q -F -T small /dev/mapper/truecrypt1
-		mkdir /tmp/home
-		mount -t ext3 /dev/mapper/truecrypt1 /tmp/home
+		TC_DEV=$( truecrypt -t -l | cut -d ' ' -f 3 )
+		mkfs.ext3 -q -F -T small ${TC_DEV}
+		mkdir -p /tmp/home
+		mount -t ext3 ${TC_DEV} /tmp/home
 		rm -rf /tmp/home/*
 		cp -a /home/* /tmp/home
 		umount /tmp/home
 		rmdir /tmp/home
-		truecrypt -d /dev/mapper/truecrypt1
+		truecrypt -t -d "${HOMEPART_TC}"
 	fi
 
 	clear
@@ -211,11 +219,11 @@
 else
 	clear
 	# Create ext3 home volume
-	echo "Creating unencrypted home volume. This can take a few minutes depending on the chosen size."
+	echo ${CREATING_UNENCRYPTED_HOMEVOL}
 	dd if=/dev/zero "of=${HOMEPART_EXT3}" bs=1M count=${SIZE} >/dev/null 2>&1
 	if [[ $? -eq 0 && -w "${HOMEPART_EXT3}" ]]; then
 		mkfs.ext3 -q -F -T small "${HOMEPART_EXT3}"
-		mkdir /tmp/home
+		mkdir -p /tmp/home
 		mount -o loop -t ext3 "${HOMEPART_EXT3}" /tmp/home
 		rm -rf /tmp/home/*
 		cp -a /home/* /tmp/home

Modified: incognito/trunk/root_overlay/usr/sbin/enable-persistent-vol
===================================================================
--- incognito/trunk/root_overlay/usr/sbin/enable-persistent-vol	2008-07-13 17:13:34 UTC (rev 15874)
+++ incognito/trunk/root_overlay/usr/sbin/enable-persistent-vol	2008-07-13 17:19:47 UTC (rev 15875)
@@ -19,5 +19,6 @@
 	exit 1
 else
 	${DIALOG} --msgbox "The option to create and use persistent home volumes is enabled. You should be prompted next time you start __INCOGNITO__." 0 ${DEFAULT_WIDTH}
+	rm -f /home/__INCOGNITO_USER_/Desktop/enable-persistent-vol.desktop
 	exit 0
 fi


Property changes on: incognito/trunk/root_overlay/usr/sbin/enable-persistent-vol
___________________________________________________________________
Name: svn:executable
   + *

Modified: incognito/trunk/root_overlay/usr/sbin/mount-homevol
===================================================================
--- incognito/trunk/root_overlay/usr/sbin/mount-homevol	2008-07-13 17:13:34 UTC (rev 15874)
+++ incognito/trunk/root_overlay/usr/sbin/mount-homevol	2008-07-13 17:19:47 UTC (rev 15875)
@@ -13,7 +13,7 @@
 To get standard access to a volume, enter the appropriate password in the '${LABEL_PASSWORD}' field and leave the ${LABEL_OPT_PWD} blank. For example, if you do NOT have a hidden volume, you should always simply enter your single password in the '${LABEL_PASSWORD}' field. If you have a hidden volume and want to access it you instead enter the hidden volume password in the '${LABEL_PASSWORD}' field.
 
 If you have a hidden volume but want to access the normal volume safely, enter the normal volume password in the '${LABEL_PASSWORD}' field and the hidden volume password in the '${LABEL_OPT_PWD}' field. If you enter the normal volume password without entering the hidden volume password in this way you risk corrupting the hidden volume and make it inaccessible."
-QUESTION_ERROR="An error occurred opening the volume, see above, hit ENTER/RETURN to try again"
+QUESTION_ERROR="An error occurred opening the volume, see above. Hit ENTER/RETURN to try again"
 TITLE="Open Persistent Home Volume"
 
 # command line arguments
@@ -55,9 +55,9 @@
 
 		# if we got both passwords, try mounting the normal volume safely, otherwise mount normally
 		if [[ -z ${TRUECRYPT_PW2} ]]; then
-			truecrypt --keyfile "" --password "${TRUECRYPT_PW1}" "${HOMEPART}" /home
+			truecrypt -t --non-interactive --protect-hidden=no --filesystem=ext3 --keyfiles="" --password="${TRUECRYPT_PW1}" "${HOMEPART}" /home
 		else
-			truecrypt --protect-hidden --keyfile "" --keyfile "" --password "${TRUECRYPT_PW1}" --password "${TRUECRYPT_PW2}" "${HOMEPART}" /home
+			truecrypt -t --non-interactive --protect-hidden=yes --filesystem=ext3 --keyfiles="" --protection-keyfiles="" --password="${TRUECRYPT_PW1}" --protection-password="${TRUECRYPT_PW2}" "${HOMEPART}" /home
 		fi
 		
 		if [[ $? -eq 0 ]]; then



More information about the tor-commits mailing list