DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] kni: Use utsrelease.h to determine Ubuntu kernel version
@ 2015-08-20  6:51 Simon Kagstrom
  2015-10-13 12:50 ` Simon Kagstrom
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Simon Kagstrom @ 2015-08-20  6:51 UTC (permalink / raw)
  To: helin.zhang, thomas.monjalon, dev

/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.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: Johan Faltstrom <johan.faltstrom@netinsight.net>
---
ChangeLog:

v2: Improve description and motivation for the patch.

 lib/librte_eal/linuxapp/kni/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/librte_eal/linuxapp/kni/Makefile b/lib/librte_eal/linuxapp/kni/Makefile
index fb673d9..ac99d3f 100644
--- 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
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-11-19  9:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-20  6:51 [dpdk-dev] [PATCH v2] kni: Use utsrelease.h to determine Ubuntu kernel version Simon Kagstrom
2015-10-13 12:50 ` Simon Kagstrom
2015-10-13 13:06   ` Tom Ghyselinck
2015-11-04  7:53 ` Simon Kågström
2015-11-04  8:30 ` Zhang, Helin
2015-11-19  9:08   ` Thomas Monjalon
2015-11-04 10:35 ` Thomas Monjalon
2015-11-04 11:29   ` Simon Kågström
2015-11-04 18:21     ` Stephen Hemminger
2015-11-05  8:20       ` Simon Kågström

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).