简体   繁体   English

如何创建一致的.config文件来编译Linux内核?

[英]How to create a consistent .config file to compile Linux kernel?

To compile Linux kernel, I created a default .config file using make defconfig . 为了编译Linux内核,我使用make defconfig创建了一个默认的.config文件。 Since I didn't want to browse thousands of options through a menu-driven interface ( make menuconfig ), I set CONFIG_KALLSYMS=n manually, and then triggered the build ( make -j8 ). 因为我不想通过菜单驱动的界面( make menuconfig )浏览成千上万的选项,所以我手动设置CONFIG_KALLSYMS=n ,然后触发构建( make -j8 )。 I noticed the build system overwrote my changes and set CONFIG_KALLSYMS=y again. 我注意到构建系统覆盖了我的更改,并再次设置了CONFIG_KALLSYMS=y I suspect there might be other options present in the configuration which rely on CONFIG_KALLSYMS . 我怀疑配置中可能还有依赖CONFIG_KALLSYMS其他选项。 How can I create a consistent .config file without using any menu-driven interface? 如何在不使用任何菜单驱动界面的情况下创建一致的.config文件?

It might be burdensome to browse thousands of options through a menu-driven interface (make menuconfig) . 通过菜单驱动的界面(make menuconfig)浏览成千上万的选项可能很麻烦。 When you only want to change a couple of options and don't remember where they are in the menu hierarchy, you can use search to find any specific option. 当您只想更改几个选项并且不记得它们在菜单层次结构中的位置时,可以使用搜索找到任何特定的选项。 Just press / (slash) and type the full or partial name of the option. 只需按/ (斜杠),然后键入选项的完整或部分名称。 The result of the search will show where the options are located in the menu hierarchy, and what are the dependencies. 搜索结果将显示选项在菜单层次结构中的位置以及相关性。 Save and exit after you are done with the changes, and you should have a consistent .config file. 完成更改后保存并退出,并且您应该具有一致的.config文件。

After you create a .config using make defconfig, to change just a few config options after that "make menuconfig" is the best way to do this. 在使用make defconfig创建.config之后,只需更改几个配置选项即可,“ make menuconfig”是执行此操作的最佳方法。 It also tells you about the dependencies and doesn't allow you to make a change unless the dependencies are met. 它还会告诉您有关依赖性的信息,除非满足依赖性,否则您无法进行更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM