All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v5] bcache-tools: Adding package.
@ 2014-08-05 17:29 Jean-Christophe DUBOIS
  2014-08-06 21:48 ` Yann E. MORIN
  0 siblings, 1 reply; 3+ messages in thread
From: Jean-Christophe DUBOIS @ 2014-08-05 17:29 UTC (permalink / raw)
  To: buildroot

This is the bcache tools, required to setup the linux bcache
feature of the Linux kernel.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
---
Changes v1 to v2
 * remove 'support' word from comment statement in Config.in.
 * use github helper to get the project site instead of hardcoded URL.
Changes v2 to v3
 * Added bcache-tools description in Config help
 * Added bcache-tools URL in Config help
 * Added BR2_LARGEFILE BR2_USE_WCHAR and BR2_USE_MMU dependencies in Config.
 * Added BR2_PACKAGE_UTIL_LINUX selection in Config
 * Added new requirements in Config comment.
 * use POST_EXTRACT_HOOKS to modify Makefile
 * pass $(TARGET_CONFIGURE_OPTS) in env variables to $(MAKE)
 * create man8 dir as part of PRE_INSTALL_TARGET_HOOKS
Changes v3 to v4
 * move from .zip file to .tar.gz as download file in .mk file
 * use complete git tag as version in .mk file.
 * remove explicit extract rule from .mk file (use implicite rule).
Changes v4 to v5
 * remove explicit package name in .mk (rely on default behavior).
---
 package/Config.in                    |  1 +
 package/bcache-tools/Config.in       | 22 ++++++++++++++++++++
 package/bcache-tools/bcache-tools.mk | 39 ++++++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+)
 create mode 100644 package/bcache-tools/Config.in
 create mode 100644 package/bcache-tools/bcache-tools.mk

diff --git a/package/Config.in b/package/Config.in
index 4520ba6..dc2f418 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -280,6 +280,7 @@ endmenu
 	source "package/a10disp/Config.in"
 	source "package/acpid/Config.in"
 	source "package/avrdude/Config.in"
+	source "package/bcache-tools/Config.in"
 	source "package/cdrkit/Config.in"
 	source "package/cryptsetup/Config.in"
 	source "package/cwiid/Config.in"
diff --git a/package/bcache-tools/Config.in b/package/bcache-tools/Config.in
new file mode 100644
index 0000000..383ba1f
--- /dev/null
+++ b/package/bcache-tools/Config.in
@@ -0,0 +1,22 @@
+config BR2_PACKAGE_BCACHE_TOOLS
+	bool "bcache tools"
+	depends on BR2_PACKAGE_HAS_UDEV
+	depends on BR2_LARGEFILE # util-linux
+	depends on BR2_USE_WCHAR # util-linux
+	depends on BR2_USE_MMU # util-linux (libblkid)
+	select BR2_PACKAGE_UTIL_LINUX
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	help
+	  Bcache is a Linux kernel block layer cache. It allows one or
+	  more fast disk drives such as flash-based solid state drives (SSDs)
+	  to act as a cache for one or more slower hard disk drives.
+
+	  http://bcache.evilpiepirate.org/
+
+	  This is the user space bcache tools, required to setup the linux
+	  bcache feature of the Linux kernel.
+
+comment "bcache-tools needs udev /dev management and a toolchain w/ largefile, wchar"
+	depends on BR2_USE_MMU
+        depends on !BR2_PACKAGE_HAS_UDEV || !BR2_LARGEFILE || !BR2_USE_WCHAR
diff --git a/package/bcache-tools/bcache-tools.mk b/package/bcache-tools/bcache-tools.mk
new file mode 100644
index 0000000..5e451cf
--- /dev/null
+++ b/package/bcache-tools/bcache-tools.mk
@@ -0,0 +1,39 @@
+################################################################################
+#
+# bcache-tools
+#
+################################################################################
+
+BCACHE_TOOLS_VERSION = v1.0.7
+BCACHE_TOOLS_SITE = $(call github,g2p,bcache-tools,$(BCACHE_TOOLS_VERSION))
+BCACHE_TOOLS_LICENSE = GPLv2
+BCACHE_TOOLS_LICENSE_FILES = COPYING
+BCACHE_TOOLS_DEPENDENCIES = host-pkgconf util-linux eudev
+
+# We need to use the BR2 host pkg-config binary in the Makefile
+define BCACHE_TOOLS_FIX_PKGCONFIG
+	$(SED) 's^`pkg-config^`$(PKG_CONFIG_HOST_BINARY)^' \
+		$(BCACHE_TOOLS_DIR)/Makefile
+endef
+
+BCACHE_TOOLS_POST_EXTRACT_HOOKS += BCACHE_TOOLS_FIX_PKGCONFIG
+
+# We pass $(TARGET_CONFIGURE_OPTS) as environment variable to allow
+# the bcache-tools Makefile to alter CFLAGS
+define BCACHE_TOOLS_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
+endef
+
+# The bcache-tools Makefile expects the man8 directory to exist.
+define BCACHE_TOOLS_INSTALL_MAN8
+	$(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/share/man/man8
+endef
+
+BCACHE_TOOLS_PRE_INSTALL_TARGET_HOOKS += BCACHE_TOOLS_INSTALL_MAN8
+
+define BCACHE_TOOLS_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+		DESTDIR=$(TARGET_DIR) install
+endef
+
+$(eval $(generic-package))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH v5] bcache-tools: Adding package.
  2014-08-05 17:29 [Buildroot] [PATCH v5] bcache-tools: Adding package Jean-Christophe DUBOIS
@ 2014-08-06 21:48 ` Yann E. MORIN
  2014-08-07  7:06   ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Yann E. MORIN @ 2014-08-06 21:48 UTC (permalink / raw)
  To: buildroot

Jean-Christophe, All,

On 2014-08-05 19:29 +0200, Jean-Christophe DUBOIS spake thusly:
> This is the bcache tools, required to setup the linux bcache
> feature of the Linux kernel.

We're almost there! :-)

> Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
[--SNIP--]
> diff --git a/package/bcache-tools/Config.in b/package/bcache-tools/Config.in
> new file mode 100644
> index 0000000..383ba1f
> --- /dev/null
> +++ b/package/bcache-tools/Config.in
[--SNIP--]
> +comment "bcache-tools needs udev /dev management and a toolchain w/ largefile, wchar"
> +	depends on BR2_USE_MMU
> +        depends on !BR2_PACKAGE_HAS_UDEV || !BR2_LARGEFILE || !BR2_USE_WCHAR

Leading TAB, please.

> diff --git a/package/bcache-tools/bcache-tools.mk b/package/bcache-tools/bcache-tools.mk
> new file mode 100644
> index 0000000..5e451cf
> --- /dev/null
> +++ b/package/bcache-tools/bcache-tools.mk
> @@ -0,0 +1,39 @@
> +################################################################################
> +#
> +# bcache-tools
> +#
> +################################################################################
> +
> +BCACHE_TOOLS_VERSION = v1.0.7
> +BCACHE_TOOLS_SITE = $(call github,g2p,bcache-tools,$(BCACHE_TOOLS_VERSION))
> +BCACHE_TOOLS_LICENSE = GPLv2
> +BCACHE_TOOLS_LICENSE_FILES = COPYING
> +BCACHE_TOOLS_DEPENDENCIES = host-pkgconf util-linux eudev
> +
> +# We need to use the BR2 host pkg-config binary in the Makefile
> +define BCACHE_TOOLS_FIX_PKGCONFIG
> +	$(SED) 's^`pkg-config^`$(PKG_CONFIG_HOST_BINARY)^' \
> +		$(BCACHE_TOOLS_DIR)/Makefile
> +endef

This is not needed, since the host directory comes early in the PATH, so
it finds our own pkg-config.

> +BCACHE_TOOLS_POST_EXTRACT_HOOKS += BCACHE_TOOLS_FIX_PKGCONFIG
> +
> +# We pass $(TARGET_CONFIGURE_OPTS) as environment variable to allow
> +# the bcache-tools Makefile to alter CFLAGS
> +define BCACHE_TOOLS_BUILD_CMDS
> +	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
> +endef
> +
> +# The bcache-tools Makefile expects the man8 directory to exist.
> +define BCACHE_TOOLS_INSTALL_MAN8
> +	$(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/share/man/man8
> +endef

In Buildroot, the man pages are simply removed from the target/ dir jsut
prior to generatign the filesystem images.

Then, why not simply patch the Makefile to not install them in the first
place? Like, in a post-extract hook.

Thanks for your persistence! :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH v5] bcache-tools: Adding package.
  2014-08-06 21:48 ` Yann E. MORIN
@ 2014-08-07  7:06   ` Thomas Petazzoni
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2014-08-07  7:06 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Wed, 6 Aug 2014 23:48:52 +0200, Yann E. MORIN wrote:

> > +# The bcache-tools Makefile expects the man8 directory to exist.
> > +define BCACHE_TOOLS_INSTALL_MAN8
> > +	$(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/share/man/man8
> > +endef
> 
> In Buildroot, the man pages are simply removed from the target/ dir jsut
> prior to generatign the filesystem images.
> 
> Then, why not simply patch the Makefile to not install them in the first
> place? Like, in a post-extract hook.

I disagree. I would prefer to make a patch that actually fixes the
installation of the man pages and submit this patch upstream. This way,
when upstream releases a new version, we can get rid of the patch, and
simply do "make install" without any other thing to do. Buildroot will
take care of removing the man pages.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-07  7:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-05 17:29 [Buildroot] [PATCH v5] bcache-tools: Adding package Jean-Christophe DUBOIS
2014-08-06 21:48 ` Yann E. MORIN
2014-08-07  7:06   ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.