From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 41B18FFA for ; Fri, 25 Nov 2016 13:22:30 +0100 (CET) Received: by mail-wm0-f51.google.com with SMTP id f82so90252472wmf.1 for ; Fri, 25 Nov 2016 04:22:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4gqhLZj1+wBW8JW+iJql4fBSQrvV0eGzbqAXRWPAfV0=; b=n5HB727qeI/vxa7bfP/eFaSS0UaS7LhEVquG2aP1I+aDt+JUPNOF67OaDUsdW6n60r YzpguPJBzPK0yjxoidVUSGmUsiCdbqmoJlbJ4Tkpan6/0FwKn+Ls0dCyLj7t9FJUeTMm LSHlw1QWkcrXqIpaxbpmpMuYvSAugnJTET+eqqNfPqJZmctl+94nfNl1Yu6tjlWfRXNd vksoX1mQGU9hsOqN3Drcw9fOxyX8mS7Io4IC+j819CTm0JGAGtR6Te59bVnmX1F3SFHH P3leMmfgf1CkvFtdS5GUd1nR25VSfQixln8kGUVbUM2B6BPuR4o+gbfnp8ic02OEQZol kk8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4gqhLZj1+wBW8JW+iJql4fBSQrvV0eGzbqAXRWPAfV0=; b=QeOtabJbzp3oR+DxU+ccLvqJH7JwZD1BzIw+CTR9NvxkxaPjjIolQFOSfpV68iQM6k GwbDk26itSmQOgh4OfrsIRQWQl3yBT7EhpKTUsKzgGzdWkaPhvbPNlhv8HNlxAugcZI9 cjvCo29u69reWphNUGPKaG2YcLWPfQGm9tvmo9DQ7Stib6ntlTmr0MwqgFOq1ZmmvSQT RC12/4XL/1hzQEQ7cYJdFpTQCgCAti40eQPQQIaN8fK8Cs/RwZLlwkHecKCjyAzAunQj XiB53+EQkNzq/TVGxgzVJnqPArR6No8WUKe+sL6yoBHZjEIMzqBqbdhJi4F6EZ2DJUSK NCpg== X-Gm-Message-State: AKaTC00MIzKr3F7C/DW0YhHUI66e09n2FmXrFCvwHQmK9CMU9x0kaRAWRDBGksbXuxNQVxQn X-Received: by 10.28.69.17 with SMTP id s17mr7492618wma.141.1480076549763; Fri, 25 Nov 2016 04:22:29 -0800 (PST) Received: from tom.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id u17sm13143895wma.24.2016.11.25.04.22.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Nov 2016 04:22:29 -0800 (PST) From: Robin Jarry To: Ferruh Yigit Cc: dev@dpdk.org Date: Fri, 25 Nov 2016 13:22:17 +0100 Message-Id: <1480076537-16630-1-git-send-email-robin.jarry@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1480073634-14079-1-git-send-email-robin.jarry@6wind.com> References: <1480073634-14079-1-git-send-email-robin.jarry@6wind.com> Subject: [dpdk-dev] [PATCH v3] kni: avoid using lsb_release script 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: Fri, 25 Nov 2016 12:22:31 -0000 The lsb_release script is part of an optional package which is not always installed. On the other hand, /etc/lsb-release is always present even on minimal Ubuntu installations. root@ubuntu1604:~# dpkg -S /etc/lsb-release base-files: /etc/lsb-release Read the file if present and use the variables defined in it. Signed-off-by: Robin Jarry --- lib/librte_eal/linuxapp/kni/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/linuxapp/kni/Makefile b/lib/librte_eal/linuxapp/kni/Makefile index 4e99e07e7aec..1e4756123d0c 100644 --- a/lib/librte_eal/linuxapp/kni/Makefile +++ b/lib/librte_eal/linuxapp/kni/Makefile @@ -44,8 +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 lsb_release -si 2>/dev/null),Ubuntu) -MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(shell lsb_release -sr | tr -d .) +-include /etc/lsb-release + +ifeq ($(DISTRIB_ID),Ubuntu) +MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(subst .,,$(DISTRIB_RELEASE)) UBUNTU_KERNEL_CODE := $(shell echo `grep UTS_RELEASE $(RTE_KERNELDIR)/include/generated/utsrelease.h \ | cut -d '"' -f2 | cut -d- -f1,2 | tr .- ,`,1) MODULE_CFLAGS += -D"UBUNTU_KERNEL_CODE=UBUNTU_KERNEL_VERSION($(UBUNTU_KERNEL_CODE))" -- 2.1.4