[OpenWrt-Devel,04/11] tools/cryptsetup: new package
diff mbox series

Message ID 20190311162028.13172-5-thomas.petazzoni@bootlin.com
State New
Headers show
Series
  • Proposal for dm-verity support
Related show

Commit Message

Thomas Petazzoni March 11, 2019, 4:20 p.m. UTC
cryptsetup for the host will be needed to create the hash tree of a
dm-verity volume.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 tools/Makefile                                |  3 +-
 tools/cryptsetup/Makefile                     | 28 +++++++++++++++++++
 .../patches/0001-dont-use-c89.patch           | 13 +++++++++
 3 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 tools/cryptsetup/Makefile
 create mode 100644 tools/cryptsetup/patches/0001-dont-use-c89.patch

Comments

Hauke Mehrtens March 25, 2019, 5:15 p.m. UTC | #1
On 3/11/19 5:20 PM, Thomas Petazzoni wrote:
> cryptsetup for the host will be needed to create the hash tree of a
> dm-verity volume.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  tools/Makefile                                |  3 +-
>  tools/cryptsetup/Makefile                     | 28 +++++++++++++++++++
>  .../patches/0001-dont-use-c89.patch           | 13 +++++++++
>  3 files changed, 43 insertions(+), 1 deletion(-)
>  create mode 100644 tools/cryptsetup/Makefile
>  create mode 100644 tools/cryptsetup/patches/0001-dont-use-c89.patch
> 
> diff --git a/tools/Makefile b/tools/Makefile
> index 4941fed38d..11f8e437fd 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -27,7 +27,7 @@ tools-y += sstrip make-ext4fs e2fsprogs mtd-utils mkimage
>  tools-y += firmware-utils patch-image quilt padjffs2
>  tools-y += mm-macros missing-macros cmake scons bc findutils gengetopt patchelf
>  tools-y += mtools dosfstools libressl
> -tools-y += libaio lvm2 popt
> +tools-y += libaio lvm2 popt cryptsetup
>  tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
>  tools-$(CONFIG_TARGET_x86) += qemu
>  tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
> @@ -78,6 +78,7 @@ $(curdir)/wrt350nv2-builder/compile := $(curdir)/zlib/compile
>  $(curdir)/lzma-old/compile := $(curdir)/zlib/compile
>  $(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile
>  $(curdir)/lvm2/compile := $(curdir)/pkg-config/compile $(curdir)/libaio/compile
> +$(curdir)/cryptsetup/compile := $(curdir)/pkg-config/compile $(curdir)/libressl/compile $(curdir)/lvm2/compile $(curdir)/popt/compile
>  
>  ifneq ($(HOST_OS),Linux)
>    tools-y += coreutils
> diff --git a/tools/cryptsetup/Makefile b/tools/cryptsetup/Makefile
> new file mode 100644
> index 0000000000..3e500b81ea
> --- /dev/null
> +++ b/tools/cryptsetup/Makefile
> @@ -0,0 +1,28 @@
> +#
> +# Copyright (C) 2010-2015 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +include $(TOPDIR)/rules.mk
> +
> +PKG_NAME:=cryptsetup
> +PKG_VERSION_MAJOR:=2.0
> +PKG_VERSION:=$(PKG_VERSION_MAJOR).6
> +PKG_HASH:=7c51fae0f0e7ea9af0f515b2ac77009fb2969a6619ebab47d097dca38b083d30
> +PKG_RELEASE:=1
> +
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
> +PKG_SOURCE_URL:=@KERNEL/linux/utils/cryptsetup/v$(PKG_VERSION_MAJOR)/
> +
> +HOST_BUILD_PARALLEL:=1
> +
> +include $(INCLUDE_DIR)/host-build.mk
> +
> +HOST_CONFIGURE_ARGS += \
> +	--with-crypto-backend=openssl \
> +	--disable-kernel_crypto \
> +	--disable-blkid
> +
> +$(eval $(call HostBuild))
> diff --git a/tools/cryptsetup/patches/0001-dont-use-c89.patch b/tools/cryptsetup/patches/0001-dont-use-c89.patch
> new file mode 100644
> index 0000000000..3f05fd285b
> --- /dev/null
> +++ b/tools/cryptsetup/patches/0001-dont-use-c89.patch
> @@ -0,0 +1,13 @@
> +Index: cryptsetup-2.0.6/Makefile.in
> +===================================================================
> +--- cryptsetup-2.0.6.orig/Makefile.in
> ++++ cryptsetup-2.0.6/Makefile.in
> +@@ -901,7 +901,7 @@ tmpfilesd_DATA = $(am__append_5)
> + @PYTHON_CRYPTSETUP_TRUE@pycryptsetup_la_CPPFLAGS = $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS) $(PYTHON_INCLUDES) -fno-strict-aliasing
> + @PYTHON_CRYPTSETUP_TRUE@pycryptsetup_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
> + @PYTHON_CRYPTSETUP_TRUE@pycryptsetup_la_LIBADD = libcryptsetup.la $(PYTHON_LIBS)
> +-@CRYPTO_INTERNAL_ARGON2_TRUE@libargon2_la_CFLAGS = $(AM_CFLAGS) -std=c89 -pthread -O3
> ++@CRYPTO_INTERNAL_ARGON2_TRUE@libargon2_la_CFLAGS = $(AM_CFLAGS) -pthread -O3
> + @CRYPTO_INTERNAL_ARGON2_TRUE@libargon2_la_CPPFLAGS = $(AM_CPPFLAGS) \
> + @CRYPTO_INTERNAL_ARGON2_TRUE@	-I lib/crypto_backend/argon2 \
> + @CRYPTO_INTERNAL_ARGON2_TRUE@	-I lib/crypto_backend/argon2/blake2
> 

Please run
	make tools/cryptsetup/{clean,refresh} V=99
to convert this patch into a standard format.

Hauke

Patch
diff mbox series

diff --git a/tools/Makefile b/tools/Makefile
index 4941fed38d..11f8e437fd 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -27,7 +27,7 @@  tools-y += sstrip make-ext4fs e2fsprogs mtd-utils mkimage
 tools-y += firmware-utils patch-image quilt padjffs2
 tools-y += mm-macros missing-macros cmake scons bc findutils gengetopt patchelf
 tools-y += mtools dosfstools libressl
-tools-y += libaio lvm2 popt
+tools-y += libaio lvm2 popt cryptsetup
 tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
 tools-$(CONFIG_TARGET_x86) += qemu
 tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
@@ -78,6 +78,7 @@  $(curdir)/wrt350nv2-builder/compile := $(curdir)/zlib/compile
 $(curdir)/lzma-old/compile := $(curdir)/zlib/compile
 $(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile
 $(curdir)/lvm2/compile := $(curdir)/pkg-config/compile $(curdir)/libaio/compile
+$(curdir)/cryptsetup/compile := $(curdir)/pkg-config/compile $(curdir)/libressl/compile $(curdir)/lvm2/compile $(curdir)/popt/compile
 
 ifneq ($(HOST_OS),Linux)
   tools-y += coreutils
diff --git a/tools/cryptsetup/Makefile b/tools/cryptsetup/Makefile
new file mode 100644
index 0000000000..3e500b81ea
--- /dev/null
+++ b/tools/cryptsetup/Makefile
@@ -0,0 +1,28 @@ 
+#
+# Copyright (C) 2010-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cryptsetup
+PKG_VERSION_MAJOR:=2.0
+PKG_VERSION:=$(PKG_VERSION_MAJOR).6
+PKG_HASH:=7c51fae0f0e7ea9af0f515b2ac77009fb2969a6619ebab47d097dca38b083d30
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@KERNEL/linux/utils/cryptsetup/v$(PKG_VERSION_MAJOR)/
+
+HOST_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_CONFIGURE_ARGS += \
+	--with-crypto-backend=openssl \
+	--disable-kernel_crypto \
+	--disable-blkid
+
+$(eval $(call HostBuild))
diff --git a/tools/cryptsetup/patches/0001-dont-use-c89.patch b/tools/cryptsetup/patches/0001-dont-use-c89.patch
new file mode 100644
index 0000000000..3f05fd285b
--- /dev/null
+++ b/tools/cryptsetup/patches/0001-dont-use-c89.patch
@@ -0,0 +1,13 @@ 
+Index: cryptsetup-2.0.6/Makefile.in
+===================================================================
+--- cryptsetup-2.0.6.orig/Makefile.in
++++ cryptsetup-2.0.6/Makefile.in
+@@ -901,7 +901,7 @@ tmpfilesd_DATA = $(am__append_5)
+ @PYTHON_CRYPTSETUP_TRUE@pycryptsetup_la_CPPFLAGS = $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS) $(PYTHON_INCLUDES) -fno-strict-aliasing
+ @PYTHON_CRYPTSETUP_TRUE@pycryptsetup_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
+ @PYTHON_CRYPTSETUP_TRUE@pycryptsetup_la_LIBADD = libcryptsetup.la $(PYTHON_LIBS)
+-@CRYPTO_INTERNAL_ARGON2_TRUE@libargon2_la_CFLAGS = $(AM_CFLAGS) -std=c89 -pthread -O3
++@CRYPTO_INTERNAL_ARGON2_TRUE@libargon2_la_CFLAGS = $(AM_CFLAGS) -pthread -O3
+ @CRYPTO_INTERNAL_ARGON2_TRUE@libargon2_la_CPPFLAGS = $(AM_CPPFLAGS) \
+ @CRYPTO_INTERNAL_ARGON2_TRUE@	-I lib/crypto_backend/argon2 \
+ @CRYPTO_INTERNAL_ARGON2_TRUE@	-I lib/crypto_backend/argon2/blake2