linux内核的脚本化配置

mic*_*has 8 linux kernel

给定内核特性列表,我想创建一个最小的 linux 配置,支持所有给定的特性(和相应的依赖项),但没有别的。

有没有办法创建一个 allnoconfig 和一个工具来一一启用功能?

(我可以编辑.config文件,但这不会得到正确的依赖关系。我可以使用make *config,但据我所知,这些工作只能交互或创建一些默认配置。)

小智 1

从内核 2.6.29 开始,您可以在以下位置找到一个脚本
/kernel_extracted_dir/scripts/config

例如

/kernel_extracted_dir/scripts/config --set-val CONFIG_LOG_BUF_SHIFT 14
/kernel_extracted_dir/scripts/config --enable CONFIG_PRINTK_TIME
Run Code Online (Sandbox Code Playgroud)

(为了给予应有的信任,我从这个博客中获取了示例)

您有以下选项(从帮助中复制)

--enable|-e option   Enable option
--disable|-d option  Disable option
--module|-m option   Turn option into a module
--set-str option string
                     Set option to "string"
--set-val option value
                     Set option to value
--undefine|-u option Undefine option
--state|-s option    Print state of option (n,y,m,undef)

--enable-after|-E beforeopt option
                         Enable option directly after other option
--disable-after|-D beforeopt option
                         Disable option directly after other option
--module-after|-M beforeopt option
                         Turn option into module directly after other option commands can be repeated multiple times

options:
    --file config-file   .config file to change (default .config)
    --keep-case|-k       Keep next symbols' case (dont' upper-case it)
Run Code Online (Sandbox Code Playgroud)

  • 乍一看这似乎很棒。不幸的是,它似乎根本不关心依赖关系。:( (3认同)