Linux kernel configuration

Source: Internet
Author: User

1 development environment

Host: Ubuntu16.04

Development Board: Mini2440

Kernel version: 2.6.34.7

2 Download and Unzip

Download linux-2.6.34.7.tar.bz2 and Unzip:

TAR-AXVF linux-2.6.34.7.tar.bz2
3 Default configuration

Enter the kernel source top directory to execute:

Make Defconfig
The output is as follows:

[email protected]:~/mini2440/kernels/linux-2.6.34.7$ make Defconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/ Basic/docproc HOSTCC scripts/basic/hash hostcc scripts/kconfig/conf.oscripts/kconfig/conf.c:in function ' conf_sym ': s      Cripts/kconfig/conf.c:159:6: warning:variable ' type ' set but not used [-wunused-but-set-variable] int type; ^scripts/kconfig/conf.c:in function ' Conf_choice ': scripts/kconfig/conf.c:231:6: warning:variable ' type ' set but not      used [-wunused-but-set-variable] int type; ^scripts/kconfig/conf.c:307:9: warning:ignoring return value of ' fgets ', declared with attribute Warn_unused_result [-wu         Nused-result] Fgets (line, N, stdin); ^scripts/kconfig/conf.c:in function ' Conf_askvalue ': scripts/kconfig/conf.c:105:8: warning:ignoring return value of '        Fgets ', declared with attribute Warn_unused_result [-wunused-result] fgets (line, N, stdin); ^ HOSTCC SCRIPTS/KCONFIG/KXGETTEXT.O SHIPPED scripts/kconfig/zconf.tab.c SHIPPEDSCRIPTS/KCONFIG/LEX.ZCONF.C SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/k config/conf*** Default configuration is based on ' I386_defconfig ' # # Configuration written to. config#

According to the last 4 lines of the above output information, the kernel is configured for the x86 schema by default, and the . configis generated according to I386_defconfig (the source does not have this file, is only created when configured). Find i386_deconfigwith the Find command:


Use vim to open the . config and i386_defconfig, respectively, to find that their contents are basically the same, and compare them by using the diff Command:


by visible,. config is not exactly the same as I386_defconfig , makedefconfig is not simply arch/x86/configs/i386_ Defconfig Copy to . config.

3.1 Default Schema

The above default configuration is for x86 architecture , then how to start the ARM architecture default configuration? The answer is to specify the value of the ARCH variable for the top-level Makefile , specifying cross-compile toolchain prefix :

ARCH        = armcross_compile   ? = arm-linux-
Then execute Make defconfig, the target is ARM ArchitectureThe

[email protected]:~/mini2440/kernels/linux-2.6.34.7$ make Defconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/ Basic/docproc HOSTCC scripts/basic/hash hostcc scripts/kconfig/conf.oscripts/kconfig/conf.c:in function ' conf_sym ': s      Cripts/kconfig/conf.c:159:6: warning:variable ' type ' set but not used [-wunused-but-set-variable] int type; ^scripts/kconfig/conf.c:in function ' Conf_choice ': scripts/kconfig/conf.c:231:6: warning:variable ' type ' set but not      used [-wunused-but-set-variable] int type; ^scripts/kconfig/conf.c:307:9: warning:ignoring return value of ' fgets ', declared with attribute Warn_unused_result [-wu         Nused-result] Fgets (line, N, stdin); ^scripts/kconfig/conf.c:in function ' Conf_askvalue ': scripts/kconfig/conf.c:105:8: warning:ignoring return value of '        Fgets ', declared with attribute Warn_unused_result [-wunused-result] fgets (line, N, stdin); ^ HOSTCC SCRIPTS/KCONFIG/KXGETTEXT.O SHIPPED scripts/kconfig/zconf.tab.c SHIPPEDSCRIPTS/KCONFIG/LEX.ZCONF.C SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/k config/conf*** Default configuration is based on ' Versatile_defconfig ' # # Configuration written to. config#

The above information shows that the default configuration is generated according to versatile_defconfig . config, using Find lookup versatile_defconfig

Use diff to compare versatile_defconfig with . config:


By visible,versatile_defconfig and . config are still not exactly the same.

3.2 configuration file. config

From the above, the configuration information is mainly stored in the . config file of the kernel source top directory, and the first part of the . config of thearm architecture is as follows:

# # automatically generated make Config:don ' t edit# Linux kernel version:2.6.34.7# Tue may 11:30:25 2016#CONFIG_ARM=YC onfig_sys_supports_apm_emulation=yconfig_generic_time=yconfig_generic_clockevents=yconfig_have_proc_cpu= yconfig_generic_hardirqs=yconfig_stacktrace_support=yconfig_have_latencytop_support=yconfig_lockdep_support= Yconfig_trace_irqflags_support=yconfig_hardirqs_sw_resend=yconfig_generic_irq_probe=yconfig_rwsem_generic_ Spinlock=yconfig_generic_hweight=yconfig_generic_calibrate_delay=yconfig_need_dma_map_state=yconfig_generic_ hardirqs_no__do_irq=yconfig_vectors_base=0xffff0000config_defconfig_list= "/lib/modules/$UNAME _release/.config" Config_constructors=y

According to the above information in line 2nd, the contents of the. config file are generated automatically by Make config (in fact, I386_defconfig is also the 2nd line), do not manually modify.

Line 6th specifies that the arm schema is used, and all the remaining configuration items are prefixed with config_ .

3.3 Other default configuration files

According to reference [1], in the kernel source Arch directory has Alpha,x86,arm and other subdirectories, respectively, corresponding to the corresponding architecture:


The arm directory contains boot,common,configs,include , and the supported arm chip subdirectories for the kernel:


The configs directory contains the default profiles for each arm chip (including the 3.1-bar versatile_defconfig):


According to reference [1], to use the configuration files for these platforms, you can only copy them to the top-level directory and rename them to . config:

CD LINUX-2.6.34.7CP arch/arm/configs/mini2440_defconfig. config

4 Interactive Configuration

Enter the kernel source top directory to execute:

Make Config
The output is as follows:

[email protected]:~/mini2440/kernels/linux-2.6.34.7$ make config HOSTCC scripts/basic/fixdep HOSTCC scripts/ Basic/docproc HOSTCC scripts/basic/hash hostcc scripts/kconfig/conf.oscripts/kconfig/conf.c:in function ' conf_sym ': s      Cripts/kconfig/conf.c:159:6: warning:variable ' type ' set but not used [-wunused-but-set-variable] int type; ^scripts/kconfig/conf.c:in function ' Conf_choice ': scripts/kconfig/conf.c:231:6: warning:variable ' type ' set but not      used [-wunused-but-set-variable] int type; ^scripts/kconfig/conf.c:307:9: warning:ignoring return value of ' fgets ', declared with attribute Warn_unused_result [-wu         Nused-result] Fgets (line, N, stdin); ^scripts/kconfig/conf.c:in function ' Conf_askvalue ': scripts/kconfig/conf.c:105:8: warning:ignoring return value of '        Fgets ', declared with attribute Warn_unused_result [-wunused-result] fgets (line, N, stdin); ^ HOSTCC SCRIPTS/KCONFIG/KXGETTEXT.O SHIPPED scripts/kconfig/zconf.tab.c SHIPPED SCRIPTS/KCONFIG/LEX.ZCONF.C SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD Scripts/kcon fig/confscripts/kconfig/conf arch/x86/kconfig## using defaults found in/boot/config-3.16.0-30-generic#/boot/ Config-3.16.0-30-generic:1264:warning:symbol value ' m ' Invalid for net_dsa/boot/config-3.16.0-30-generic:1680: Warning:symbol value ' m ' Invalid for Mtd_cmdline_parts/boot/config-3.16.0-30-generic:2418:warning:symbol value ' m ' Invalid for Net_dsa_mv88e6xxx/boot/config-3.16.0-30-generic:2419:warning:symbol value ' m ' Invalid for Net_dsa_ Mv88e6060/boot/config-3.16.0-30-generic:2421:warning:symbol value ' m ' Invalid for net_dsa_mv88e6131/boot/ Config-3.16.0-30-generic:2422:warning:symbol value ' m ' Invalid for net_dsa_mv88e6123_61_65/boot/ Config-3.16.0-30-generic:2861:warning:symbol value ' m ' Invalid for iwl4965/boot/config-3.16.0-30-generic:3783: Warning:symbol value ' m ' Invalid for Gpio_ucb1400/boot/config-3.16.0-30-generic:4259:warning:symbol value ' m ' invalID for Regulator_88pm8607/boot/config-3.16.0-30-generic:4318:warning:symbol value ' m ' Invalid for regulator_twl4030/ Boot/config-3.16.0-30-generic:5396:warning:symbol value ' m ' Invalid for snd_hda_codec_realtek/boot/ Config-3.16.0-30-generic:5397:warning:symbol value ' m ' Invalid for snd_hda_codec_analog/boot/ Config-3.16.0-30-generic:5398:warning:symbol value ' m ' Invalid for snd_hda_codec_sigmatel/boot/ Config-3.16.0-30-generic:5399:warning:symbol value ' m ' Invalid for snd_hda_codec_via/boot/config-3.16.0-30-generic : 5402:warning:symbol value ' m ' Invalid for Snd_hda_codec_cirrus/boot/config-3.16.0-30-generic:5403:warning:symbol Value ' m ' Invalid for Snd_hda_codec_conexant/boot/config-3.16.0-30-generic:5404:warning:symbol value ' m ' Invalid for Snd_hda_codec_ca0110/boot/config-3.16.0-30-generic:5407:warning:symbol value ' m ' Invalid for snd_hda_codec_cmedia/ Boot/config-3.16.0-30-generic:5408:warning:symbol value ' m ' Invalid for snd_hda_codec_si3054/boot/ config-3.16.0-30-generic:5409:Warning:symbol value ' m ' Invalid for Snd_hda_generic/boot/config-3.16.0-30-generic:7288:warning:symbol value ' m ' Invalid for Nfs_v3/boot/config-3.16.0-30-generic:7290:warning:symbol value ' m ' Invalid for nfs_v4** Linux Kernel Configu ration*** General setup*prompt for development and/or incomplete code/drivers (experimental) [n/y/?] (NEW)
As indicated in the last 1 lines above, the user is required to confirm whether Prompt for development and/or incomplete code/drivers (experimental), so it is InteractiveConfiguration, users need to know the kernel very much, the operation is more cumbersome.

5 Menu Configuration

Make Menuconfig

6 emptying the configuration

To remove the above configuration values, do the following:

Make Mrproper

Note: MakeDistcean cannot replace the above command!

Resources

[1] cross-compiling Linux kernel for ARM

Linux kernel configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.