From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 930CCA0096 for ; Fri, 7 Jun 2019 11:29:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 79EF81B957; Fri, 7 Jun 2019 11:29:07 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 5054F1B94E for ; Fri, 7 Jun 2019 11:29:05 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jun 2019 02:29:04 -0700 X-ExtLoop1: 1 Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.51]) by orsmga007.jf.intel.com with SMTP; 07 Jun 2019 02:29:01 -0700 Received: by (sSMTP sendmail emulation); Fri, 07 Jun 2019 10:29:01 +0100 Date: Fri, 7 Jun 2019 10:29:01 +0100 From: Bruce Richardson To: Igor Ryzhov Cc: dev@dpdk.org, Ferruh Yigit Message-ID: <20190607092900.GA1600@bricha3-MOBL.ger.corp.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Subject: Re: [dpdk-dev] Incorrect install_dir for Linux kernel modules X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jun 06, 2019 at 09:33:09PM +0300, Igor Ryzhov wrote: > Hi everyone, > > I faced an issue today with install directory for rte_kni and igb_uio. > Modules are installed to '/usr/src/...' instead of '/lib/modules/...'. > > Right now install_dir for both modules is set to: > > install_dir: kernel_dir + '/../extra/dpdk' > > where 'kernel_dir' is set manually or automatically to: > > kernel_version = run_command('uname', '-r').stdout().strip() > kernel_dir = '/lib/modules/' + kernel_version + '/build' > > > I believe the intention of using '/../extra/dpdk' was to come back to > '/lib/modules/kernel_version/' and install the modules there, but as > '/lib/modules/kernel_version/build' is a symlink, we actually get into > the '/usr/src/linux-headers-kernel-version' and install modules there. > > I see two possible solutions here: > 1. Add new 'kernel_install_dir' option. If it is not set, set it > automatically: > > kernel_version = run_command('uname', '-r').stdout().strip() > kernel_install_dir = '/lib/modules/' + kernel_version > > and set install_dir to: > install_dir: kernel_install_dir + '/extra/dpdk' > > 2. Replace 'kernel_dir' option with new option 'kernel_version', and do the > following: > > if kernel_version == '' > > kernel_version = run_command('uname', '-r').stdout().strip() > > > then set 'kernel_dir' and 'kernel_install_dir' accordingly: > > kernel_dir = '/lib/modules/' + kernel_version + '/build' > > kernel_install_dir = 'lib/modules/' + kernel_version > > and use it for building and installation: > custom_target('rte_kni', > > ... > > command: ['make', '-j4', '-C', kernel_dir, > > ... > > install_dir: kernel_install_dir + '/extra/dpdk', > > ... > > > I prefer the second one and already have a patch. > Can send the patch if maintainers are good with the solution. > Thanks for highlighting this, and I agree with option 2 as a good solution. Please send out the patch. /Bruce