1

I want to modify the configurations of the kernel to add/remove some features to my linux kernel which i need in my board.

I am following the steps described here :

  1. I build the kernel for SAMA5D27_SOM1_EK1 board :

    make ARCH=arm sama5_defconfig

  2. I run the menuconfig in order to make modifications and save my changes before exit :

    make ARCH=arm menuconfig

  3. I set up the cross compile toolchain and build the linux kernel image :

    make ARCH=arm

I have get this successfuly :

Kernel: arch/arm/boot/Image is ready

Kernel: arch/arm/boot/zImage is ready
  1. finally I build the device tree binary :

    make ARCH=arm dtbs

I can find now the kernel image under arch/arm/boot/ directory.

But, my modifications did not take place!

I want to know if I am missing some thing ?

Where can I find the old default kernel .config file ?

After setting some modifications from the menuconfig, what should I do to make changes appear in my kernel ?

Where can I find the new .config file after modifications ?

How can I know that my modifications did take place successfully ?

Thank you.

gaston
  • 51
  • 14

1 Answers1

1

Once you save changes and exit from menuconfig view, two configuration files should be present at the kernel source tree.

You can use scripts/diffconfig from the Linux kernel source tree to list removed/modified or added lines to the new configuration. Simply run :

scripts/diffconfig .config.old .config | less

You can also check the configuration of the running linux kernel using

cat /proc/config.gz | gunzip > kernel.config

or

zcat /proc/config.gz > kernel.config

That requires a specific configuration which can be found in

General setup
 [*] Kernel .config support
 [*] Enable access to .config through /proc/config.gz
ogs
  • 1,139
  • 8
  • 19
  • 42
  • Thanks for your clarifications, but you did not answer me some questions about how to build the kernel after saving and closing the menuconfig in order that modifications take place in the new kernel. After saving and closing menuconfig I find the new config file in the same directory where I found `sama5_defconfig` ? After that I run `make ARCH=arm my_new_config_file_name` ? And finaly `make ARCH=arm` ? – gaston May 20 '20 at 22:10
  • 1
    @gaston, I also recommend to read this (https://stackoverflow.com/q/27899104/2511795) to understand the difference between *.config* and *defconfig* files. – 0andriy May 21 '20 at 11:32
  • I think that menuconfig only created a defconfig file but you need to tell Yocto that you want to use it. I did this in two ways; either make a bbappend to your kernel recipe(should be linux-poky by default) and add KERNEL_DEFCONFIG = "${WORKDIR}/my_defconfig". Or only add the config fragments by creating a x.cfg file and adding it to the kernel recipe. You can read it in the Yocto manual. – Ilya S May 31 '20 at 12:09
  • Or `KBUILD_DEFCONFIG` instead of `KERNEL_DEFCONFIG` if your recipes inherit from kernel-yocto class. You can also define a specific task to copy the config under `${S}/arch/${ARCH}/configs/` – ogs Jun 02 '20 at 08:47