Linux kernel configuration .config file

Want to modify the kernel configuration based on the existing .config file

------->make menuconfig ARCH= arm64 (bring ARCH means using the .config file in the current directory)

 

Linux kernel configuration .config file

 

In the command line, enter the top-level kernel directory and enter the command make menuconfig to start a menu-based kernel configuration editor. From here, you can access every available configuration parameter and generate a customized kernel configuration.

When you exit the configuration editor, it will prompt you whether to save the changes. If you choose to save the changes, the global configuration file .config will be updated (if it does not exist, it will be created).

The top Makefile will use this .config file to build the kernel.

Most kernel software modules also indirectly read the configuration content through the .config file. The principle is as follows:

During the build process, the build system will process this .config file and generate a C language header file named autoconf.h, which is placed in the directory.../include/linux . This file is automatically generated. Try not to modify this file directly, because when the configuration changes and a new build starts, your changes will be lost. Many kernel source files directly use the preprocessing directive #include to include this file.

The kernel build file includes this autocongf.h file in each kernel compilation command line, specifically using the -include option of the compilation command gcc, as shown below:

gcc … –include include/linux/autoconf.h … <somefile.c>

Each kernel module accesses the kernel configuration in this way.

Guess you like

Origin blog.csdn.net/u014426028/article/details/109585377