2

I would like to know how to build a custom kernel defconfig (based on the standard bcmrpi defconfig as a starting point), using Buildroot's ncurses interfaces.

I currently have Kernel configuration -> Using an in-tree defconfig file selected in the Buildroot menuconfig, with bcmrpi as the Defconfig name.

I have tried making some changes to the kernel with make linux-menuconfig but when I try to compile it with make clean the changes are not built, and when I check linux-menuconfig afterwards they have been reset back to the bcmrpi settings.

I would like to be change some settings from these defaults, and then save the resulting settings into a new defconfig, similar to how Buildroot does make savedefconfig, but for the kernel. What command do I use?

Jeremiah Rose
  • 3,865
  • 4
  • 27
  • 31

2 Answers2

9

Buildroot does provide a make linux-update-defconfig as explained in the manual - But notice that you need to configure BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE first so it knows where to store the configuration file.

Alternatively you can work with a fragment file, E.G. a snippet of kconfig that gets appended to the bcmrpi_defconfig. See configs/orangepi_zero_defconfig for an example of this.

Jeremiah Rose
  • 3,865
  • 4
  • 27
  • 31
Peter Korsgaard
  • 626
  • 4
  • 3
  • Also, if `BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE` is set, `make linux-update-defconfig` must be run **before** recompiling the kernel otherwise your configuration changes will be lost – Jeremiah Rose Jun 08 '19 at 08:42
0

I worked around this by making a wrapper script make-linuxmenuconfig.sh:

#/bin/bash
make linuxmenuconfig
cp output/build/linux-XYZ/.config ../br-external/configs/kernel_config

So that my changes are saved automatically after using the configuration editor. I then added

BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="../br-external/configs/kernel_config"

To the Buildroot configuration.

You might need to change the directories to suit your project layout.

Jeremiah Rose
  • 3,865
  • 4
  • 27
  • 31
  • 1
    It's OK, but the script is not needed. Once you point `BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE`, launch `make linux-update-defconfig` and Buildroot will update your file, as per @Peter Korsgaard reply. – Luca Ceresoli Jun 06 '19 at 07:14