* [dpdk-dev] [PATCH v2] kni: avoid using lsb_release script [not found] <1480067361-6208-1-git-send-email-robin.jarry@6wind.com> @ 2016-11-25 11:33 ` Robin Jarry 2016-11-25 11:35 ` Ferruh Yigit 2016-11-25 12:22 ` [dpdk-dev] [PATCH v3] " Robin Jarry 0 siblings, 2 replies; 5+ messages in thread From: Robin Jarry @ 2016-11-25 11:33 UTC (permalink / raw) To: Ferruh Yigit; +Cc: dev The lsb_release script is part of an optional package which is not always installed. On the other hand, /etc/lsb-release is always present even on minimal Ubuntu installations. root@ubuntu1604:~# dpkg -S /etc/lsb-release base-files: /etc/lsb-release Read the file if present and use the variables defined in it. Signed-off-by: Robin Jarry <robin.jarry@6wind.com> --- lib/librte_eal/linuxapp/kni/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/linuxapp/kni/Makefile b/lib/librte_eal/linuxapp/kni/Makefile index 4e99e07e7aec..62a957ce8534 100644 --- a/lib/librte_eal/linuxapp/kni/Makefile +++ b/lib/librte_eal/linuxapp/kni/Makefile @@ -44,8 +44,12 @@ MODULE_CFLAGS += -I$(RTE_OUTPUT)/include -I$(SRCDIR)/ethtool/ixgbe -I$(SRCDIR)/e MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h MODULE_CFLAGS += -Wall -Werror -ifeq ($(shell lsb_release -si 2>/dev/null),Ubuntu) -MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(shell lsb_release -sr | tr -d .) +ifneq ($(wildcard /etc/lsb-release),) +-include /etc/lsb-release +endif + +ifeq ($(DISTRIB_ID),Ubuntu) +MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(subst .,,$(DISTRIB_RELEASE)) UBUNTU_KERNEL_CODE := $(shell echo `grep UTS_RELEASE $(RTE_KERNELDIR)/include/generated/utsrelease.h \ | cut -d '"' -f2 | cut -d- -f1,2 | tr .- ,`,1) MODULE_CFLAGS += -D"UBUNTU_KERNEL_CODE=UBUNTU_KERNEL_VERSION($(UBUNTU_KERNEL_CODE))" -- 2.1.4 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH v2] kni: avoid using lsb_release script 2016-11-25 11:33 ` [dpdk-dev] [PATCH v2] kni: avoid using lsb_release script Robin Jarry @ 2016-11-25 11:35 ` Ferruh Yigit 2016-11-25 12:22 ` [dpdk-dev] [PATCH v3] " Robin Jarry 1 sibling, 0 replies; 5+ messages in thread From: Ferruh Yigit @ 2016-11-25 11:35 UTC (permalink / raw) To: Robin Jarry; +Cc: dev On 11/25/2016 11:33 AM, Robin Jarry wrote: > The lsb_release script is part of an optional package which is not > always installed. On the other hand, /etc/lsb-release is always present > even on minimal Ubuntu installations. > > root@ubuntu1604:~# dpkg -S /etc/lsb-release > base-files: /etc/lsb-release > > Read the file if present and use the variables defined in it. > > Signed-off-by: Robin Jarry <robin.jarry@6wind.com> > --- > lib/librte_eal/linuxapp/kni/Makefile | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_eal/linuxapp/kni/Makefile b/lib/librte_eal/linuxapp/kni/Makefile > index 4e99e07e7aec..62a957ce8534 100644 > --- a/lib/librte_eal/linuxapp/kni/Makefile > +++ b/lib/librte_eal/linuxapp/kni/Makefile > @@ -44,8 +44,12 @@ MODULE_CFLAGS += -I$(RTE_OUTPUT)/include -I$(SRCDIR)/ethtool/ixgbe -I$(SRCDIR)/e > MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h > MODULE_CFLAGS += -Wall -Werror > > -ifeq ($(shell lsb_release -si 2>/dev/null),Ubuntu) > -MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(shell lsb_release -sr | tr -d .) > +ifneq ($(wildcard /etc/lsb-release),) I mean removing this check completely, and having only below line, do you think does it works that way? > +-include /etc/lsb-release > +endif > + > +ifeq ($(DISTRIB_ID),Ubuntu) > +MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(subst .,,$(DISTRIB_RELEASE)) > UBUNTU_KERNEL_CODE := $(shell echo `grep UTS_RELEASE $(RTE_KERNELDIR)/include/generated/utsrelease.h \ > | cut -d '"' -f2 | cut -d- -f1,2 | tr .- ,`,1) > MODULE_CFLAGS += -D"UBUNTU_KERNEL_CODE=UBUNTU_KERNEL_VERSION($(UBUNTU_KERNEL_CODE))" > ^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH v3] kni: avoid using lsb_release script 2016-11-25 11:33 ` [dpdk-dev] [PATCH v2] kni: avoid using lsb_release script Robin Jarry 2016-11-25 11:35 ` Ferruh Yigit @ 2016-11-25 12:22 ` Robin Jarry 2016-11-25 12:24 ` Ferruh Yigit 1 sibling, 1 reply; 5+ messages in thread From: Robin Jarry @ 2016-11-25 12:22 UTC (permalink / raw) To: Ferruh Yigit; +Cc: dev The lsb_release script is part of an optional package which is not always installed. On the other hand, /etc/lsb-release is always present even on minimal Ubuntu installations. root@ubuntu1604:~# dpkg -S /etc/lsb-release base-files: /etc/lsb-release Read the file if present and use the variables defined in it. Signed-off-by: Robin Jarry <robin.jarry@6wind.com> --- lib/librte_eal/linuxapp/kni/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/linuxapp/kni/Makefile b/lib/librte_eal/linuxapp/kni/Makefile index 4e99e07e7aec..1e4756123d0c 100644 --- a/lib/librte_eal/linuxapp/kni/Makefile +++ b/lib/librte_eal/linuxapp/kni/Makefile @@ -44,8 +44,10 @@ MODULE_CFLAGS += -I$(RTE_OUTPUT)/include -I$(SRCDIR)/ethtool/ixgbe -I$(SRCDIR)/e MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h MODULE_CFLAGS += -Wall -Werror -ifeq ($(shell lsb_release -si 2>/dev/null),Ubuntu) -MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(shell lsb_release -sr | tr -d .) +-include /etc/lsb-release + +ifeq ($(DISTRIB_ID),Ubuntu) +MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(subst .,,$(DISTRIB_RELEASE)) UBUNTU_KERNEL_CODE := $(shell echo `grep UTS_RELEASE $(RTE_KERNELDIR)/include/generated/utsrelease.h \ | cut -d '"' -f2 | cut -d- -f1,2 | tr .- ,`,1) MODULE_CFLAGS += -D"UBUNTU_KERNEL_CODE=UBUNTU_KERNEL_VERSION($(UBUNTU_KERNEL_CODE))" -- 2.1.4 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH v3] kni: avoid using lsb_release script 2016-11-25 12:22 ` [dpdk-dev] [PATCH v3] " Robin Jarry @ 2016-11-25 12:24 ` Ferruh Yigit 2016-12-07 17:37 ` Thomas Monjalon 0 siblings, 1 reply; 5+ messages in thread From: Ferruh Yigit @ 2016-11-25 12:24 UTC (permalink / raw) To: Robin Jarry; +Cc: dev On 11/25/2016 12:22 PM, Robin Jarry wrote: > The lsb_release script is part of an optional package which is not > always installed. On the other hand, /etc/lsb-release is always present > even on minimal Ubuntu installations. > > root@ubuntu1604:~# dpkg -S /etc/lsb-release > base-files: /etc/lsb-release > > Read the file if present and use the variables defined in it. > > Signed-off-by: Robin Jarry <robin.jarry@6wind.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com> ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH v3] kni: avoid using lsb_release script 2016-11-25 12:24 ` Ferruh Yigit @ 2016-12-07 17:37 ` Thomas Monjalon 0 siblings, 0 replies; 5+ messages in thread From: Thomas Monjalon @ 2016-12-07 17:37 UTC (permalink / raw) To: Robin Jarry; +Cc: dev, Ferruh Yigit 2016-11-25 12:24, Ferruh Yigit: > On 11/25/2016 12:22 PM, Robin Jarry wrote: > > The lsb_release script is part of an optional package which is not > > always installed. On the other hand, /etc/lsb-release is always present > > even on minimal Ubuntu installations. > > > > root@ubuntu1604:~# dpkg -S /etc/lsb-release > > base-files: /etc/lsb-release > > > > Read the file if present and use the variables defined in it. > > > > Signed-off-by: Robin Jarry <robin.jarry@6wind.com> > > Acked-by: Ferruh Yigit <ferruh.yigit@intel.com> Applied, thanks ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-12-07 17:37 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <1480067361-6208-1-git-send-email-robin.jarry@6wind.com> 2016-11-25 11:33 ` [dpdk-dev] [PATCH v2] kni: avoid using lsb_release script Robin Jarry 2016-11-25 11:35 ` Ferruh Yigit 2016-11-25 12:22 ` [dpdk-dev] [PATCH v3] " Robin Jarry 2016-11-25 12:24 ` Ferruh Yigit 2016-12-07 17:37 ` Thomas Monjalon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).