生成Linux内核.config文件会使源文件夹不干净

时间:2017-04-13 17:57:12

标签: linux linux-kernel

我目前正在尝试重建Linux内核,而且我正在尝试一些困难。

我使用make menuconfig修改了.config。

...
make[1]: Entering directory '/home/doe/build/linux'
  CHK     include/config/kernel.release
  GEN     ./Makefile
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  Using /home/doe/workspace/linux as source for kernel
  /home/doe/workspace/linux is not clean, please run 'make mrproper'
  in the '/home/doe/workspace/linux' directory.
/home/doe/workspace/linux/Makefile:1027: recipe for target 'prepare3' failed
make[1]: *** [prepare3] Error 1
...

然后我尝试运行make mrproper。它运行良好,并从我的构建文件夹中删除我的.config文件。毫不奇怪,我无法构建,因为缺少.config文件。

我做了一个make defconfig后跟一个make -j 8,只是为了尝试用一些基本的配置文件构建。

  ...
  HOSTCC  scripts/mod/file2alias.o
  HOSTLD  scripts/mod/modpost
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_64.o
  HOSTCC  arch/x86/tools/relocs_common.o
  Using /home/doe/workspace/linux as source for kernel
  /home/doe/workspace/linux is not clean, please run 'make mrproper'
  in the '/home/doe/workspace/linux' directory.
/home/doe/workspace/linux/Makefile:1027: recipe for target 'prepare3' failed
make[1]: *** [prepare3] Error 1
make[1]: *** Waiting for unfinished jobs....
  HOSTLD  arch/x86/tools/relocs
make[1]: *** wait: No child processes.  Stop.
Makefile:152: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

如果生成.config使源文件夹不清洁,我应该如何构建?

1 个答案:

答案 0 :(得分:0)

您应该检查" include/config"目录存在于您的内核源代码中。

prepare3目标会检查&{39; .config'文件和' include/config'目录。您可以通过搜索" prepare3"在Makefile中