Skip to contentSkip to conversation

cryptsetup: remove hard dependency on libgcrypt

PATCH New Floris Bos 3 participants 7 messages Feb 4, 2015 – Mar 8, 2015

lore
Share & tools
lore

Floris Bos

author
#0 lore raw

PATCH 1/1 cryptsetup: remove hard dependency on libgcrypt

- Add support for the alternative OpenSSL and Linux kernel crypto backends. The latter does require that additional kernel modules (like algif_hash) are present and loaded before invoking cryptsetup, so is used as last choice.

- Removes CRYPTSETUP_AUTORECONF as it is redundant, and reconf does create a dependency on libgcrypt for the m4 macros used.

---
 package/cryptsetup/Config.in     |  1 -
 package/cryptsetup/cryptsetup.mk | 17 +++++++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)
package/cryptsetup/Config.in +0 -1
index 353420f..7f672f9 100644
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_CRYPTSETUP
 	bool "cryptsetup"
-	select BR2_PACKAGE_LIBGCRYPT
 	select BR2_PACKAGE_POPT
 	select BR2_PACKAGE_LVM2
 	select BR2_PACKAGE_E2FSPROGS
package/cryptsetup/cryptsetup.mk +13 -4
index f43bbca..0ececa9 100644
@@ -8,16 +8,25 @@ CRYPTSETUP_VERSION_MAJOR = 1.6
 CRYPTSETUP_VERSION = $(CRYPTSETUP_VERSION_MAJOR).6
 CRYPTSETUP_SOURCE = cryptsetup-$(CRYPTSETUP_VERSION).tar.xz
 CRYPTSETUP_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/cryptsetup/v$(CRYPTSETUP_VERSION_MAJOR)
-CRYPTSETUP_CONF_ENV += LIBGCRYPT_CONFIG=$(STAGING_DIR)/usr/bin/libgcrypt-config
-CRYPTSETUP_DEPENDENCIES = lvm2 popt e2fsprogs libgcrypt host-pkgconf \
+CRYPTSETUP_DEPENDENCIES = lvm2 popt e2fsprogs host-pkgconf \
 	$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)
 CRYPTSETUP_LICENSE = GPLv2+ (programs), LGPLv2.1+ (library)
 CRYPTSETUP_LICENSE_FILES = COPYING COPYING.LGPL
 
-CRYPTSETUP_AUTORECONF = YES
-
 ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
 CRYPTSETUP_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -lintl"
 endif
 
+# cryptsetup uses libgcrypt by default, but can be configured to use OpenSSL
+# or kernel crypto modules instead
+ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
+CRYPTSETUP_DEPENDENCIES += libgcrypt
+CRYPTSETUP_CONF_ENV += LIBGCRYPT_CONFIG=$(STAGING_DIR)/usr/bin/libgcrypt-config
+else ifeq ($(BR2_PACKAGE_OPENSSL),y)
+CRYPTSETUP_DEPENDENCIES += openssl
+CRYPTSETUP_CONF_OPTS += --with-crypto_backend=openssl
+else
+CRYPTSETUP_CONF_OPTS += --with-crypto_backend=kernel
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v2 1/1 dropbear: add extra build customization options

v2: only offer option to disable building SSH client.
do not offer options to disable password authentication and TCP forwarding.

---
 package/dropbear/Config.in   | 10 ++++++++++
 package/dropbear/dropbear.mk | 17 ++++++++++++-----
 2 files changed, 22 insertions(+), 5 deletions(-)
package/dropbear/Config.in +10 -0
index 68c3b71..c14c654 100644
@@ -8,6 +8,16 @@ config BR2_PACKAGE_DROPBEAR
 
 if BR2_PACKAGE_DROPBEAR
 
+config BR2_PACKAGE_DROPBEAR_CLIENT
+	bool "client programs"
+	default y
+	help
+	  Provides the programs: dbclient, ssh
+
+	  Note that the following programs are also used server-side
+	  and are therefore always build regardless this setting:
+	  dropbear, dropbearkey, dropbearconvert, scp
+
 config BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS
 	bool "disable reverse DNS lookups"
 	help
package/dropbear/dropbear.mk +12 -5
index 6e020c2..e063b10 100644
@@ -7,13 +7,20 @@
 DROPBEAR_VERSION = 2015.67
 DROPBEAR_SITE = http://matt.ucc.asn.au/dropbear/releases
 DROPBEAR_SOURCE = dropbear-$(DROPBEAR_VERSION).tar.bz2
-DROPBEAR_TARGET_BINS = dbclient dropbearkey dropbearconvert scp ssh
-DROPBEAR_MAKE = \
-	$(MAKE) MULTI=1 SCPPROGRESS=1 \
-	PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
-
 DROPBEAR_LICENSE = MIT, BSD-2c-like, BSD-2c
 DROPBEAR_LICENSE_FILES = LICENSE
+DROPBEAR_TARGET_BINS = dropbearkey dropbearconvert scp
+DROPBEAR_PROGRAMS = dropbear $(DROPBEAR_TARGET_BINS)
+
+ifeq ($(BR2_PACKAGE_DROPBEAR_CLIENT),y)
+# Build dbclient, and create a convenience symlink named ssh
+DROPBEAR_PROGRAMS += dbclient
+DROPBEAR_TARGET_BINS += dbclient ssh
+endif
+
+DROPBEAR_MAKE = \
+	$(MAKE) MULTI=1 SCPPROGRESS=1 \
+	PROGRAMS="$(DROPBEAR_PROGRAMS)"
 
 ifeq ($(BR2_STATIC_LIBS),y)
 DROPBEAR_MAKE += STATIC=1
Signature · 1 line
1.9.1
#2 lore raw

PATCH v2 1/1 dropbear: add extra build customization options

Quoted 4 lines · Floris Bos

v2: only offer option to disable building SSH client.
do not offer options to disable password authentication and TCP forwarding.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/1 cryptsetup: remove hard dependency on libgcrypt

In reply to Floris Bos

Dear Floris Bos,

Quoted 2 lines · Floris Bos

- Removes CRYPTSETUP_AUTORECONF as it is redundant, and reconf does create a dependency on libgcrypt for the m4 macros used.

This essentially reverts commit d66c981aaa2248b7e20a4f802f3643435a1761ca, which was made to fix
http://autobuild.buildroot.net/results/9ca/9cad1cf49ee6b5c58d8260ee33beef2e6c1ada4d/.

Can you rebuild the same configuration and see if with your patch it builds fine?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
author
#4 lore raw

PATCH 1/1 cryptsetup: remove hard dependency on libgcrypt

Hi,

Quoted 7 lines · Thomas Petazzoni
Quoted 2 lines · Floris Bos

- Removes CRYPTSETUP_AUTORECONF as it is redundant, and reconf does create a dependency on libgcrypt for the m4 macros used.

This essentially reverts commit d66c981aaa2248b7e20a4f802f3643435a1761ca, which was made to fix
http://autobuild.buildroot.net/results/9ca/9cad1cf49ee6b5c58d8260ee33beef2e6c1ada4d/.

d66c981aaa2248b7e20a4f802f3643435a1761ca was already reverted by commit 40c341da78f3315fa31e4ea56b470753bf915a31 which bumped version again and removed cryptsetup-0001-link-against-lrt-for-clock_gettime.patch that modified configure.ac

Looks to me that removing the autoreconf was simply overlooked there.

Quoted 2 lines

Can you rebuild the same configuration and see if with your patch it builds fine?

That configuration does not work with today's buildroot due to unrelated reasons.
Invalid lua package selection combination, and a long list of legacy options.

Yours sincerely,

Floris Bos

#5 lore raw

PATCH 1/1 cryptsetup: remove hard dependency on libgcrypt

Dear Floris Bos,

Quoted 9 lines · Floris Bos
Quoted 7 lines · Thomas Petazzoni
Quoted 2 lines · Floris Bos

- Removes CRYPTSETUP_AUTORECONF as it is redundant, and reconf does create a dependency on libgcrypt for the m4 macros used.

This essentially reverts commit d66c981aaa2248b7e20a4f802f3643435a1761ca, which was made to fix
http://autobuild.buildroot.net/results/9ca/9cad1cf49ee6b5c58d8260ee33beef2e6c1ada4d/.

Quoted 6 lines

d66c981aaa2248b7e20a4f802f3643435a1761ca was already reverted by commit 40c341da78f3315fa31e4ea56b470753bf915a31 which bumped version again and removed cryptsetup-0001-link-against-lrt-for-clock_gettime.patch that modified configure.ac

Looks to me that removing the autoreconf was simply overlooked there.

Ah, indeed! Would have been good to mention in the commit log, then.

Quoted 7 lines
Quoted 2 lines

Can you rebuild the same configuration and see if with your patch it builds fine?

That configuration does not work with today's buildroot due to unrelated reasons.
Invalid lua package selection combination, and a long list of legacy options.

Yes, obviously old configurations may need some tweaking to build, to remove legacy options.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#6 lore raw

PATCH 1/1 cryptsetup: remove hard dependency on libgcrypt

In reply to Floris Bos

Dear Floris Bos,

Quoted 8 lines · Floris Bos

- Add support for the alternative OpenSSL and Linux kernel crypto backends. The latter does require that additional kernel modules (like algif_hash) are present and loaded before invoking cryptsetup, so is used as last choice.

- Removes CRYPTSETUP_AUTORECONF as it is redundant, and reconf does create a dependency on libgcrypt for the m4 macros used.

Thanks, applied. I've added an explicit --with-crypto_backend=gcrypt for good measure.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com