diff -Nru partman-crypto-101ubuntu4/debian/changelog partman-crypto-101ubuntu4.1/debian/changelog --- partman-crypto-101ubuntu4/debian/changelog 2019-06-21 08:03:35.000000000 -0300 +++ partman-crypto-101ubuntu4.1/debian/changelog 2021-01-07 16:51:37.000000000 -0300 @@ -1,3 +1,12 @@ +partman-crypto (101ubuntu4.1) focal; urgency=medium + + * Add preseed option 'partman-crypto/luksformat_options' to + provide more options for 'cryptsetup luksFormat' (LP: #1898129) + - d/partman-crypto.templates: add preseed option. + - lib/crypto-base.sh: check for, log, and use it. + + -- Mauricio Faria de Oliveira Thu, 07 Jan 2021 16:51:37 -0300 + partman-crypto (101ubuntu4) eoan; urgency=medium * Drop a big block in finish.d that iterates partman, and then does diff -Nru partman-crypto-101ubuntu4/debian/partman-crypto.templates partman-crypto-101ubuntu4.1/debian/partman-crypto.templates --- partman-crypto-101ubuntu4/debian/partman-crypto.templates 2019-02-03 04:01:08.000000000 -0200 +++ partman-crypto-101ubuntu4.1/debian/partman-crypto.templates 2021-01-07 16:51:12.000000000 -0300 @@ -509,3 +509,8 @@ Please enter the passphrase for the encrypted volume ${DEVICE}. . If you don't enter anything, the volume will not be activated. + +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-101ubuntu4/lib/crypto-base.sh partman-crypto-101ubuntu4.1/lib/crypto-base.sh --- partman-crypto-101ubuntu4/lib/crypto-base.sh 2019-03-08 09:44:50.000000000 -0300 +++ partman-crypto-101ubuntu4.1/lib/crypto-base.sh 2021-01-07 16:51:12.000000000 -0300 @@ -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 @@ -234,7 +234,11 @@ fi if [ $zkey_available -eq 0 ]; then - log-output -t partman-crypto /sbin/cryptsetup -c $cipher-$iv -h $hash -s $size luksFormat $device $pass + 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 $luksopts luksFormat $device $pass if [ $? -ne 0 ]; then log "luksFormat failed" return 2