File: do_option

package info (click to toggle)
partman-crypto 136
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,276 kB
  • sloc: sh: 1,874; ansic: 174; makefile: 29
file content (23 lines) | stat: -rwxr-xr-x 550 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

# This script handles selecting whether to enable opal nesting with dm-crypt

. /usr/lib/partman/lib/crypto-base.sh

dev=$2
id=$3
part=$dev/$id

[ -f $part/method ] || exit 0
[ -f $part/crypto_type ] || exit 0
[ -f $part/cipher ] || exit 0

method=$(cat $part/method)
type=$(cat $part/crypto_type)
cipher=$(cat $part/cipher)
disk=$(cat $dev/device)

if [ $method = crypto ] && [ $type = dm-crypt ] && /usr/sbin/cryptsetup --help | grep -q hw-opal && blockdev-opal-supported $disk; then
	crypto_dooption $part $type $cipher nested_opal
fi