[dpdk-dev] [PATCH] kni: Use utsrelease.h to determine Ubuntu kernel version

Stephen Hemminger stephen at networkplumber.org
Thu May 28 06:00:23 CEST 2015


This ugly and fast becoming unmaintainable and ridiculous.

KNI needs to get out of being a bunch of out of tree code chasing the
kernel API tail lights
and become something stable and submitted upstream.

On Wed, May 27, 2015 at 4:45 AM, Simon Kagstrom <
simon.kagstrom at netinsight.net> wrote:

> /proc/version_signature is the version for the host machine, but in
> e.g., chroots, this does not need to match that DPDK is built for. Use
> utsrelease.h from the kernel sources instead and fake the upload
> version.
>
> Signed-off-by: Simon Kagstrom <simon.kagstrom at netinsight.net>
> Signed-off-by: Johan Faltstrom <johan.faltstrom at netinsight.net>
> ---
>  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
>
>


More information about the dev mailing list