Linux内核运行稀疏失败 - /bin/sh:1:稀疏:未找到

Ami*_*bha 2 linux-kernel

我在linux内核上运行稀疏.

但它会引发以下错误:

在linux上运行稀疏:
lovegcy @ knltest-VirtualBox:〜/ git_root/linux $ make C = 2
make [1]:对于'all'没什么可做的.
HOSTCC arch/x86/tools/relocs_32.o
HOSTCC arch/x86/tools/relocs_64.o
HOSTCC arch/x86/tools/relocs_common.o
HOSTLD arch/x86/tools/relocs
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC kernel/bounds.s
GEN include/generated/bounds.h
CC arch/x86/kernel/asm-offsets.s
GEN include/generated/asm-
offsets.h CALL scripts/checksyscalls.sh
检查脚本/ mod/empty.c
/ bin/sh:1:稀疏:未找到
make [2]:*[scripts/mod/empty.o]错误127
make [1]:
[scripts/mod]错误2
make:*
*[scripts]错误2

这是稀疏安装日志:

lovegcy @ knltest-VirtualBox:〜/ git_root/sparse $ make install
/bin/sh:1:llvm-config:not found
Makefile:79:你的系统没有llvm,禁用sparse-llvm INSTALL'sparse
' - >'/ home/lovegcy/bin/
sparse'INSTALL'cgcc' - >'/ home/lovegcy/bin/
cgcc'INSTALL'c2xml' - >'/ home/lovegcy/bin/c2xml'INSTALL'test
-inspect' - >'/家用/ lovegcy /斌/测试检查'
INSTALL 'sparse.1' - > '/home/lovegcy/share/man/man1/sparse.1'
INSTALL 'cgcc.1' - >'/家庭/ lovegcy /股/ man/man1/cgcc.1'
安装'libsparse.a' - >'/home/lovegcy/lib/libsparse.a' 安装'token.h' - >'/home/loveginc
/include/sparse/token.h'
安装'parse.h' - >'/ home/flovegcy/include/sparse/parse.h'
安装'lib.h' - >'/ home/flovegcy/include/sparse/lib.h'
安装'symbol.h' - > '/ home/lovegcy/include/pars/symbol.h'
安装'scope.h
' - >'/ home/loveginc/include/sparse/scope.h'INSTALL'expression.h ' - >'/ home/lovegcy/include/sparse/expression.h'
安装'target.h
' - >'/ home/lovegcy /include/sparse/ target.h' 安装'linearize.h' - >'/ home/lovegc y/include/sparse/linearize.h'INSTALL'bitmap.h' - >'/ home/loveginc/include/sparse/
bitmap.h'
安装'ident-list.h' - >'/ home/lovegcy/include /稀疏/ IDENT-list.h '
INSTALL 'compat.h' - > '/home/lovegcy/include/sparse/compat.h'
INSTALL 'flow.h' - >'/家/ lovegcy /包含/稀疏/流量. H '
INSTALL 'allocate.h' - > '/home/lovegcy/include/sparse/allocate.h'
INSTALL 'storage.h定义' - > '/home/lovegcy/include/sparse/storage.h'
INSTALL' ptrlist. h' - >'/ home/
lovegcy /include/sparse/ptrlist.h'
安装'dissect.h' - >'/ home/loveginc /include/sparse/dissect.h' 安装'sparse.pc' - >'/家用/ lovegcy/lib中/ pkgconfig/sparse.pc"

更多:内核已经编译完毕.

任何人都可以提供一些线索吗?

非常感谢你!

The*_*ist 5

更简单的方法:

首先,sparse从官方渠道下载并安装在主机PC上.

例如,在Ubuntu上运行,
$ sudo apt-get install sparse


从源头构建:

或者,如果您尝试sparse从其源代码构建,那么我们需要确保在运行make install命令后sparse二进制文件存在于/usr/bin/sparse.

这可以通过打开一个新终端并which sparse在其中运行命令来确认.它应该输出类似于以下内容:

$ which sparse
/usr/bin/sparse
Run Code Online (Sandbox Code Playgroud)

在同一终端中,导航到Linux内核源目录并尝试在Linux内核源上make C=2运行sparse.

注意:从您的日志中可以看到sparse正在安装的日志/home/lovegcy/bin/.请确保您添加的路径/home/lovegcy/bin/$PATH环境变量.否则系统将无法找到sparse二进制文件.

在Ubuntu(运行bash shell)上,可以通过在.bashrc文件中添加以下行来为每个新终端自动执行此操作,如下所示:

$ echo "export PATH=\$PATH:/home/lovegcy/bin/" >> ~/.bashrc
Run Code Online (Sandbox Code Playgroud)