0

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

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985

1 Answers1

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.

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985