Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

yocto bitbake config file location

Where can I find the .config file used to build the kernel?

I use:

$ bitbake virtual/kernel -c menuconfig to open the menuconfig

I just ran the menuconfig and I have a big problem : there are no activated option. The .config file (?) looks deleted or broken

I have two directory :

  • An old configuration of yocto with an up to date kernel config.
  • A new configuration (I work on it) with a broken kernel config.

I have to get the old configuration file and paste it to the broken configuration.

Thanks in advance.

like image 865
rBeal Avatar asked Mar 06 '23 08:03

rBeal


1 Answers

Yocto finds kernel configuration in different ways,

  1. defconfig inside Linux Kernel: You can specify KBUILD_DEFCONFIG variable in your recipe to use the defconfig which is already present in the source tree.
  2. You can add your defconfig in SRC_URI of your linux kernel recipe or in .bbappend to your kernel recipe (may be in different layer).

If you modify the kernel configuration file using menuconfig as bitbake virtual/kernel -c menuconfig, then bitbake switches does,

  1. Find the default provider as in the variable PREFERRED_PROVIDER_virtual/kernel
  2. switches to tmp/work/<MACHINE_NAME>-<DISTRO_NAME>-linux-gnuenabi/<PREFERRED_PROVIDER_virtual/kernel>/<KERNEL_VERSION>/linux-*build/ and run make menuconfig with according cross compiler prefix

If you are lucky and you haven't accidentally saved (twice) of menuconfig output, then you find your saved config as .config.old in the above path. Usually you will find two/three .config files,

  1. .config : Current active configurations
  2. .config.old : previous active configuration
  3. .config.orig : Actual configuration from SRC_URI's defconfig or in kernel defconfig options itself

Note: Kernel is extracted as source (during do_unpack) in tmp/work-shared/<MACHINE>/kernel-source/ and linked to tmp/work/<MACHINE_NAME>-<DISTRO_NAME>-linux-gnuenabi/<PREFERRED_PROVIDER_virtual/kernel>/<KERNEL_VERSION>/git.

like image 115
Parthiban Avatar answered Mar 12 '23 02:03

Parthiban