1*4882a593Smuzhiyun// -*- mode:doc; -*- 2*4882a593Smuzhiyun// vim: set syntax=asciidoc: 3*4882a593Smuzhiyun 4*4882a593Smuzhiyun[[customize-store-buildroot-config]] 5*4882a593Smuzhiyun=== Storing the Buildroot configuration 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunThe Buildroot configuration can be stored using the command 8*4882a593Smuzhiyun +make savedefconfig+. 9*4882a593Smuzhiyun 10*4882a593SmuzhiyunThis strips the Buildroot configuration down by removing configuration 11*4882a593Smuzhiyunoptions that are at their default value. The result is stored in a file 12*4882a593Smuzhiyuncalled +defconfig+. If you want to save it in another place, change the 13*4882a593Smuzhiyun+BR2_DEFCONFIG+ option in the Buildroot configuration itself, or call 14*4882a593Smuzhiyunmake with +make savedefconfig BR2_DEFCONFIG=<path-to-defconfig>+. 15*4882a593Smuzhiyun 16*4882a593SmuzhiyunThe recommended place to store this defconfig is 17*4882a593Smuzhiyun+configs/<boardname>_defconfig+. If you follow this recommendation, the 18*4882a593Smuzhiyunconfiguration will be listed in +make help+ and can be set again by 19*4882a593Smuzhiyunrunning +make <boardname>_defconfig+. 20*4882a593Smuzhiyun 21*4882a593SmuzhiyunAlternatively, you can copy the file to any other place and rebuild with 22*4882a593Smuzhiyun+make defconfig BR2_DEFCONFIG=<path-to-defconfig-file>+. 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun[[customize-store-package-config]] 25*4882a593Smuzhiyun=== Storing the configuration of other components 26*4882a593Smuzhiyun 27*4882a593SmuzhiyunThe configuration files for BusyBox, the Linux kernel, Barebox, U-Boot 28*4882a593Smuzhiyunand uClibc should be stored as well if changed. For each of these 29*4882a593Smuzhiyuncomponents, a Buildroot configuration option exists to point to an input 30*4882a593Smuzhiyunconfiguration file, e.g. +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE+. To store 31*4882a593Smuzhiyuntheir configuration, set these configuration options to a path where you 32*4882a593Smuzhiyunwant to save the configuration files, and then use the helper targets 33*4882a593Smuzhiyundescribed below to actually store the configuration. 34*4882a593Smuzhiyun 35*4882a593SmuzhiyunAs explained in xref:customize-dir-structure[], the recommended path to 36*4882a593Smuzhiyunstore these configuration files is 37*4882a593Smuzhiyun+board/<company>/<boardname>/foo.config+. 38*4882a593Smuzhiyun 39*4882a593SmuzhiyunMake sure that you create a configuration file 'before' changing 40*4882a593Smuzhiyunthe +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE+ etc. options. Otherwise, 41*4882a593SmuzhiyunBuildroot will try to access this config file, which doesn't exist 42*4882a593Smuzhiyunyet, and will fail. You can create the configuration file by running 43*4882a593Smuzhiyun+make linux-menuconfig+ etc. 44*4882a593Smuzhiyun 45*4882a593SmuzhiyunBuildroot provides a few helper targets to make the saving of 46*4882a593Smuzhiyunconfiguration files easier. 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun* +make linux-update-defconfig+ saves the linux configuration to the 49*4882a593Smuzhiyun path specified by +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE+. It 50*4882a593Smuzhiyun simplifies the config file by removing default values. However, 51*4882a593Smuzhiyun this only works with kernels starting from 2.6.33. For earlier 52*4882a593Smuzhiyun kernels, use +make linux-update-config+. 53*4882a593Smuzhiyun* +make busybox-update-config+ saves the busybox configuration to the 54*4882a593Smuzhiyun path specified by +BR2_PACKAGE_BUSYBOX_CONFIG+. 55*4882a593Smuzhiyun* +make uclibc-update-config+ saves the uClibc configuration to the 56*4882a593Smuzhiyun path specified by +BR2_UCLIBC_CONFIG+. 57*4882a593Smuzhiyun* +make barebox-update-defconfig+ saves the barebox configuration to the 58*4882a593Smuzhiyun path specified by +BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE+. 59*4882a593Smuzhiyun* +make uboot-update-defconfig+ saves the U-Boot configuration to the 60*4882a593Smuzhiyun path specified by +BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE+. 61*4882a593Smuzhiyun* For at91bootstrap3, no helper exists so you have to copy the config 62*4882a593Smuzhiyun file manually to +BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE+. 63*4882a593Smuzhiyun 64*4882a593Smuzhiyun 65