Skip to contentSkip to conversation

cryptsetup: Add support for building without SSH tokens

PATCH Peter Kjellerstedt 1 participant 2 messages Jul 5, 2022 – Jul 21, 2022 2 messages not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 5 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Peter Kjellerstedt
Sent: den 8 juni 2022 20:27
To: [email protected]
Subject: [oe] [meta-oe][PATCH] cryptsetup: Add support for building without SSH tokens

This is now on master. Please backport it to Kirkstone.

//Peter

Quoted 54 lines

Cryptsetup SSH tokens is the only feature that has a dependency on libssh. Add a packageconfig to control this dependency.

Change-Id Iac4f91e099ad2e3a79aab183734108f8bfbff57f
---
 .../recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb    | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb +10 -2
index 435b55477..652fd6661 100644
@@ -14,7 +14,6 @@ DEPENDS = " \
     libdevmapper \
     popt \
     util-linux-libuuid \
-    libssh \
 "
 
 DEPENDS:append:libc-musl = " argp-standalone"
@@ -39,6 +38,7 @@ PACKAGECONFIG ??= " \
     blkid \
     luks-adjust-xts-keysize \
     openssl \
+    ssh-token \
 "
 PACKAGECONFIG:append:class-target = " \
     udev \
@@ -69,7 +69,7 @@ PACKAGECONFIG[nss] = "--with-crypto_backend=nss,,nss"
 PACKAGECONFIG[kernel] = "--with-crypto_backend=kernel"
 PACKAGECONFIG[nettle] = "--with-crypto_backend=nettle,,nettle"
 PACKAGECONFIG[luks2] = "--with-default-luks-format=LUKS2,--with-default-luks-format=LUKS1"
-
+PACKAGECONFIG[ssh-token] = "--enable-ssh-token,--disable-ssh-token,libssh"
 
 EXTRA_OECONF = "--enable-static"
 # Building without largefile is not supported by upstream
@@ -90,6 +90,14 @@ EXTRA_OECONF += "--with-luks2-pbkdf=${LUKS2_PBKDF} \
     --with-luks2-parallel-threads=${LUKS2_PARALLEL_THREADS} \
     --with-luks2-iter-time=${LUKS2_ITERTIME}"
 
+do_install:append() {
+    # The /usr/lib/cryptsetup directory is always created, even when ssh-token
+    # is disabled. In that case it is empty and causes a packaging error. Since
+    # there is no reason to distribute the empty directory, the easiest solution
+    # is to remove it if it is empty.
+    rmdir -p --ignore-fail-on-non-empty ${D}${libdir}/${BPN}
+}
+
 FILES:${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/cryptsetup.conf', '', d)}"
 
 RDEPENDS:${PN} = " \
#3 lore raw
In reply to a message not in the archive

*ping*

//Peter

Quoted 83 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Peter Kjellerstedt
Sent: den 5 juli 2022 21:35
To: Armin Kuster <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH] cryptsetup: Add support for building without SSH tokens

Quoted 2 lines

-----Original Message-----
From: [email protected] <openembedded-

[email protected]> On Behalf Of Peter Kjellerstedt

Quoted 3 lines

Sent: den 8 juni 2022 20:27
To: [email protected]
Subject: [oe] [meta-oe][PATCH] cryptsetup: Add support for building

without SSH tokens

This is now on master. Please backport it to Kirkstone.

//Peter

Review

Quoted 11 lines

Cryptsetup SSH tokens is the only feature that has a dependency on libssh. Add a packageconfig to control this dependency.

Change-Id Iac4f91e099ad2e3a79aab183734108f8bfbff57f
---
 .../recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb    | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb

Quoted 20 lines

index 435b55477..652fd6661 100644

meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb +1 -1
@@ -14,7 +14,6 @@ DEPENDS = " \
     libdevmapper \
     popt \
     util-linux-libuuid \
-    libssh \
 "
 
 DEPENDS:append:libc-musl = " argp-standalone"
@@ -39,6 +38,7 @@ PACKAGECONFIG ??= " \
     blkid \
     luks-adjust-xts-keysize \
     openssl \
+    ssh-token \
 "
 PACKAGECONFIG:append:class-target = " \
     udev \

meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb PACKAGECONFIG[nss] = "--with-crypto_backend=nss,,nss" · line 71

Quoted 3 lines
meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb +0 -0
@@ -69,7 +69,7 @@ PACKAGECONFIG[nss] = "--with-crypto_backend=nss,,nss"
 PACKAGECONFIG[kernel] = "--with-crypto_backend=kernel"
 PACKAGECONFIG[nettle] = "--with-crypto_backend=nettle,,nettle"
 PACKAGECONFIG[luks2] = "--with-default-luks-format=LUKS2,--with-

default-luks-format=LUKS1"

meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb PACKAGECONFIG[nss] = "--with-crypto_backend=nss,,nss" · line 72

Quoted 2 lines
meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb +1 -1
-
+PACKAGECONFIG[ssh-token] = "--enable-ssh-token,--disable-ssh-

token,libssh"

meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb EXTRA_OECONF += "--with-luks2-pbkdf=${LUKS2_PBKDF} \ · line 94

Quoted 9 lines
meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb +2 -0
 EXTRA_OECONF = "--enable-static"
 # Building without largefile is not supported by upstream
@@ -90,6 +90,14 @@ EXTRA_OECONF += "--with-luks2-pbkdf=${LUKS2_PBKDF} \
     --with-luks2-parallel-threads=${LUKS2_PARALLEL_THREADS} \
     --with-luks2-iter-time=${LUKS2_ITERTIME}"
 
+do_install:append() {
+    # The /usr/lib/cryptsetup directory is always created, even when

ssh-token

meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb EXTRA_OECONF += "--with-luks2-pbkdf=${LUKS2_PBKDF} \ · line 95

Quoted 1 line
meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb +1 -0
+    # is disabled. In that case it is empty and causes a packaging

error. Since

meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb EXTRA_OECONF += "--with-luks2-pbkdf=${LUKS2_PBKDF} \ · line 96

Quoted 1 line
meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb +1 -0
+    # there is no reason to distribute the empty directory, the easiest

solution

meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb EXTRA_OECONF += "--with-luks2-pbkdf=${LUKS2_PBKDF} \ · line 101

Quoted 5 lines
meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb +4 -0
+    # is to remove it if it is empty.
+    rmdir -p --ignore-fail-on-non-empty ${D}${libdir}/${BPN}
+}
+
 FILES:${PN} +=

"${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpf iles.d/cryptsetup.conf', '', d)}"

Quoted 2 lines
meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.4.3.bb +0 -0
 RDEPENDS:${PN} = " \