递归禁用 Linux 内核构建上的 CONFIG 依赖项

发布于 2024-11-17 05:06:24 字数 907 浏览 2 评论 0原文

配置 Linux 内核时,我通常从发行版的内核配置文件开始。我经常想关闭一些条目,但它们有时是不可更改的,因为依赖于它的其他 CONFIG 选项已启用。

我可以手动查找依赖项,这些依赖项通常有自己的依赖项。完成所有这些可能会非常耗时,特别是当您尝试关闭诸如 CONFIG_KALLSYMS 之类的东西时。

问题:有没有办法指定您想要消失的 CONFIG 选项,并让所有依赖项根据需要自动选择/取消选择?我查看了所有 make 选项和脚本目录,没有看到任何可用的内容。

更新:有人回答说 make oldconfig 应该在从 .config 文件中删除(删除)所需的 CONFIG 选项后完成这项工作,但这不起作用(他的回答然后消失):

$ make oldconfig
scripts/kconfig/conf -o arch/x86/Kconfig
*
* Restart config...
*
*
* Configure standard kernel features (for small systems)
*
Configure standard kernel features (for small systems) (EMBEDDED) [N/y/?] n
  Load all symbols for debugging/ksymoops (KALLSYMS) [Y/?] (NEW) y
    Include all symbols in kallsyms (KALLSYMS_ALL) [Y/?] (NEW) y
    Do an extra kallsyms pass (KALLSYMS_EXTRA_PASS) [N/y/?] (NEW) 

它会自动说“y”两个前两个,我正在尝试找到一种自动方法来删除它们并让它们消失。

When configuring a Linux kernel, I normally start with my distribution's kernel config file. I often want to turn off some entries, but they are sometimes unchangeable because other CONFIG options that depend on it are enabled.

I can look up the dependencies manually, which often have dependencies of their own. It can be pretty time consuming to did through them all, especially if you're trying to turn off something like CONFIG_KALLSYMS.

Question: Is there a way to specify a CONFIG option you want gone, and have all dependencies automatically selected/disselected as nessisary for you? I looked through all the make options and in the scripts directory, and didn't see anything available for this.

UPDATE: Someone answered saying make oldconfig should do the job after removing (deleting) the desired CONFIG options from the .config file, but that didn't work (his answer then disappeared):

$ make oldconfig
scripts/kconfig/conf -o arch/x86/Kconfig
*
* Restart config...
*
*
* Configure standard kernel features (for small systems)
*
Configure standard kernel features (for small systems) (EMBEDDED) [N/y/?] n
  Load all symbols for debugging/ksymoops (KALLSYMS) [Y/?] (NEW) y
    Include all symbols in kallsyms (KALLSYMS_ALL) [Y/?] (NEW) y
    Do an extra kallsyms pass (KALLSYMS_EXTRA_PASS) [N/y/?] (NEW) 

It automatically said "y" two the first two, and I'm trying to find an automated way to remove them and keep them gone.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无所的.畏惧 2024-11-24 05:06:24

对于任何可能偶然发现这一点的人,Kconfiglib 现在位于 https://github.com/ulfalizer/Kconfiglib 并已针对撰写本文时的最新 Kconfig 版本进行了完善和更新 (Linux 3.7.0-rc8)。安装也得到了极大的简化。

更新:

Kconfiglib 现已针对 Linux v4.0-rc3 进行了更新,并且测试套件以痴迷模式通过。添加了一个新的 option allnoconfig_y 选项(用于在 make allnoconfig 期间将某些符号保留为 y),但它却被拒绝了。

很抱歉让 Kconfiglib bitrot 了一段时间! :/

请随意发布您可能遇到的任何与 Kconfig 相关的问题(不一定与 Kconfiglib 相关),并顺便将它们链接到此处(或以其他方式通知我)。 Kconfig 有很多不起眼的角落。

For anyone that might stumble upon this, Kconfiglib now lives at https://github.com/ulfalizer/Kconfiglib and has been polished and updated for the latest Kconfig version as of writing (Linux 3.7.0-rc8). The installation has also been greatly simplified.

Update:

Kconfiglib has been updated for Linux v4.0-rc3 now, and the test suite passes in obsessive mode. A new option allnoconfig_y option (for leaving certain symbols as y during make allnoconfig) was added that it barfed on.

Sorry for letting Kconfiglib bitrot for a while! :/

Feel free to post any Kconfig-related questions (not necessarily related to Kconfiglib) you might have and link them here by the way (or notify me in some other way). Kconfig has a lot of obscure corners.

遗弃M 2024-11-24 05:06:24

看起来 Ulf Magnusson 的 Kconfiglib 可以让你了解 Python 中的配置依赖项并修改配置设置: http:// lwn.net/Articles/426013——除此之外,我发现了对该问题的讨论,但没有解决方案。

Kconfiglib 的一些有用项目:

It looks like Kconfiglib, by Ulf Magnusson, will let you grok the configuration dependencies in Python and modify configurations settings: http://lwn.net/Articles/426013 -- beyond that, I've found discussion of the issue but no resolution.

Some helpful items for Kconfiglib:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文