Linux 内核构建 : Perform "make localmodconfig" non-interactive way

标签 linux build linux-kernel embedded-linux kernel-module

我想以非交互方式运行“make localmodconfig”。在尝试中

yes " " | make localmodconfig

给出以下错误:

Console input/output is redirected. Run 'make oldconfig' to update configuration.

make[1]: *** [scripts/kconfig/Makefile:45: localmodconfig] Error 1
make: *** [Makefile:547: localmodconfig] Error 2

我更喜欢 localmodconfig 而不是 olddefconfig,因为较旧的内核有 3000 多个模块并且只使用了其中的 30 个。关于如何实现这一点有什么想法吗?

最佳答案

在你的内核源目录中有一些旧的.config,你可以这样做:

$ make olddefconfig
$ make localmodconfig
  • 第一个命令将使用旧的 .config 并将对所有新选项回答默认值,使 .config 适用于您的新内核
  • 第二个命令将在 .config 中禁用当前未加载到您机器上的所有模块(使用 lsmod 输出)
  • 由于第一个命令已经使 .config 对您的新内核有效,第二个命令不会询问您有关新选项的任何问题,因此您可以避免使用 yes 工具.

关于Linux 内核构建 : Perform "make localmodconfig" non-interactive way,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47049230/

相关文章:

linux - 无法再安装 Perlapi?

build - 如何在 Jenkins 中查看完整的构建队列

scala - Gradle 错误 : Project with path '' could not be found in root project ''

networking - ebpf:在 lo 接口(interface)上的套接字过滤程序中丢弃 ICMP 数据包

c - Linux内核中嵌入锁的动态分配/释放结构

linux - 对包含域名的输入文件执行质量扫描

html - 外壳脚本 : Send html formatted email while inside an array

Linux input.h(我将在 .NET 中链接到什么库)

linux - 如何在禁用 SMP 支持的情况下运行 "invd"指令?

drupal - 使用 Maven 设置 Drupal PHP 项目