From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] kni: Use utsrelease.h to determine Ubuntu kernel version Date: Wed, 04 Nov 2015 11:35:41 +0100 Message-ID: <4456769.s2fEOyVAiF@xps13> References: <20150820085106.32188573@miho> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Simon Kagstrom Return-path: Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by dpdk.org (Postfix) with ESMTP id DE1F08E8A for ; Wed, 4 Nov 2015 11:36:53 +0100 (CET) Received: by wicll6 with SMTP id ll6so86956715wic.0 for ; Wed, 04 Nov 2015 02:36:53 -0800 (PST) In-Reply-To: <20150820085106.32188573@miho> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2015-08-20 08:51, Simon Kagstrom: > /proc/version_signature is the version for the host machine, but in > e.g., chroots, this does not necessarily match that DPDK is built > for. DPDK will then build for the wrong kernel version - that of the > server, and not that installed in the (build) chroot. > > The patch uses utsrelease.h from the kernel sources instead and fakes > the upload version. > > Tested on a server with Ubuntu 12.04, building in a chroot for Ubuntu > 14.04. [...] > --- a/lib/librte_eal/linuxapp/kni/Makefile > +++ b/lib/librte_eal/linuxapp/kni/Makefile > @@ -44,10 +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 test -f /proc/version_signature && lsb_release -si 2>/dev/null),Ubuntu) > +ifeq ($(shell lsb_release -si 2>/dev/null),Ubuntu) > MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(shell lsb_release -sr | tr -d .) > -UBUNTU_KERNEL_CODE := $(shell cut -d' ' -f2 /proc/version_signature | \ > - cut -d'~' -f1 | cut -d- -f1,2 | tr .- $(comma)) > +UBUNTU_KERNEL_CODE := $(shell echo `grep UTS_RELEASE $(RTE_KERNELDIR)/include/generated/utsrelease.h \ > + | cut -d '"' -f2 | cut -d- -f1,2 | tr .- $(comma)`,1) > MODULE_CFLAGS += -D"UBUNTU_KERNEL_CODE=UBUNTU_KERNEL_VERSION($(UBUNTU_KERNEL_CODE))" > endif Yes we must check RTE_KERNELDIR instead of the running kernel. But it is still checking lsb_release for the running system. It seems not consistent.