mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH v2] cryptsetup: new package
Date: Thu, 28 Sep 2017 12:50:02 +0200	[thread overview]
Message-ID: <20170928105002.668-1-s.hauer@pengutronix.de> (raw)

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

                 reply	other threads:[~2017-09-28 10:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170928105002.668-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox