如何在 Buildroot 中配置 Linux 内核?
我正在尝试为 x86 目标构建 rootfs,这非常简单。但是我不知道如何配置 buildroot 生成的内核。第一次运行时出现了 menuconfig,但从那时起它就缓存了 .config,我看不到在哪里更改它。
~650MB 的内核模块对嵌入式目标没有什么好处:P
有没有一种简单的方法可以在 buildroot 中配置内核?像 uclibc-menuconfig
目标这样的东西将是完美的。
I'm trying to build a rootfs for an x86 target, which is all simple enough. However I can't figure out how I configure the kernel that buildroot produces. The first run through came up with menuconfig, but it's cached the .config since then and I can't see where to change it.
~650MB of kernel modules don't do good things to an embedded target :P
Is there an easy way to configure the kernel within buildroot? Something like the uclibc-menuconfig
target would be perfect.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES
向现有配置添加额外配置。
例如,如果您使用
buildroot
作为子模块,目录树如下所示:例如,要打开
CONFIG_DEBUG_FS
,执行:然后配置 buildroot:
这样您就可以 git仅跟踪 qemu_x86_64_defconfig 和您的额外配置之间的差异。
我相信这使用
scripts/kconfig/merge_config.sh
形成内核,如所述:如何以非交互方式打开 Linux 内核 .config 文件中的功能?执行:
配置片段,只需记住在下一次构建之前
最小可运行示例位于: https://github .com/cirosantilli/linux-kernel-module-cheat/blob/bb8f4eb79565c9771356c80e0964c8fefc163e11/kernel-config-frag
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE
选择完整的
.config< /代码> 使用。
由于某种原因,我必须对内核的
.config
进行核攻击才能使其生效? 为什么何时我更改 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE 并运行 make linux-reconfigure 内核 .config 没有更改?BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES
Adds extra configs to your existing one.
E.g., if you are using
buildroot
as a submodule, the directory tree looks like:E.g. to turn on
CONFIG_DEBUG_FS
, do:and then configure buildroot with:
This way you can git track just a diff between
qemu_x86_64_defconfig
and your extra configs.I believe this uses
scripts/kconfig/merge_config.sh
form the kernel as mentioned at: How do you non-interactively turn on features in a Linux kernel .config file?After you change the config fragment, just remember to do:
before the next build.
Minimal runnable example at: https://github.com/cirosantilli/linux-kernel-module-cheat/blob/bb8f4eb79565c9771356c80e0964c8fefc163e11/kernel-config-frag
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE
Selects the full
.config
to be used.For some reason I have to nuke the kernel's
.config
for this to take effect? Why when I change BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE and run make linux-reconfigure the kernel .config does not change?答案是:
And the answer is:
步骤如下:
cd buildroot/
make menuconfig
内核-> Linux 内核 ->内核版本
The steps are as follows:
cd buildroot/
make menuconfig
Kernel -> Linux Kernel -> Kernel version
我总是执行以下操作:
make linux-menuconfig
output/build/linux-XYZ/.config
其中XYZ 是您的内核版本。output/build/linux-*XYZ*/.config
复制到board/your_kernel_config/.config
board/your_kernel_config/.config
I always do the following:
make linux-menuconfig
output/build/linux-XYZ/.config
where XYZ is your kernel version.output/build/linux-*XYZ*/.config
toboard/your_kernel_config/.config
board/your_kernel_config/.config
不要忘记在 menuconfig 中将 defconfig 也设置为 i386:
Do not forget to set also defconfig to i386 in menuconfig: