I'm using the tar image "buildroot-2018.02.tar.gz" to generate the linux image (kernel & fs) for my embedded system. To be sure of the minimum configuration I need to recreate the project (later, on an other computer...), I work out of BR tree as defined in BR UM §8.5.

I've managed to correctly configure BR and linux kernel and I have created both configuration files : - myProc_defconfig - myProc_linux_defconfig

I'm trying to create an image for my coworkers to recreate the project easily. For now, I have the following tree :

/                                   :   Git root
/README                             :   This very file
/make_buildroot_env.sh              :   Script to set up the development environment  
/myProc_kernel/                     :   Development environment prerequisite    
/myProc_kernel/configs/             :   Contains both BR & Linux configuration files
/myProc_kernel/fs_overlay/          :   Filesystem overlay, contains all applicative files
/myProc_kernel/tools/               :   Scripts and data used by BR
/myProc_kernel/tools/data           :   All data files used by scripts

The idea is to create a script which will untar buildroot in a different folder (system is build out of tree as defined in ) and configure it with the defconfig files.

The script begins as follow, launch from my "Git root /" defined hereabove :


tar -xaf ./MyProc_kernel/tools/data/buildroot-2018.02.tar.gz
cd buildroot-2018.02
make defconfig BR2_DEFCONFIG=../myProc_kernel/configs/myProc_defconfig
make O=../MyProc_kernel

I have here two problems :

  1. I've got an error on the last call :

Makefile:862: *** Please configure Buildroot first (e.g. "make menuconfig"). Stop.

  1. If I look at the .config file created in the BR folder, it seems to have taken only few parameters from MyProc_defconfig

My questions are :

  • Why does BR always complain with the error 1 ? Configuration shall be made with the line pointing to the defconfig file ?

  • What am I missing to recreate my development environment ?

  • Your process looks sound. How did you generate you defconfig file? You're sure it's the one you made with make savedefconfig? – John Moon Apr 25 '18 at 13:35
  • I had first defined my work environment with make O=../MyProc_kernel. Then when everything was settled, I have defined the defconfig filenames with make xconfig and then make savedefconfig && make update-linux-defconfig. I have verified that a change in the configuration followed by a save, actually changes the defconfig files the right way. – grorel Apr 25 '18 at 13:41
  • Can you run your make defconfig BR2_DEFCONFIG=<path> line outside the script and have it work? You might try running that command with an absolute path to the file. – John Moon Apr 25 '18 at 13:50
  • Well, I may have mistaken the .config file comparison. This file is created in /buildroot2018.02/ and is the same as the defconfig file with extra default values. The result is the same with relative or absolute path. The next command shows the same error message – grorel Apr 25 '18 at 14:02
  • Hmm. Maybe try copying your defconfig to buildroot-2018.02/configs then try just running make MyProc_defconfig. It'd be good to see of it's a malformed defconfig or a path resolution issue. – John Moon Apr 25 '18 at 14:16

As you already found out yourself, you have to merge the 2 lines

make defconfig BR2_DEFCONFIG=../myProc_kernel/configs/myProc_defconfig
make O=../MyProc_kernel


make defconfig BR2_DEFCONFIG=../myProc_kernel/configs/myProc_defconfig O=../MyProc_kernel 

To answer the additional why qustion, "O=" creates a wrapper for the make command to use the main directory of the buildroot installation for packages and your newly created one for the config file, building and output.

The wrapper needs to be in place, that it can be used to create the defconfig. Alternatively you could swap the two lines to first create the wrapper and then use it to create the config.

Check 8.5 in the Buildroot manual

For ease of use, Buildroot generates a Makefile wrapper in the output directory - so after the first run, you no longer need to pass O=<...> and -C <...>,

| improve this answer | |

Well, I found how to do what it wanted. These two lines have to be merged :

make defconfig BR2_DEFCONFIG=../myProc_kernel/configs/myProc_defconfig
make O=../MyProc_kernel

into one line :

make defconfig BR2_DEFCONFIG=../myProc_kernel/configs/myProc_defconfig O=../MyProc_kernel

Then everything is compiled into /MyProc/ folder and nothing is done in the buildroot-2018.02 folder.

| improve this answer | |
  • I still don't understand why this is not possible to do it in 2 lines ? – grorel Apr 25 '18 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.