mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH v2] cryptsetup: new package
@ 2017-09-28 10:50 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2017-09-28 10:50 UTC (permalink / raw)
  To: ptxdist

This adds support for the cryptsetup tools to ptxdist.

Cryptsetup is a utility used to conveniently setup disk encryption based
on DMCrypt kernel module.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---

changes since v1:
- Make crypto backend configurable
- Remove configure options that are default anyway

 rules/cryptsetup.in   | 42 +++++++++++++++++++++++
 rules/cryptsetup.make | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 136 insertions(+)
 create mode 100644 rules/cryptsetup.in
 create mode 100644 rules/cryptsetup.make

diff --git a/rules/cryptsetup.in b/rules/cryptsetup.in
new file mode 100644
index 000000000..551280d50
--- /dev/null
+++ b/rules/cryptsetup.in
@@ -0,0 +1,42 @@
+## SECTION=disk_and_file
+
+menuconfig CRYPTSETUP
+	select LVM2
+	select LIBUUID
+	select LIBPOPT
+	select LIBGCRYPT if CRYPTSETUP_CRYPT_BACKEND_GCRYPT
+	select OPENSSL if CRYPTSETUP_CRYPT_BACKEND_OPENSSL
+	select NETTLE if CRYPTSETUP_CRYPT_BACKEND_NETTLE
+	tristate
+	prompt "cryptsetup                    "
+	help
+	  Cryptsetup is a utility used to conveniently setup disk encryption
+	  based on DMCrypt kernel module.
+
+if CRYPTSETUP
+
+choice
+	prompt "Crypto backend"
+
+	config CRYPTSETUP_CRYPT_BACKEND_KERNEL
+	bool "kernel"
+
+	config CRYPTSETUP_CRYPT_BACKEND_GCRYPT
+	bool "gcrypt"
+
+	config CRYPTSETUP_CRYPT_BACKEND_OPENSSL
+	bool "openssl"
+
+	config CRYPTSETUP_CRYPT_BACKEND_NETTLE
+	bool "nettle"
+endchoice
+
+config CRYPTSETUP_CRYPTSETUP
+	bool
+	prompt "install cryptsetup"
+
+config CRYPTSETUP_VERITYSETUP
+	bool
+	prompt "install veritysetup"
+
+endif
diff --git a/rules/cryptsetup.make b/rules/cryptsetup.make
new file mode 100644
index 000000000..c1e2f23fd
--- /dev/null
+++ b/rules/cryptsetup.make
@@ -0,0 +1,94 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2017 by Sascha Hauer <s.hauer@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_CRYPTSETUP) += cryptsetup
+
+#
+# Paths and names
+#
+CRYPTSETUP_VERSION	:= 1.7.5
+CRYPTSETUP_MD5		:= dde798a883b06a2903379dcd593480e1
+CRYPTSETUP		:= cryptsetup-$(CRYPTSETUP_VERSION)
+CRYPTSETUP_SUFFIX	:= tar.gz
+CRYPTSETUP_URL		:= https://www.kernel.org/pub/linux/utils/cryptsetup/v1.7//$(CRYPTSETUP).$(CRYPTSETUP_SUFFIX)
+CRYPTSETUP_SOURCE	:= $(SRCDIR)/$(CRYPTSETUP).$(CRYPTSETUP_SUFFIX)
+CRYPTSETUP_DIR		:= $(BUILDDIR)/$(CRYPTSETUP)
+CRYPTSETUP_LICENSE	:= GPL-2.0+
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+#
+# autoconf
+#
+CRYPTSETUP_CONF_TOOL	:= autoconf
+CRYPTSETUP_CONF_OPT	:= \
+	$(CROSS_AUTOCONF_USR) \
+	$(GLOBAL_LARGE_FILE_OPTION) \
+	--disable-nls \
+	--disable-rpath \
+	--disable-pwquality \
+	--disable-static-cryptsetup \
+	--enable-veritysetup \
+	--enable-cryptsetup-reencrypt \
+	--disable-selinux \
+	--enable-udev \
+	--enable-dev-random \
+	--disable-python
+
+ifdef PTXCONF_CRYPTSETUP_CRYPT_BACKEND_GCRYPT
+CRYPTSETUP_CONF_OPT += --with-crypto_backend=gcrypt \
+			--enable-gcrypt-pbkdf2
+endif
+
+ifdef PTXCONF_CRYPTSETUP_CRYPT_BACKEND_OPENSSL
+CRYPTSETUP_CONF_OPT += --with-crypto_backend=openssl
+endif
+
+ifdef PTXCONF_CRYPTSETUP_CRYPT_BACKEND_KERNEL
+CRYPTSETUP_CONF_OPT += --with-crypto_backend=kernel \
+			--enable-kernel_crypto
+endif
+
+ifdef PTXCONF_CRYPTSETUP_CRYPT_BACKEND_NETTLE
+CRYPTSETUP_CONF_OPT += --with-crypto_backend=nettle
+endif
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/cryptsetup.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, cryptsetup)
+	@$(call install_fixup, cryptsetup,PRIORITY,optional)
+	@$(call install_fixup, cryptsetup,SECTION,base)
+	@$(call install_fixup, cryptsetup,AUTHOR,"Sascha Hauer <s.hauer@pengutronix.de>")
+	@$(call install_fixup, cryptsetup,DESCRIPTION,missing)
+
+	@$(call install_lib, cryptsetup, 0, 0, 0644, libcryptsetup)
+
+ifdef PTXCONF_CRYPTSETUP_VERITYSETUP
+	@$(call install_copy, cryptsetup, 0, 0, 0755, -, /usr/sbin/veritysetup)
+endif
+ifdef PTXCONF_CRYPTSETUP_CRYPTSETUP
+	@$(call install_copy, cryptsetup, 0, 0, 0755, -, /usr/sbin/cryptsetup)
+endif
+
+	@$(call install_finish, cryptsetup)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-28 10:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-28 10:50 [ptxdist] [PATCH v2] cryptsetup: new package Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox