如何编写make menuconfig脚本以自动化Linux内核构建配置?

塔拉字节

我想使Linux构建自动化,但最终到了我需要运行似乎很手动的步骤的地步:make menuconfig这似乎在OS和内核配置之间同步配置?

cp git-tracked-config .config
make defconfig 
make menuconfig # <- how to automate/script this?
make V=s

基本上,如何删除对make menuconfig构建脚本的调用

顺便说一句,这是对似乎在不调用make menuconfig的情况下运行时发生的构建错误的反应:

make[1]: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'.  Stop.

可能是因为makefile本身不存在,或者makefile尚未生成/变形以包含该规则,但这是一个单独的问题,这似乎是makefile中缺少一条规则。

可能有一种更聪明的方法来共同解决这个问题。还有其他我没有跟踪但应该跟踪的配置(例如,oldconfig)吗?

恐怖

Linux内核构建系统提供了许多构建目标,了解它的最佳方法可能是执行以下操作make help

Configuration targets:
  config      - Update current config utilising a line-oriented program
  nconfig         - Update current config utilising a ncurses menu based program
  menuconfig      - Update current config utilising a menu based program
  xconfig     - Update current config utilising a QT based front-end
  gconfig     - Update current config utilising a GTK based front-end
  oldconfig   - Update current config utilising a provided .config as base
  localmodconfig  - Update current config disabling modules not loaded
  localyesconfig  - Update current config converting local mods to core
  silentoldconfig - Same as oldconfig, but quietly, additionally update deps
  defconfig   - New config with default from ARCH supplied defconfig
  savedefconfig   - Save current config as ./defconfig (minimal config)
  allnoconfig     - New config where all options are answered with no
  allyesconfig    - New config where all options are accepted with yes
  allmodconfig    - New config selecting modules when possible
  alldefconfig    - New config with all symbols set to default
  randconfig      - New config with random answer to all options
  listnewconfig   - List new options
  olddefconfig    - Same as silentoldconfig but sets new symbols to their default value
  kvmconfig   - Enable additional options for guest kernel support
  tinyconfig      - Configure the tiniest possible kernel

正如jimmij在评论中所说,有趣的部分在oldconfig相关的目标中。

就个人而言,我建议您继续使用silentoldconfig(如果.config文件中没有任何更改,或者使用新内核olddefconfig更新了.config文件)。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章