* [Buildroot] [PATCH 1/1] nvme: Allow libudev support
@ 2016-04-18 4:56 Samuel Mendoza-Jonas
2016-04-18 7:27 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Samuel Mendoza-Jonas @ 2016-04-18 4:56 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 config option which allows libudev support to be enabled for the
nvme package.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
---
package/nvme/Config.in | 9 +++++++++
package/nvme/nvme.mk | 10 ++++++++++
2 files changed, 19 insertions(+)
diff --git a/package/nvme/Config.in b/package/nvme/Config.in
index dd8655f..4590fdc 100644
--- a/package/nvme/Config.in
+++ b/package/nvme/Config.in
@@ -5,3 +5,12 @@ config BR2_PACKAGE_NVME
Express (optimized PCI Express SSD interface) devices.
https://github.com/linux-nvme/nvme-cli
+
+if BR2_PACKAGE_NVME
+
+config BR2_PACKAGE_NVME_LIBUDEV
+ bool "nvme-udev"
+ help
+ libudev support for the NVME utility
+
+endif
diff --git a/package/nvme/nvme.mk b/package/nvme/nvme.mk
index 7c4bd8e..72500c5 100755
--- a/package/nvme/nvme.mk
+++ b/package/nvme/nvme.mk
@@ -8,12 +8,22 @@ NVME_VERSION = v0.3
NVME_SITE = $(call github,linux-nvme,nvme-cli,$(NVME_VERSION))
NVME_LICENSE = GPLv2+
NVME_LICENSE_FILES = LICENSE
+ifeq ($(BR2_PACKAGE_NVME_LIBUDEV), y)
+NVME_DEPENDENCIES = udev
+endif
# LIBUDEV=1 means that libudev is _disabled_
+ifeq ($(BR2_PACKAGE_NVME_LIBUDEV), y)
+define NVME_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \
+ LIBUDEV=0 -C $(@D)
+endef
+else
define NVME_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \
LIBUDEV=1 -C $(@D)
endef
+endif
define NVME_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) \
--
2.8.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 1/1] nvme: Allow libudev support
2016-04-18 4:56 [Buildroot] [PATCH 1/1] nvme: Allow libudev support Samuel Mendoza-Jonas
@ 2016-04-18 7:27 ` Thomas Petazzoni
2016-04-18 7:36 ` Samuel Mendoza-Jonas
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2016-04-18 7:27 UTC (permalink / raw)
To: buildroot
Hello,
Thanks for your contribution!
On Mon, 18 Apr 2016 14:56:26 +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 config option which allows libudev support to be enabled for the
> nvme package.
>
> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
> ---
> package/nvme/Config.in | 9 +++++++++
> package/nvme/nvme.mk | 10 ++++++++++
> 2 files changed, 19 insertions(+)
>
> diff --git a/package/nvme/Config.in b/package/nvme/Config.in
> index dd8655f..4590fdc 100644
> --- a/package/nvme/Config.in
> +++ b/package/nvme/Config.in
> @@ -5,3 +5,12 @@ config BR2_PACKAGE_NVME
> Express (optimized PCI Express SSD interface) devices.
>
> https://github.com/linux-nvme/nvme-cli
> +
> +if BR2_PACKAGE_NVME
> +
> +config BR2_PACKAGE_NVME_LIBUDEV
> + bool "nvme-udev"
> + help
> + libudev support for the NVME utility
> +
> +endif
We don't need a new sub-option, just enable udev support if udev is
available.
> +ifeq ($(BR2_PACKAGE_NVME_LIBUDEV), y)
Remove the space before 'y', and make this:
ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
> +NVME_DEPENDENCIES = udev
Use += here
And then also define:
NVME_MAKE_OPTS += LIBUDEV=0
else
NVME_MAKE_OPTS += LIBUDEV=1
> +endif
>
> # LIBUDEV=1 means that libudev is _disabled_
> +ifeq ($(BR2_PACKAGE_NVME_LIBUDEV), y)
> +define NVME_BUILD_CMDS
> + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \
> + LIBUDEV=0 -C $(@D)
> +endef
> +else
> define NVME_BUILD_CMDS
> $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \
> LIBUDEV=1 -C $(@D)
> endef
Don't duplicate the NVME_BUILD_CMDS variable, simply use
$(NVME_MAKE_OPTS) as defined above.
Could you rework your patch and send an updated version? Thanks a lot!
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
* [Buildroot] [PATCH 1/1] nvme: Allow libudev support
2016-04-18 7:27 ` Thomas Petazzoni
@ 2016-04-18 7:36 ` Samuel Mendoza-Jonas
0 siblings, 0 replies; 3+ messages in thread
From: Samuel Mendoza-Jonas @ 2016-04-18 7:36 UTC (permalink / raw)
To: buildroot
Hello, thanks for the quick response!
On Mon, Apr 18, 2016 at 09:27:36AM +0200, Thomas Petazzoni wrote:
> Hello,
>
> Thanks for your contribution!
>
> On Mon, 18 Apr 2016 14:56:26 +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 config option which allows libudev support to be enabled for the
> > nvme package.
> >
> > Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
> > ---
> > package/nvme/Config.in | 9 +++++++++
> > package/nvme/nvme.mk | 10 ++++++++++
> > 2 files changed, 19 insertions(+)
> >
> > diff --git a/package/nvme/Config.in b/package/nvme/Config.in
> > index dd8655f..4590fdc 100644
> > --- a/package/nvme/Config.in
> > +++ b/package/nvme/Config.in
> > @@ -5,3 +5,12 @@ config BR2_PACKAGE_NVME
> > Express (optimized PCI Express SSD interface) devices.
> >
> > https://github.com/linux-nvme/nvme-cli
> > +
> > +if BR2_PACKAGE_NVME
> > +
> > +config BR2_PACKAGE_NVME_LIBUDEV
> > + bool "nvme-udev"
> > + help
> > + libudev support for the NVME utility
> > +
> > +endif
>
> We don't need a new sub-option, just enable udev support if udev is
> available.
>
> > +ifeq ($(BR2_PACKAGE_NVME_LIBUDEV), y)
Ah right, that's much neater
>
> Remove the space before 'y', and make this:
>
> ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
>
> > +NVME_DEPENDENCIES = udev
>
> Use += here
>
> And then also define:
>
> NVME_MAKE_OPTS += LIBUDEV=0
> else
> NVME_MAKE_OPTS += LIBUDEV=1
>
> > +endif
> >
> > # LIBUDEV=1 means that libudev is _disabled_
> > +ifeq ($(BR2_PACKAGE_NVME_LIBUDEV), y)
> > +define NVME_BUILD_CMDS
> > + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \
> > + LIBUDEV=0 -C $(@D)
> > +endef
> > +else
> > define NVME_BUILD_CMDS
> > $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \
> > LIBUDEV=1 -C $(@D)
> > endef
>
> Don't duplicate the NVME_BUILD_CMDS variable, simply use
> $(NVME_MAKE_OPTS) as defined above.
>
> Could you rework your patch and send an updated version? Thanks a lot!
Absolutely, thank you for the feedback.
Regards,
Sam
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-18 7:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-18 4:56 [Buildroot] [PATCH 1/1] nvme: Allow libudev support Samuel Mendoza-Jonas
2016-04-18 7:27 ` Thomas Petazzoni
2016-04-18 7:36 ` Samuel Mendoza-Jonas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox