7 keyfile1=`mktemp /tmp/$base.XXXXXX` || exit 1
8 keyfile2=`mktemp /tmp/$base.XXXXXX` || exit 1
9 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1
13 dd if=/dev/random of=${keyfile1} bs=512 count=16 >/dev/null 2>&1
14 dd if=/dev/random of=${keyfile2} bs=512 count=16 >/dev/null 2>&1
16 geli init -B none -P -K $keyfile1 md${no}
17 geli attach -p -k $keyfile1 md${no}
18 geli setkey -n 1 -P -K $keyfile2 md${no}
20 # Kill attached provider.
28 # Provider should be automatically detached.
29 if [ ! -c /dev/md{$no}.eli ]; then
35 # We cannot use keyfile1 anymore.
36 geli attach -p -k $keyfile1 md${no} 2>/dev/null
43 # We cannot use keyfile2 anymore.
44 geli attach -p -k $keyfile2 md${no} 2>/dev/null
51 geli init -B none -P -K $keyfile1 md${no}
52 geli setkey -n 1 -p -k $keyfile1 -P -K $keyfile2 md${no}
54 # Should be possible to attach with keyfile1.
55 geli attach -p -k $keyfile1 md${no}
63 # Should be possible to attach with keyfile2.
64 geli attach -p -k $keyfile2 md${no}
72 # Kill detached provider.
80 # We cannot use keyfile1 anymore.
81 geli attach -p -k $keyfile1 md${no} 2>/dev/null
88 # We cannot use keyfile2 anymore.
89 geli attach -p -k $keyfile2 md${no} 2>/dev/null
97 rm -f $keyfile1 $keyfile2