为什么安装的linux头文件是空的?

Jef*_*eff 3 kernel software-installation 14.04

我正在运行 14.04,安装在空硬盘上。Linux 头文件已安装,但.h文件为空。我可以看到这里的文件都是零长度: /usr/src/linux-headers-3.13.0-37-generic/include/config.

头文件按以下方式安装:

> sudo apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-headers-3.13.0-37-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Run Code Online (Sandbox Code Playgroud)

我怎样才能真正安装头文件,使它们具有非零长度?

lem*_*eze 6

根据克里斯托夫的说法,刚刚遇到了这个

include/config 根本不用于头文件。这是优化内核构建的巧妙技巧的一部分。

内核配置(存储在 .config 中)用于生成在整个内核中使用的头文件。问题是更改一个选项意味着所有包含 config.h 的文件都需要重建,即使其中大多数文件可能不受该选项的影响。

这是通过删除对 config.h 的 makefile 依赖项并将其替换为对 include/config 中的文件之一的依赖项来解决的。那里的每个文件对应一个配置选项。每当该选项更改时,配置系统都会接触该文件(更新其时间戳导致 make 重建所有相关文件。