* [Buildroot] [PATCH V2 1/1] nvme: Allow libudev support
@ 2016-04-19 1:54 Samuel Mendoza-Jonas
2016-04-19 8:01 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Samuel Mendoza-Jonas @ 2016-04-19 1:54 UTC (permalink / raw)
To: buildroot
Commands like 'nvme list' require libudev but support for libudev is
decided at compile time, and in buildroot this is hard disabled.
Add a check for udev and if it is available build nvme with udev
support.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
---
v2: Use BR2_PACKAGE_HAS_UDEV and NVME_MAKE_OPTS instead of a new option
as suggested by Thomas Petazzoni
package/nvme/nvme.mk | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/package/nvme/nvme.mk b/package/nvme/nvme.mk
index 7c4bd8e..3571494 100755
--- a/package/nvme/nvme.mk
+++ b/package/nvme/nvme.mk
@@ -8,11 +8,17 @@ NVME_VERSION = v0.3
NVME_SITE = $(call github,linux-nvme,nvme-cli,$(NVME_VERSION))
NVME_LICENSE = GPLv2+
NVME_LICENSE_FILES = LICENSE
+ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
+NVME_DEPENDENCIES += udev
+NVME_MAKE_OPTS = LIBUDEV=0
+else
+NVME_MAKE_OPTS = LIBUDEV=1
+endif
# LIBUDEV=1 means that libudev is _disabled_
define NVME_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \
- LIBUDEV=1 -C $(@D)
+ $(NVME_MAKE_OPTS) -C $(@D)
endef
define NVME_INSTALL_TARGET_CMDS
--
2.8.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH V2 1/1] nvme: Allow libudev support
2016-04-19 1:54 [Buildroot] [PATCH V2 1/1] nvme: Allow libudev support Samuel Mendoza-Jonas
@ 2016-04-19 8:01 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-04-19 8:01 UTC (permalink / raw)
To: buildroot
Hello,
On Tue, 19 Apr 2016 11:54:24 +1000, Samuel Mendoza-Jonas wrote:
> Commands like 'nvme list' require libudev but support for libudev is
> decided at compile time, and in buildroot this is hard disabled.
> Add a check for udev and if it is available build nvme with udev
> support.
>
> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
I've applied, after doing a few changes (since below).
> diff --git a/package/nvme/nvme.mk b/package/nvme/nvme.mk
> index 7c4bd8e..3571494 100755
> --- a/package/nvme/nvme.mk
> +++ b/package/nvme/nvme.mk
> @@ -8,11 +8,17 @@ NVME_VERSION = v0.3
> NVME_SITE = $(call github,linux-nvme,nvme-cli,$(NVME_VERSION))
> NVME_LICENSE = GPLv2+
> NVME_LICENSE_FILES = LICENSE
I've added a comment here that insists on the fact that yes, LIBUDEV=0
enables udev support, while LIBUDEV=1 disables udev support, which is a
bit counter-intuitive.
> +ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
> +NVME_DEPENDENCIES += udev
> +NVME_MAKE_OPTS = LIBUDEV=0
I've changed to use += here
> +else
> +NVME_MAKE_OPTS = LIBUDEV=1
and here, since it's a bit more future proof. It will avoid mistakes if
someone adds NVME_MAKE_OPTS = <something> outside of the conditional
block.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-19 8:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-19 1:54 [Buildroot] [PATCH V2 1/1] nvme: Allow libudev support Samuel Mendoza-Jonas
2016-04-19 8:01 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox