From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 8E142567E for ; Fri, 25 Nov 2016 12:35:39 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 25 Nov 2016 03:35:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,546,1473145200"; d="scan'208";a="1064048364" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.57]) ([10.237.220.57]) by orsmga001.jf.intel.com with ESMTP; 25 Nov 2016 03:35:17 -0800 To: Robin Jarry References: <1480067361-6208-1-git-send-email-robin.jarry@6wind.com> <1480073634-14079-1-git-send-email-robin.jarry@6wind.com> Cc: dev@dpdk.org From: Ferruh Yigit Message-ID: <7fa0291a-4e5e-0658-9790-40fba2e61b0a@intel.com> Date: Fri, 25 Nov 2016 11:35:16 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <1480073634-14079-1-git-send-email-robin.jarry@6wind.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] kni: avoid using lsb_release script X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2016 11:35:40 -0000 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 > --- > 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))" >