From patchwork Mon Jun 4 06:33:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yixin Zhang X-Patchwork-Id: 924825 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40zlW45fMPz9rxs for ; Mon, 4 Jun 2018 16:33:18 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 7EADC3E62DE for ; Mon, 4 Jun 2018 08:33:15 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [IPv6:2001:4b78:1:20::7]) by picard.linux.it (Postfix) with ESMTP id 751683E62C2 for ; Mon, 4 Jun 2018 08:33:13 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id A09BF2002DE for ; Mon, 4 Jun 2018 08:33:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jun 2018 23:33:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,475,1520924400"; d="scan'208";a="45046283" Received: from yixin-desktop.sh.intel.com ([10.239.161.27]) by fmsmga008.fm.intel.com with ESMTP; 03 Jun 2018 23:33:06 -0700 From: Yixin Zhang To: ltp@lists.linux.it Date: Mon, 4 Jun 2018 14:33:06 +0800 Message-Id: <20180604063306.24325-1-yixin.zhang@intel.com> X-Mailer: git-send-email 2.14.1 X-Virus-Scanned: clamav-milter 0.99.2 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-7.smtp.seeweb.it Cc: Yixin Zhang Subject: [LTP] [PATCH ltp] m4/ltp-kernel_devel.m4: get LINUX_VERSION from LINUX_DIR during configure X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" If LINUX_DIR is given, get LINUX_VERSION for kernel source code instead of `uname -r`. So when we need to build .ko with a kernel differernt than the one on current host PC, we only need to provide "--with-linux-dir", and LINUX_VERSION will be generated automatically. Signed-off-by: Yixin Zhang --- m4/ltp-kernel_devel.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/m4/ltp-kernel_devel.m4 b/m4/ltp-kernel_devel.m4 index 1c4e71f73..477a34aa9 100644 --- a/m4/ltp-kernel_devel.m4 +++ b/m4/ltp-kernel_devel.m4 @@ -47,6 +47,7 @@ AC_ARG_WITH([linux-dir], AC_SUBST(LINUX_DIR) if test -f "$LINUX_DIR/Makefile"; then + LINUX_VERSION=`make -C ${LINUX_DIR} -s kernelversion` LINUX_VERSION_MAJOR=`make -C ${LINUX_DIR} -s kernelversion | cut -d. -f1` LINUX_VERSION_PATCH=`make -C ${LINUX_DIR} -s kernelversion | cut -d. -f2` fi