From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from [10.100.1.152] (unverified [10.100.1.152]) by ernst.netinsight.se (EMWAC SMTPRS 0.83) with SMTP id ; Thu, 05 Nov 2015 09:20:11 +0100 To: Stephen Hemminger References: <20150820085106.32188573@miho> <4456769.s2fEOyVAiF@xps13> <5639EBFD.3030206@netinsight.net> <20151104102102.2697bdd4@xeon-e3> From: =?UTF-8?Q?Simon_K=c3=a5gstr=c3=b6m?= Message-ID: <563B113C.9000109@netinsight.net> Date: Thu, 5 Nov 2015 09:20:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151104102102.2697bdd4@xeon-e3> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] kni: Use utsrelease.h to determine Ubuntu kernel version X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Nov 2015 08:20:15 -0000 On 2015-11-04 19:21, Stephen Hemminger wrote: > On Wed, 4 Nov 2015 12:29:01 +0100 > Simon Kågström 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 >>> >> 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. > > 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