[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#393919: partman-crypto: should provide separate short description



Hi Frans,

On Sun, Oct 22, 2006 at 03:50:44PM +0200, Frans Pop wrote:
> On Saturday 21 October 2006 23:17, Max Vozeler wrote:
> > I've seen this problem during installs in german locale (#381968),
> > and this is really something that could be improved. Overall though,
> > I think having at least a chance to associate the backing device
> > with the encrypted device is more important than having the minor
> > glitch of a cut-off string.
> 
> The only problem is that in the screenshot I gave as example, _all_ the 
> really usefull info is cut off. So the actual gain is exactly zero.

Yes, this is also what I experienced in german locale. I meant "at
least a chance to associate" in that works at least for languages
where the translation is not as long as for dutch or german, whereas
replacing it with "crypto" would make it impossible in any case.

> If you want to make sure some mapping info is visible, then we
> should make sure the string is short enough so that it actually
> _will_ be useful.  For example by _only_ listing "sda5_crypt",
> without the "Encrypted volume" bit.

Using just the device name as you described seems very practical and
I think actually solves this problem. The device name is mentioned
in the humandev string of the encrypted device, so it can be asso-
ciated easily. I'm currently testing a patch like the attached which
puts string like "loop0" or "sda5_crypt" in the last column. Will
followup once I've confirmed that it works.

cheers,
Max
Index: update.d/crypto_visuals
===================================================================
--- update.d/crypto_visuals	(Revision 41879)
+++ update.d/crypto_visuals	(Arbeitskopie)
@@ -20,12 +20,29 @@
 [ -f $id/method ] || exit 0
 method=$(cat $id/method)
 
+cryptdev_shortname ()
+{
+	case "$1" in
+	/dev/loop*)
+		n=${1#/dev/loop}
+		n=${n#/}
+		echo "loop${n}"
+		;;
+	/dev/mapper/*)
+		echo "${1#/dev/mapper}"
+		;;
+	*)
+		echo "$1"
+		;;
+	esac
+}
+
 if [ $method = crypto ]; then
 	db_metaget partman/method_short/$method description || RET=''
 	echo ${RET:-crypto} >$id/visual_filesystem
 
 	if [ -f $id/crypt_active ]; then
-		RET=$(humandev $(cat $id/crypt_active))
+		RET=$(cryptdev_shortname $(cat $id/crypt_active))
 	else
 		db_metaget partman-crypto/text/not_active description || RET=''
 	fi

Reply to: