Why when I change BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE and run make linux-reconfigure the kernel .config does not change?

对着背影说爱祢 提交于 2019-12-11 16:55:54

问题


Buildroot 7d43534625ac06ae01987113e912ffaf1aec2302 post 2018.02, Ubuntu 17.10 host.

I run:

make qemu_x86_64_defconfig
printf 'BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=\"kdb\"\n' >>.config
make olddefconfig
time make BR2_JLEVEL="$(nproc)"

where kdb is a Linux kernel configuration that has CONFIG_KGDB=y.

Then as expected:

grep '^CONFIG_KGDB=y' ./output/build/linux-4.15/.config

has a match.

But then I want to try out a new kernel config, so I try:

sed -i 's/BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=kdb/BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=nokdb/'

where nokdb is a kernel config that has CONFIG_KGDB=n and then:

time make BR2_JLEVEL="$(nproc)" linux-reconfigure

However to my surprise, the kernel .config did not change, CONFIG_KGDB=y is still there.

Only if I do:

rm -f ./output/build/linux-4.15/.config
time make BR2_JLEVEL="$(nproc)" linux-reconfigure

Is there a better way to force the kernel .config to be regenerated, e.g. some other linux-* target?

I don't like this rm solution because it forces me to deal with "internal" paths inside output.

I'd expect linux-reconfigure to do that regeneration for me.

Analogous behavior if you turn BR2_TARGET_ROOTFS_INITRAMFS on and off, which affects the CONFIG_INITRAMFS_SOURCE option of the Linux kernel.

http://lists.busybox.net/pipermail/buildroot/2018-March/215817.html


回答1:


The config files are checked for timestamps, so after you do:

touch kdb
touch nokdb
printf 'BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=\"kdb\"\n' >>.config
make olddefconfig
time make BR2_JLEVEL="$(nproc)"

kdb and nokdb have the same modified date, and the kernel does not get reconfigured on the next:

sed -i 's/BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=kdb/BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=nokdb/'
time make BR2_JLEVEL="$(nproc)" linux-reconfigure

But if you touch the new config file, it works, even without using the linux-reconfigure target explicitly:

touch nokdb
time make BR2_JLEVEL="$(nproc)"

Alternatively, if you just edit the used file instead of pointing to a new one, the configuration also gets updated as expected.



来源:https://stackoverflow.com/questions/49260466/why-when-i-change-br2-linux-kernel-custom-config-file-and-run-make-linux-reconfi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!