cryptsetup: remove hard dependency on libgcrypt
authorFloris Bos <bos@je-eigen-domein.nl>
Wed, 4 Feb 2015 18:33:28 +0000 (19:33 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 8 Mar 2015 21:15:57 +0000 (22:15 +0100)
- 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.

[Thomas: add an explicit --with-crypto_backend=gcrypt with the
libgcrypt backend is requested.]

Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/cryptsetup/Config.in
package/cryptsetup/cryptsetup.mk

index 353420fc9d802977c5b9172150f1e8f3008383a5..7f672f9b05c29501253cb98812f902208538c8a5 100644 (file)
@@ -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
index f43bbca9ae5f749131743150bae7da2b927b4900..88ddc37a58da7b193441cca6da9919cb2dd03bed 100644 (file)
@@ -8,16 +8,26 @@ 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
+CRYPTSETUP_CONF_OPTS += --with-crypto_backend=gcrypt
+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))