我试图使用介子构建来构建igb_uio内核模块。我使用下面的meson.build文件来构建驱动程序。
kernel/linux/igb_gio/meson.build文件:文件
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation
mkfile = custom_target('igb_uio_makefile',
output: 'Makefile',
command: ['touch', '@OUTPUT@'])
custom_target('igb_uio',
input: ['igb_uio.c', 'Kbuild'],
output: 'igb_uio.ko',
command: ['make', '-C', kernel_dir,
'M=' + meson.current_build_dir(),
'src=' + meson.current_source_dir(),
'EXTRA_CFLAGS=-I' + meson.current_source_dir() +
'/../../../lib/librte_eal/common/include',
'modules'],
depends: mkfile,
install: true,
install_dir: kernel_dir + '/../extra/dpdk',
build_by_default: get_option('enable_kmods'))
我的构建失败了:内核/linux/igb_uio/meson.build:6:17: ERROR: lexer命令: touch,@OUTPUT@)
我尝试将文件名传递为igb_src = file (igb_uio.c‘,'Kbuild'),然后分配输入: igb_src,但没有结果。你能告诉我如何解决这个问题吗?我使用的是介子版本.49.2
发布于 2022-07-28 12:09:21
根据DPDK版本的不同,IGB_UIO内核驱动程序代码可以在DPDK源代码中出现或不存在。直到dpdk版本19.11LTS,它是源文件夹的一部分。从DPDK版本20.02及更高版本开始,文件将被删除,并需要单独构建。,但在这两种情况下,这都是自成体系的构建环境,不需要外部干预。
当前的错误kernel/linux/igb_uio/meson.build:6:17: ERROR: lexer command: [touch, @OUTPUT@])
不是DPDK构建(makefile或meson)问题的一部分,而是lexer无法找到touch
。这似乎更多的是环境和设置问题。
在普通的Linux发行版(fedora、debian、rhel、centos或ubuntu)上,touch
通常出现在/usr/bin/
中。在自定义内核或坞环境中,确保共享或更新路径以反映touch
。然后按以下方式执行
DPDK 20.02及以上:
git clone http://dpdk.org/git/dpdk-kmods
dpdk-kmods/linux/igb_uio/
make
modprobe uio
insmod igb_uio.ko
注意:无论DPDK版本如何,都可以将此方法用于内核模块。
DPDK版本19.11 LTS及更低版本:
介子建造:
meson_options.txt
文件中确保enable_kmods
的值为enable_kmods
Makefile构建:
使用make config T=[desired target] O=[output folder]
[output folder]/.config
来确保设置y
make -j
modprobe uio; insmod igb_uio.ko
https://stackoverflow.com/questions/73139094
复制相似问题