diff -Nru partman-crypto-109/debian/changelog partman-crypto-110/debian/changelog --- partman-crypto-109/debian/changelog 2020-09-20 20:50:54.000000000 +0000 +++ partman-crypto-110/debian/changelog 2020-10-01 21:28:49.000000000 +0000 @@ -1,3 +1,12 @@ +partman-crypto (110) unstable; urgency=medium + + * Add preseed option 'partman-crypto/luksformat_options' to + provide more options for 'cryptsetup luksFormat' (Closes: #) + - d/partman-crypto.templates: add preseed option. + - lib/crypto-base.sh: check for, log, and use it. + + -- Mauricio Faria de Oliveira Thu, 01 Oct 2020 18:28:49 -0300 + partman-crypto (109) unstable; urgency=medium * Team upload diff -Nru partman-crypto-109/debian/partman-crypto.templates partman-crypto-110/debian/partman-crypto.templates --- partman-crypto-109/debian/partman-crypto.templates 2018-08-10 19:23:50.000000000 +0000 +++ partman-crypto-110/debian/partman-crypto.templates 2020-10-01 21:28:49.000000000 +0000 @@ -488,3 +488,8 @@ # :sl3: _Description: No devices selected No devices were selected for encryption. + +Template: partman-crypto/luksformat_options +Type: string +Description: for internal use; can be preseeded. + Provide additional options to the cryptsetup luksFormat command. diff -Nru partman-crypto-109/lib/crypto-base.sh partman-crypto-110/lib/crypto-base.sh --- partman-crypto-109/lib/crypto-base.sh 2018-08-10 19:23:50.000000000 +0000 +++ partman-crypto-110/lib/crypto-base.sh 2020-10-01 21:28:49.000000000 +0000 @@ -205,7 +205,7 @@ } setup_luks () { - local mapping device cipher iv size pass + local mapping device cipher iv size pass luksopts mapping=$1 device=$2 cipher=$3 @@ -219,8 +219,13 @@ # xts modes needs double the key size [ "${iv%xts-*}" = "${iv}" ] || size="$(($size * 2))" + if db_get partman-crypto/luksformat_options; then + luksopts="$RET" + log "Additional options for luksFormat: '$luksopts'" + fi + log-output -t partman-crypto \ - /sbin/cryptsetup -c $cipher-$iv -h $hash -s $size luksFormat $device $pass + /sbin/cryptsetup -c $cipher-$iv -h $hash -s $size $luksopts luksFormat $device $pass if [ $? -ne 0 ]; then log "luksFormat failed" return 2