[dpdk-dev,v3] kni: avoid using lsb_release script
Checks
Commit Message
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(-)
Comments
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>
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
@@ -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))"