File: crypto_visuals

package info (click to toggle)
partman-crypto 57
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,664 kB
  • sloc: sh: 1,956; ansic: 172; makefile: 33
file content (56 lines) | stat: -rwxr-xr-x 987 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh

# Shows "crypto" in the method column for partitions with method "crypto" and
# the humandev name of the crypt disk as mountpoint, so the user can see which
# loop/dm device is which after they've been setup.

. /lib/partman/lib/base.sh

dev=$1
num=$2
id=$3
size=$4
type=$5
fs=$6
path=$7
name=$8

cd $dev

[ -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=$(cryptdev_shortname $(cat $id/crypt_active))
		RET="($RET)"
	else
		db_metaget partman-crypto/text/not_active description || RET=''
	fi

	echo ${RET:-not active} >$id/visual_mountpoint

	# open_dialog CHANGE_FILE_SYSTEM $id linux-swap
	# close_dialog
fi