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 B14D1A0495 for ; Mon, 10 Jun 2019 10:25:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 24AB71BF92; Mon, 10 Jun 2019 10:25:58 +0200 (CEST) Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by dpdk.org (Postfix) with ESMTP id 4BEC01BF8C for ; Mon, 10 Jun 2019 10:25:57 +0200 (CEST) Received: by mail-lf1-f66.google.com with SMTP id 136so5987082lfa.8 for ; Mon, 10 Jun 2019 01:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nfware-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=yZ/COJLrGC0D9Axl/Nc0PpIokJv4I6764bhco/MX5ak=; b=Ygtx4jFF4u5j/IUQrM7JyI3Xg4Jg1qJeBVZo9QMSaiexcwBFR4DQJ5wkHJQa5CHf8+ tFFtYWGrZXP4sUgeVp9QCB+tyv+7AmONjpRSTkOtuM+MOLYxqlUa2t5prp3B/S04s41u IC4e7aVbcETQVfWz1fLxLG6vVvAPON8sFuMsVVafeFscEXZ9JOa/KTKlhJl7MmAOkguo KNziYliYEu7kVEjmQrc2K5IcridF9QP8JrRqRllIgkmHt3qTZyf0hAqMDGy9Flg/Cpg5 PulaOFEe120YUK30adAkwoVn2zlBfs/ilKVR4OGBVF0HKoJOjo7lgTBqKciv14SeEg9q sKOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=yZ/COJLrGC0D9Axl/Nc0PpIokJv4I6764bhco/MX5ak=; b=FT98h5HI8lRhnwq+xBduWu4xH+qFCKleWH8pEIHxDmkNqKH66J8ZFSGu6ltLytED2G mv34jjyg3snRB0WiasO84gkLOEK58qSnxMJFgbjkd0qNU7dtMQAuPiFoxMXdRwNgBMdK TsSr9MLUNit2AtqjOyFXpjDExrtAjfwqomtEJiBJqHpUjonXbgr1rOyYSlkDrzyN9kBm Ay7TMYD8jsNNSdYM7frxIGHRSSUtjftn/2cbOVKbT1ogAFZ/Xt8yF99hUnHGGZ4Kx/Ai y4ZZgzsldzBrVen0jtDM1z701WxdskJoDgnD/22auVqn70gPDtHrai2BJ5Oihd7JKcoT /KfQ== X-Gm-Message-State: APjAAAV6h56gMxl7Un5lNGl0DsqE/CPfzYqnyPBS+tgWCfQGv0wsxYDZ IYjuGTGkqFolMyi8ZEtYGWsaUenSZ9E= X-Google-Smtp-Source: APXvYqyIP6MWRN12Kki6WehVVkjiwGCT07lBzhaapAE6cmaoIb7VxZZ2KAP22IC0WRkbjEJaR0gQoA== X-Received: by 2002:ac2:47fa:: with SMTP id b26mr20484312lfp.82.1560155156429; Mon, 10 Jun 2019 01:25:56 -0700 (PDT) Received: from localhost.localdomain ([212.48.63.198]) by smtp.gmail.com with ESMTPSA id h18sm1870332lfc.40.2019.06.10.01.25.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 01:25:55 -0700 (PDT) From: Igor Ryzhov To: dev@dpdk.org Date: Mon, 10 Jun 2019 11:25:52 +0300 Message-Id: <20190610082552.79083-1-iryzhov@nfware.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] kernel/linux: fix modules install path 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" Currently kernel modules are installed into /usr/src/ instead of /lib/modules when meson build system is used. This patch fixes that. Old build option "kernel_dir" is changed to "kernel_version". Signed-off-by: Igor Ryzhov --- kernel/linux/igb_uio/meson.build | 2 +- kernel/linux/kni/meson.build | 2 +- kernel/linux/meson.build | 16 +++++++++------- meson_options.txt | 4 ++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/kernel/linux/igb_uio/meson.build b/kernel/linux/igb_uio/meson.build index f5a9d5ccf..5093610e3 100644 --- a/kernel/linux/igb_uio/meson.build +++ b/kernel/linux/igb_uio/meson.build @@ -16,5 +16,5 @@ custom_target('igb_uio', 'modules'], depends: mkfile, install: true, - install_dir: kernel_dir + '/../extra/dpdk', + install_dir: kernel_install_dir + '/extra/dpdk', build_by_default: get_option('enable_kmods')) diff --git a/kernel/linux/kni/meson.build b/kernel/linux/kni/meson.build index a9f48b0e6..8a902d2ed 100644 --- a/kernel/linux/kni/meson.build +++ b/kernel/linux/kni/meson.build @@ -25,5 +25,5 @@ custom_target('rte_kni', depends: kni_mkfile, console: true, install: true, - install_dir: kernel_dir + '/../extra/dpdk', + install_dir: kernel_install_dir + '/extra/dpdk', build_by_default: get_option('enable_kmods')) diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build index a37c95752..5a9303b33 100644 --- a/kernel/linux/meson.build +++ b/kernel/linux/meson.build @@ -3,19 +3,21 @@ subdirs = ['igb_uio', 'kni'] -# if we are cross-compiling we need kernel_dir specified -if get_option('kernel_dir') == '' and meson.is_cross_build() - warning('Need "kernel_dir" option for kmod compilation when cross-compiling') +# if we are cross-compiling we need kernel_version specified +if get_option('kernel_version') == '' and meson.is_cross_build() + warning('Need "kernel_version" option for kmod compilation when cross-compiling') subdir_done() endif -kernel_dir = get_option('kernel_dir') -if kernel_dir == '' - # use default path for native builds +kernel_version = get_option('kernel_version') +if kernel_version == '' + # use default version for native builds kernel_version = run_command('uname', '-r').stdout().strip() - kernel_dir = '/lib/modules/' + kernel_version + '/build' endif +kernel_dir = '/lib/modules/' + kernel_version + '/build' +kernel_install_dir = '/lib/modules/' + kernel_version + # test running make in kernel directory, using "make kernelversion" make_returncode = run_command('make', '-sC', kernel_dir, 'kernelversion').returncode() diff --git a/meson_options.txt b/meson_options.txt index 16d9f92c6..5ca50d8dc 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -14,8 +14,8 @@ option('ibverbs_link', type: 'combo', choices : ['shared', 'dlopen'], value: 'sh description: 'Linkage method (shared/dlopen) for Mellanox PMDs with ibverbs dependencies.') option('include_subdir_arch', type: 'string', value: '', description: 'subdirectory where to install arch-dependent headers') -option('kernel_dir', type: 'string', value: '', - description: 'path to the kernel for building kernel modules, they will be installed in $DEST_DIR/$kernel_dir/../extra/dpdk') +option('kernel_version', type: 'string', value: '', + description: 'kernel version for building kernel modules') option('lib_musdk_dir', type: 'string', value: '', description: 'path to the MUSDK library installation directory') option('machine', type: 'string', value: 'native', -- 2.21.0