4 . $(dirname $0)/conf.sh
8 keyfile1=`mktemp $base.XXXXXX` || exit 1
9 keyfile2=`mktemp $base.XXXXXX` || exit 1
10 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1
14 dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1
15 dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1
17 geli init -B none -P -K $keyfile1 md${no}
18 geli attach -p -k $keyfile1 md${no}
19 geli setkey -n 1 -P -K $keyfile2 md${no}
21 # Kill attached provider.
29 # Provider should be automatically detached.
30 if [ ! -c /dev/md{$no}.eli ]; then
36 # We cannot use keyfile1 anymore.
37 geli attach -p -k $keyfile1 md${no} 2>/dev/null
44 # We cannot use keyfile2 anymore.
45 geli attach -p -k $keyfile2 md${no} 2>/dev/null
52 geli init -B none -P -K $keyfile1 md${no}
53 geli setkey -n 1 -p -k $keyfile1 -P -K $keyfile2 md${no}
55 # Should be possible to attach with keyfile1.
56 geli attach -p -k $keyfile1 md${no}
64 # Should be possible to attach with keyfile2.
65 geli attach -p -k $keyfile2 md${no}
73 # Kill detached provider.
81 # We cannot use keyfile1 anymore.
82 geli attach -p -k $keyfile1 md${no} 2>/dev/null
89 # We cannot use keyfile2 anymore.
90 geli attach -p -k $keyfile2 md${no} 2>/dev/null
97 rm -f $keyfile1 $keyfile2