From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F1C95A050A; Tue, 12 Apr 2022 15:15:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 980E240DF6; Tue, 12 Apr 2022 15:15:02 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 93E7E4014F for ; Tue, 12 Apr 2022 15:15:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649769301; x=1681305301; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=sE0aeMSePZdMgNmxfoYZ+HeHdPObp8N2j12oVEukRcA=; b=dOVqQALWjdHmwbQ7J0xHFSzVfccv1nH0xZzuiHdjNWibj0dzD2kzPPBF FZs3T6qe6udcAKN6a1VObiAp9ssZxXGM4m9EE9IXEipVzLt1HNSitHDeu DVfKrq5bQv8G9ZA/JP7Qbl6M/GcYRAhhSqSJid+RZdJkoaVlJX5YN7K73 HOTA5olQI1YbWDjwAB/lCznGq5vVGkN9Mb6yUkfQBmdeIh+qqWFduw6TB ebqib+NHV4b8xfWSzFmHfvXzEtoBpm3QoRtqIF1BfbmoUg7xE2McLHsjF h8/Q8Q3ZvdaQ3ZpP4WbcjG+cVCjeZ+EdaJJ+lCI/8tfa32VVejF6GKMC9 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10314"; a="261809102" X-IronPort-AV: E=Sophos;i="5.90,253,1643702400"; d="scan'208";a="261809102" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2022 06:15:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,253,1643702400"; d="scan'208";a="572760228" Received: from silpixa00401385.ir.intel.com (HELO silpixa00401385.ger.corp.intel.com.) ([10.237.222.67]) by orsmga008.jf.intel.com with ESMTP; 12 Apr 2022 06:14:59 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [kmods PATCH] linux/igb_uio: allow modules install Date: Tue, 12 Apr 2022 14:14:53 +0100 Message-Id: <20220412131453.3927-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org For those still using the "igb_uio" kernel module, there may be occasions where the module is installed in /lib/modules/$VERSION folder rather than being insmod'ed from the build directory. To support this, a number of changes are needed to the makefile: * Change the "clean" command to a generic wildcard target where that target is just passed through to the top-level kernel makefile. This should allow all standard kernel module targets, including "clean" and "modules_install" to work. * To install in /lib/modules, root permissions are needed, so it is likely that users may try installing the module using "sudo". However, under sudo there is often no $PWD environment variable, breaking the build. This can be fixed by changing the environment variable $PWD to the make built-in variable "CURDIR"[1]. * As a cleanup, the actual kernel module path is got directly by make from the shell, rather than relying on the shell substitution later when making the recursive make call. This improves things slightly for the user as the full recursive command is visible, with the kernel version appearing in place of `uname -r` in the output. [1] While neither PWD nor CURDIR will work correctly in the case where one is building outside of the sources directory, this is an edge case, and a simple replacement of PWD by CURDIR keeps things simple while adding support for "sudo". Signed-off-by: Bruce Richardson --- linux/igb_uio/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/linux/igb_uio/Makefile b/linux/igb_uio/Makefile index 09ae5d9..bd2e356 100644 --- a/linux/igb_uio/Makefile +++ b/linux/igb_uio/Makefile @@ -1,7 +1,7 @@ -KSRC ?= /lib/modules/`uname -r`/build +KSRC ?= /lib/modules/$(shell uname -r)/build all: - make -C $(KSRC)/ M=$(PWD) + make -C $(KSRC)/ M=$(CURDIR) -clean: - make -C $(KSRC)/ M=$(PWD) clean +%: + make -C $(KSRC)/ M=$(CURDIR) $@ -- 2.32.0