1 |
commit: cb18b96260b1940f67c4f1e3a99136215c0684ee |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 17 16:21:10 2021 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 17 16:23:37 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb18b962 |
7 |
|
8 |
sys-fs/cryptsetup: fix link error with USE=static |
9 |
|
10 |
Closes: https://bugs.gentoo.org/813441 |
11 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
12 |
|
13 |
...tup-2.4.1.ebuild => cryptsetup-2.4.1-r1.ebuild} | 6 +++- |
14 |
.../files/cryptsetup-2.4.1-external-tokens.patch | 34 ++++++++++++++++++++++ |
15 |
2 files changed, 39 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/sys-fs/cryptsetup/cryptsetup-2.4.1.ebuild b/sys-fs/cryptsetup/cryptsetup-2.4.1-r1.ebuild |
18 |
similarity index 95% |
19 |
rename from sys-fs/cryptsetup/cryptsetup-2.4.1.ebuild |
20 |
rename to sys-fs/cryptsetup/cryptsetup-2.4.1-r1.ebuild |
21 |
index 09141d7320f..214b5c462e3 100644 |
22 |
--- a/sys-fs/cryptsetup/cryptsetup-2.4.1.ebuild |
23 |
+++ b/sys-fs/cryptsetup/cryptsetup-2.4.1-r1.ebuild |
24 |
@@ -46,7 +46,10 @@ BDEPEND=" |
25 |
|
26 |
S="${WORKDIR}/${P/_/-}" |
27 |
|
28 |
-PATCHES=( "${FILESDIR}"/${PN}-2.0.4-fix-static-pwquality-build.patch ) |
29 |
+PATCHES=( |
30 |
+ "${FILESDIR}"/cryptsetup-2.0.4-fix-static-pwquality-build.patch |
31 |
+ "${FILESDIR}"/cryptsetup-2.4.1-external-tokens.patch |
32 |
+) |
33 |
|
34 |
pkg_setup() { |
35 |
local CONFIG_CHECK="~DM_CRYPT ~CRYPTO ~CRYPTO_CBC ~CRYPTO_SHA256" |
36 |
@@ -82,6 +85,7 @@ src_configure() { |
37 |
$(use_enable nls) |
38 |
$(use_enable pwquality) |
39 |
$(use_enable reencrypt cryptsetup-reencrypt) |
40 |
+ $(use_enable !static external-tokens) |
41 |
$(use_enable static static-cryptsetup) |
42 |
$(use_enable static-libs static) |
43 |
$(use_enable udev) |
44 |
|
45 |
diff --git a/sys-fs/cryptsetup/files/cryptsetup-2.4.1-external-tokens.patch b/sys-fs/cryptsetup/files/cryptsetup-2.4.1-external-tokens.patch |
46 |
new file mode 100644 |
47 |
index 00000000000..1777a02652c |
48 |
--- /dev/null |
49 |
+++ b/sys-fs/cryptsetup/files/cryptsetup-2.4.1-external-tokens.patch |
50 |
@@ -0,0 +1,34 @@ |
51 |
+From a1b577c085cc9ef6b95c4556ec8815070828ee6c Mon Sep 17 00:00:00 2001 |
52 |
+From: Hector Martin <marcan@××××××.st> |
53 |
+Date: Fri, 17 Sep 2021 05:44:18 +0000 |
54 |
+Subject: [PATCH] Do not attempt to unload external tokens if |
55 |
+ USE_EXTERNAL_TOKENS is disabled. |
56 |
+ |
57 |
+This allows building a static binary as long as --disable-external-tokens is used |
58 |
+--- |
59 |
+ lib/luks2/luks2_token.c | 2 ++ |
60 |
+ 1 file changed, 2 insertions(+) |
61 |
+ |
62 |
+diff --git a/lib/luks2/luks2_token.c b/lib/luks2/luks2_token.c |
63 |
+index d34cebf5..88d84418 100644 |
64 |
+--- a/lib/luks2/luks2_token.c |
65 |
++++ b/lib/luks2/luks2_token.c |
66 |
+@@ -245,6 +245,7 @@ int crypt_token_register(const crypt_token_handler *handler) |
67 |
+ |
68 |
+ void crypt_token_unload_external_all(struct crypt_device *cd) |
69 |
+ { |
70 |
++#if USE_EXTERNAL_TOKENS |
71 |
+ int i; |
72 |
+ |
73 |
+ for (i = LUKS2_TOKENS_MAX - 1; i >= 0; i--) { |
74 |
+@@ -258,6 +259,7 @@ void crypt_token_unload_external_all(struct crypt_device *cd) |
75 |
+ if (dlclose(CONST_CAST(void *)token_handlers[i].u.v2.dlhandle)) |
76 |
+ log_dbg(cd, "%s", dlerror()); |
77 |
+ } |
78 |
++#endif |
79 |
+ } |
80 |
+ |
81 |
+ static const void |
82 |
+-- |
83 |
+GitLab |
84 |
+ |