From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Simon_K=c3=a5gstr=c3=b6m?= Subject: Re: [PATCH v2] kni: Use utsrelease.h to determine Ubuntu kernel version Date: Thu, 5 Nov 2015 09:20:12 +0100 Message-ID: <563B113C.9000109@netinsight.net> References: <20150820085106.32188573@miho> <4456769.s2fEOyVAiF@xps13> <5639EBFD.3030206@netinsight.net> <20151104102102.2697bdd4@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: Stephen Hemminger Return-path: Received: from ernst.netinsight.se (ernst.netinsight.se [194.16.221.21]) by dpdk.org (Postfix) with SMTP id 180618DA9 for ; Thu, 5 Nov 2015 09:20:15 +0100 (CET) In-Reply-To: <20151104102102.2697bdd4@xeon-e3> 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" On 2015-11-04 19:21, Stephen Hemminger wrote: > On Wed, 4 Nov 2015 12:29:01 +0100 > Simon K=C3=A5gstr=C3=B6m wrote: >=20 >> 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 +=3D -DUBUNTU_RELEASE_CODE=3D$(shell lsb_release -sr = | tr -d .) >>>> -UBUNTU_KERNEL_CODE :=3D $(shell cut -d' ' -f2 /proc/version_signatu= re | \ >>>> - cut -d'~' -f1 | cut -d- -f1,2 | tr .- $(com= ma)) >>>> +UBUNTU_KERNEL_CODE :=3D $(shell echo `grep UTS_RELEASE $(RTE_KERNEL= DIR)/include/generated/utsrelease.h \ >>>> + | cut -d '"' -f2 | cut -d- -f1,2 | tr .- $(comma)`,1) >>>> MODULE_CFLAGS +=3D -D"UBUNTU_KERNEL_CODE=3DUBUNTU_KERNEL_VERSION($(= UBUNTU_KERNEL_CODE))" >>>> endif >>> >> So lsb_release will come from the chroot, as it should, but without th= e >> patch, the kernel version will not come from the installed kernel >> headers in the chroot, but the running kernel - which might even not b= e >> Ubuntu. >=20 > 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. Exactly, and our build breaks because of this without the patch. So the patch removes the check in /proc and instead takes the kernel version from the kernel headers. // Simon