From: Stephen Hemminger <stephen@networkplumber.org>
To: "Simon Kågström" <simon.kagstrom@netinsight.net>
Cc: dev@dpdk.org
Subject: Re: [PATCH v2] kni: Use utsrelease.h to determine Ubuntu kernel version
Date: Wed, 4 Nov 2015 10:21:02 -0800 [thread overview]
Message-ID: <20151104102102.2697bdd4@xeon-e3> (raw)
In-Reply-To: <5639EBFD.3030206@netinsight.net>
On Wed, 4 Nov 2015 12:29:01 +0100
Simon Kågström <simon.kagstrom@netinsight.net> wrote:
> On 2015-11-04 11:35, Thomas Monjalon wrote:
> > 2015-08-20 08:51, Simon Kagstrom:
> >> -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.
>
> I don't think so: the case the patch addresses is where the running
> kernel and rootfs doesn't match, like in a chroot environment.
>
> So lsb_release will come from the chroot, as it should, but without the
> patch, the kernel version will not come from the installed kernel
> headers in the chroot, but the running kernel - which might even not be
> Ubuntu.
>
> // Simon
>
The danger here is starting to assume the build machine is the same as the
running image. Using /proc to determine runtime environment is wrong.
next prev parent reply other threads:[~2015-11-04 18:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-20 6:51 [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 [this message]
2015-11-05 8:20 ` Simon Kågström
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151104102102.2697bdd4@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=simon.kagstrom@netinsight.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.