Merge ~mfo/partman-crypto:lp1898129 into ~ubuntu-installer/partman-crypto:master

Proposed by Mauricio Faria de Oliveira
Status: Merged
Approved by: Łukasz Zemczak
Approved revision: 7fb523ecbd07c637c7e2488e7e5cf4640dc94af3
Merged at revision: 7fb523ecbd07c637c7e2488e7e5cf4640dc94af3
Proposed branch: ~mfo/partman-crypto:lp1898129
Merge into: ~ubuntu-installer/partman-crypto:master
Diff against target: 56 lines (+20/-2)
3 files modified
debian/changelog (+9/-0)
debian/partman-crypto.templates (+5/-0)
lib/crypto-base.sh (+6/-2)
Reviewer Review Type Date Requested Status
Łukasz Zemczak Approve
Review via email: mp+391766@code.launchpad.net

Description of the change

This is the respective patch for the stand-alone repository
(partman-crypto) of the ubiquity change from LP#1898129, as
documented in ubiquity/d-i/source/README.

To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Generally +1, seems to look fine. I see one small stylistic thing as per inline comment, but we can deal with it after merging.

review: Approve
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Actually, nvm my previous comment, this is good as is!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index b05458d..645b125 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,12 @@
6+partman-crypto (101ubuntu5) hirsute; urgency=medium
7+
8+ * Add preseed option 'partman-crypto/luksformat_options' to
9+ provide more options for 'cryptsetup luksFormat' (LP: #1898129)
10+ - d/partman-crypto.templates: add preseed option.
11+ - lib/crypto-base.sh: check for, log, and use it.
12+
13+ -- Mauricio Faria de Oliveira <mfo@canonical.com> Thu, 05 Nov 2020 12:24:33 -0300
14+
15 partman-crypto (101ubuntu4) eoan; urgency=medium
16
17 * Drop a big block in finish.d that iterates partman, and then does
18diff --git a/debian/partman-crypto.templates b/debian/partman-crypto.templates
19index ee78111..3541934 100644
20--- a/debian/partman-crypto.templates
21+++ b/debian/partman-crypto.templates
22@@ -509,3 +509,8 @@ _Description: Passphrase for ${DEVICE}:
23 Please enter the passphrase for the encrypted volume ${DEVICE}.
24 .
25 If you don't enter anything, the volume will not be activated.
26+
27+Template: partman-crypto/luksformat_options
28+Type: string
29+Description: for internal use; can be preseeded.
30+ Provide additional options to the cryptsetup luksFormat command.
31diff --git a/lib/crypto-base.sh b/lib/crypto-base.sh
32index 7616ad2..d3ed948 100644
33--- a/lib/crypto-base.sh
34+++ b/lib/crypto-base.sh
35@@ -205,7 +205,7 @@ setup_dmcrypt () {
36 }
37
38 setup_luks () {
39- local mapping device cipher iv size pass
40+ local mapping device cipher iv size pass luksopts
41 mapping=$1
42 device=$2
43 cipher=$3
44@@ -234,7 +234,11 @@ setup_luks () {
45 fi
46
47 if [ $zkey_available -eq 0 ]; then
48- log-output -t partman-crypto /sbin/cryptsetup -c $cipher-$iv -h $hash -s $size luksFormat $device $pass
49+ if db_get partman-crypto/luksformat_options; then
50+ luksopts="$RET"
51+ log "Additional options for luksFormat: '$luksopts'"
52+ fi
53+ log-output -t partman-crypto /sbin/cryptsetup -c $cipher-$iv -h $hash -s $size $luksopts luksFormat $device $pass
54 if [ $? -ne 0 ]; then
55 log "luksFormat failed"
56 return 2

Subscribers

People subscribed via source and target branches