From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by dpdk.org (Postfix) with ESMTP id BE33F8E9E for ; Wed, 4 Nov 2015 19:20:51 +0100 (CET) Received: by pasz6 with SMTP id z6so61595546pas.2 for ; Wed, 04 Nov 2015 10:20:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber_org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=VivHo/1yG96qkElb0XFn8CYkppaY5xcHuyG6hZEAKhM=; b=D5VzTK34TvWDEi3YwbdGLcjAKQ3GlVlFWoKhc6h1ldXjzIeQD6uaA5SAmw/jemzRXl i6E+ddhVwx/RnwcnN934bH8uINDjijj33VgGxj7tibAwTkQceDbqD/ozO3P/8f99dkIz 2KN1rQeF5HNlNdDZFbjqP9JrN4ctZPqxt3q+laPYfwl2YMxEP9s72KlYO0VPMPyuZHye 6bYClW8oHG399LZ/5EqljNmX9erRtv3YNc+e+vYga+NkTEhUQLh4OdLzCelq6Ybh4ige udGUQfQ2l5BgVHTUeOU8Ybz1qquFIyzXcCdDxRRSRcJCAKloo4BEn9nl+Ba/DyPaGCqE yFLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=VivHo/1yG96qkElb0XFn8CYkppaY5xcHuyG6hZEAKhM=; b=N1hocsoNEj32lwqlYbBNyIGDamuT0wjcsJUgro2VV5g2Ff60i++fGliVH3gVF5X/sL Nydls3UZsyKCqqfTTADVlT1fqmhnM3I5OIAX7GKw206bhzr4ryQzL+xUfaUTLUXbjUDr t8pBrZaGw2cDsCPC7TobQgEhXlBHJQFwEa+TfMSVnhx5DC9JYzKbHnDje8gtfgDFcCKo Qyg8lbjpo6i8IlDnlevTSbeGYp6n1TN6AxQkhtAcH3DT3cmArpP5nwXCZcSK5xesaug0 kwX/+xoVT+NJKcy+UnFk2nYC+wHFPwQmJRsHzh47H0rkYYuU/XPDe3+S2twt5iaX78PF 3vUA== X-Gm-Message-State: ALoCoQk0Gc7g02s2Qh4Sn+9KN7dyGGoJH6GGVqCoNNqZRrZVAiQb33yNwJknQ9OSkqK0DE+hjm3i X-Received: by 10.68.201.202 with SMTP id kc10mr3529140pbc.68.1446661251175; Wed, 04 Nov 2015 10:20:51 -0800 (PST) Received: from xeon-e3 (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id ce3sm3323785pbb.35.2015.11.04.10.20.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2015 10:20:51 -0800 (PST) Date: Wed, 4 Nov 2015 10:21:02 -0800 From: Stephen Hemminger To: Simon =?UTF-8?B?S8OlZ3N0csO2bQ==?= Message-ID: <20151104102102.2697bdd4@xeon-e3> In-Reply-To: <5639EBFD.3030206@netinsight.net> References: <20150820085106.32188573@miho> <4456769.s2fEOyVAiF@xps13> <5639EBFD.3030206@netinsight.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Wed, 04 Nov 2015 18:20:52 -0000 On Wed, 4 Nov 2015 12:29:01 +0100 Simon K=C3=A5gstr=C3=B6m 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>/d= ev/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_signature= | \ > >> - cut -d'~' -f1 | cut -d- -f1,2 | tr .- $(comma= )) > >> +UBUNTU_KERNEL_CODE :=3D $(shell echo `grep UTS_RELEASE $(RTE_KERNELDI= R)/include/generated/utsrelease.h \ > >> + | cut -d '"' -f2 | cut -d- -f1,2 | tr .- $(comma)`,1) > >> MODULE_CFLAGS +=3D -D"UBUNTU_KERNEL_CODE=3DUBUNTU_KERNEL_VERSION($(UB= UNTU_KERNEL_CODE))" > >> endif > >=20 > > 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. >=20 > 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. >=20 > 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. >=20 > // Simon >=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.