diff mbox series

[OpenWrt-Devel,01/11] tools/libaio: new package

Message ID 20190311162028.13172-2-thomas.petazzoni@bootlin.com
State Superseded
Headers show
Series Proposal for dm-verity support | expand

Commit Message

Thomas Petazzoni March 11, 2019, 4:20 p.m. UTC
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

libaio for the host will be needed as a dependency of lvm2, itself a
dependency of cryptsetup.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 tools/Makefile        |  1 +
 tools/libaio/Makefile | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 tools/libaio/Makefile

Comments

Hauke Mehrtens March 25, 2019, 5:13 p.m. UTC | #1
On 3/11/19 5:20 PM, Thomas Petazzoni wrote:
> From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Does this email address still exists?

> libaio for the host will be needed as a dependency of lvm2, itself a
> dependency of cryptsetup.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  tools/Makefile        |  1 +
>  tools/libaio/Makefile | 33 +++++++++++++++++++++++++++++++++
>  2 files changed, 34 insertions(+)
>  create mode 100644 tools/libaio/Makefile
> 
> diff --git a/tools/Makefile b/tools/Makefile
> index 9a354f6c70..9702b4df25 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -27,6 +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

I would prefer if this only gets build when
CONFIG_TARGET_ROOTFS_SQUASHFS_HASHED is set or some other config variable.

>  tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
>  tools-$(CONFIG_TARGET_x86) += qemu
>  tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
> diff --git a/tools/libaio/Makefile b/tools/libaio/Makefile
> new file mode 100644
> index 0000000000..475df7fc1d
> --- /dev/null
> +++ b/tools/libaio/Makefile
> @@ -0,0 +1,33 @@
> +#
> +# 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:=libaio
> +PKG_VERSION:=0.3.111
> +PKG_HASH:=62cf871ad8fd09eb3418f00aca7a7d449299b8e1de31c65f28bf6a2ef1fa502a
> +PKG_RELEASE:=1
> +
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
> +PKG_SOURCE_URL:=https://releases.pagure.org/libaio
> +
> +HOST_BUILD_PARALLEL:=1
> +
> +include $(INCLUDE_DIR)/host-build.mk
> +
> +define Host/Configure
> +endef

Is this empty configure section needed?

> +
> +define Host/Compile
> +	$(MAKE) -C $(HOST_BUILD_DIR)
> +endef
> +
> +define Host/Install
> +	$(MAKE) -C $(HOST_BUILD_DIR) prefix=$(HOST_BUILD_PREFIX) install
> +endef
> +
> +$(eval $(call HostBuild))
>
Thomas Petazzoni March 25, 2019, 5:20 p.m. UTC | #2
Hello Hauke,

Thanks for the review!

On Mon, 25 Mar 2019 18:13:50 +0100
Hauke Mehrtens <hauke@hauke-m.de> wrote:

> On 3/11/19 5:20 PM, Thomas Petazzoni wrote:
> > From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>  
> 
> Does this email address still exists?

It does exist and work, but I'm not supposed to use it. I'll fix this
up, there was some old .gitconfig lying around.

> > diff --git a/tools/Makefile b/tools/Makefile
> > index 9a354f6c70..9702b4df25 100644
> > --- a/tools/Makefile
> > +++ b/tools/Makefile
> > @@ -27,6 +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  
> 
> I would prefer if this only gets build when
> CONFIG_TARGET_ROOTFS_SQUASHFS_HASHED is set or some other config variable.

Sure. I was a bit confused by this to be honest. Wouldn't it be
possible to just add "cryptsetup" to tools-y when
CONFIG_TARGET_ROOTFS_SQUASHFS_HASHED=y, and have the other packages
(libaio, popt, lvm2) be simply built as dependencies of cryptsetup ?

Indeed, what CONFIG_TARGET_ROOTFS_SQUASHFS_HASHED=y really needs is
cryptsetup, the rest are mere build dependencies to build cryptsetup.

> > +PKG_NAME:=libaio
> > +PKG_VERSION:=0.3.111
> > +PKG_HASH:=62cf871ad8fd09eb3418f00aca7a7d449299b8e1de31c65f28bf6a2ef1fa502a
> > +PKG_RELEASE:=1
> > +
> > +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
> > +PKG_SOURCE_URL:=https://releases.pagure.org/libaio
> > +
> > +HOST_BUILD_PARALLEL:=1
> > +
> > +include $(INCLUDE_DIR)/host-build.mk
> > +
> > +define Host/Configure
> > +endef  
> 
> Is this empty configure section needed?

Meh, most likely not. Will fix and retest.

Again, thanks for the review, much appreciated!

Thomas
Thomas Petazzoni July 25, 2019, 1:07 p.m. UTC | #3
Hello Hauke,

I'm finally getting back to this dm-verity work, and I have a question below.

On Mon, 25 Mar 2019 18:20:09 +0100
Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> > > diff --git a/tools/Makefile b/tools/Makefile
> > > index 9a354f6c70..9702b4df25 100644
> > > --- a/tools/Makefile
> > > +++ b/tools/Makefile
> > > @@ -27,6 +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    
> > 
> > I would prefer if this only gets build when
> > CONFIG_TARGET_ROOTFS_SQUASHFS_HASHED is set or some other config variable.  
> 
> Sure. I was a bit confused by this to be honest. Wouldn't it be
> possible to just add "cryptsetup" to tools-y when
> CONFIG_TARGET_ROOTFS_SQUASHFS_HASHED=y, and have the other packages
> (libaio, popt, lvm2) be simply built as dependencies of cryptsetup ?
> 
> Indeed, what CONFIG_TARGET_ROOTFS_SQUASHFS_HASHED=y really needs is
> cryptsetup, the rest are mere build dependencies to build cryptsetup.

Do you have some feedback on this particular question ? Ideally, I'd
like to have just:

tools-$(CONFIG_TARGET_ROOTFS_SQUASHFS_HASHED) += cryptsetup

in tools/Makefile, but I don't know in tools/cryptsetup/Makefile how to
express the dependencies it has on other tools. I briefly looked at
other tools/*/Makefile, and couldn't spot any that has a dependency on
something else.

> > > +include $(INCLUDE_DIR)/host-build.mk
> > > +
> > > +define Host/Configure
> > > +endef    
> > 
> > Is this empty configure section needed?  
> 
> Meh, most likely not. Will fix and retest.

In fact, if you look at tools/*/Makefile, there is a common pattern of
defining Host/Configure to an empty variable:

missing-macros/Makefile:define Host/Configure
missing-macros/Makefile-endef

padjffs2/Makefile:define Host/Configure
padjffs2/Makefile-endef

scons/Makefile:define Host/Configure
scons/Makefile-endef

sdimage/Makefile:define Host/Configure
sdimage/Makefile-endef

this is probably to avoid using the default Host/Configure
implementation from include/host-build.mk. But ok, in my case, using
the default implementation from include/host-build.mk, which does
nothing if there's no configure script, should work just fine.

Thanks,

Thomas
Thomas Petazzoni July 25, 2019, 3:32 p.m. UTC | #4
Hello Hauke,

On Thu, 25 Jul 2019 15:07:50 +0200
Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> > Indeed, what CONFIG_TARGET_ROOTFS_SQUASHFS_HASHED=y really needs is
> > cryptsetup, the rest are mere build dependencies to build cryptsetup.  
> 
> Do you have some feedback on this particular question ? Ideally, I'd
> like to have just:
> 
> tools-$(CONFIG_TARGET_ROOTFS_SQUASHFS_HASHED) += cryptsetup
> 
> in tools/Makefile, but I don't know in tools/cryptsetup/Makefile how to
> express the dependencies it has on other tools. I briefly looked at
> other tools/*/Makefile, and couldn't spot any that has a dependency on
> something else.

Stupid me, the dependencies are obviously described in tools/Makefile,
my patches even take that into account. So all clear on this, I'll take
into account your comment in v2.

Best regards,

Thomas
diff mbox series

Patch

diff --git a/tools/Makefile b/tools/Makefile
index 9a354f6c70..9702b4df25 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -27,6 +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
 tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
 tools-$(CONFIG_TARGET_x86) += qemu
 tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
diff --git a/tools/libaio/Makefile b/tools/libaio/Makefile
new file mode 100644
index 0000000000..475df7fc1d
--- /dev/null
+++ b/tools/libaio/Makefile
@@ -0,0 +1,33 @@ 
+#
+# 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:=libaio
+PKG_VERSION:=0.3.111
+PKG_HASH:=62cf871ad8fd09eb3418f00aca7a7d449299b8e1de31c65f28bf6a2ef1fa502a
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://releases.pagure.org/libaio
+
+HOST_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Configure
+endef
+
+define Host/Compile
+	$(MAKE) -C $(HOST_BUILD_DIR)
+endef
+
+define Host/Install
+	$(MAKE) -C $(HOST_BUILD_DIR) prefix=$(HOST_BUILD_PREFIX) install
+endef
+
+$(eval $(call HostBuild))