make menuconfig如何添加新选项

Make menuconfig后出现的界面选项

General setup

Enable loadable module supprot

Enable the block layer(/home/fyyy/mini2440/linux-2.6.32.2/block)

System Type

Bus support

Kernel features

Boot options

CPU Power management

Floating point emulation

Userspace binary formats

Power management options

Networking support(/home/fyyy/mini2440/linux-2.6.32.2/net/Kconfig)

在Networkingsuppor下增加子项可以修改linux-2.6.32.2/net/目录下的Kconfig

Device Drivers(/home/fyyy/mini2440/linux-2.6.32.2/drivers/Kconfig)

在DeviceDrivers下增加子项可以修改linux-2.6.32.2drivers/目录下的Kconfig

File systems(/home/fyyy/mini2440/linux-2.6.32.2/fs/Kconfig)

在File systems下增加子项可以修改linux-2.6.32.2/fs/目录下的Kconfig

Kernel hacking()

在Kernelhacking下增加子项可以修改linux-2.6.32.2/net/目录下的Kconfig

Security options(/home/fyyy/mini2440/linux-2.6.32.2/security/Kconfig)

在Securityoptions下增加子项可以修改linux-2.6.32.2security /目录下的Kconfig

Cryptographic API(/home/fyyy/mini2440/linux-2.6.32.2/crypto/Kconfig)

在CryptographicAPI下增加子项可以修改linux-2.6.32.2/crypto /Kconfig目录下的Kconfig

Library routines(/home/fyyy/mini2440/linux-2.6.32.2/lib/Kconfig)

在Libraryroutines(下增加子项可以修改linux-2.6.32.2/lib/目录下的Kconfig

 

Load an Alternate Configuration File//导入一个已经配置好的文件

Save an Alternate Configuration File//把当前配置保存成一个.config文件(此在源码目录下,是一个文本文件,保存的是配置的情况)(.是系统隐藏文件,要用ls –a查看)

 

 

EXP:    DeviceDrivers下增加一个新选项的方法

1.mkdir hello,在 DeviceDrivers下新建一个目录hello

 

2.进入hello目录,创建一个Kconfig文件和一个Makefile文件,另外创建一个驱动hello.c文件

# Kconfig file

#在shell脚本语言中,”#是表示注释行”

# heexconfiguration

#  

menuconfig HEEX              //没有选择项的用menuconfig来定义

       bool "HEEX Support"(此处离前一句一个TAB键的距离)//这一行为显示的内容,这行不写的话,编译进去有heex这个宏,却没有显示

       help //帮助信息,可写可不写

 

3. 在/drivers/hello/里编写Makefile文件。

obj-$(CONFIG_NEW_BUZZERS)     += hello.o(此处的.o文件名要和同目录下的

.c文件名相同)

 

 

4.返回Device Drivers,修改父目录下的Kconfig文件和Makefile文件

在Kconfig下加入source "drivers/hello/Kconfig"

在Makefile文件中加入编译路径obj-$(CONFIG_NEW_BUZZERS)   += hello/

 

5.配置,make menuconfig ,配置好menuconfig后会arch/arm/Kconfig中读取配置文件,在linux-2.6.32.2/下生成一个配置文件.config(以.开头的文件是隐藏文件,要用ls –a命令来查看才能看到),里面是各个目录的宏配置后的结果,这其中就包含config_HEEX=y

 

 

6.编译,make,在这里会包含很多头文件,根据头文件里面的内容和配置文件.config里面(y/n)来决定是否把该选项编译进内核,编译后默认在../linux-2.6.32.2/arch/arm/boot生成zIamge文件,进入该目录,在终端键入make uImage,才会在当前目录下生成uImage文件。

由于很多u-boot不能识别zImage,故需要使用mkImage工具来将zImage制作成uImage(就是在zImage前面加上u-boot能够识别的头文件,64个字节)

 

 

 

//arch/arm/kconfig里面的内容

menu "Powermanagement options"         //menu 和endmenu是成对出现的,中间表示的是可选项(当然还有choice/endchoice、if/endif、config、menuconfig等语法)

bool “powermanagement”               //能显示在图像化界面上的描述

depends   NEW_HEX                 //依赖关系

comment “test for 。。。”              //注释的内容

   help                                //帮助信息,会在我们查看help的时候显示出来

endmenu

如果要在下面这些目录下增加目录的话只需要在arch/arm/Kconfig中找到相应的菜单项(menu/endmenu间添加相应的描述就可以了)

System Type

Bus support

Kernel features

Boot options

CPU Power management

Floating point emulation

Userspace binary formats

Power management options

 

由于在arch/arm/Kconfig有source "net/Kconfig"//包含net下的Kconfig,所以在net下添加目录的时候不用去修改arch/arm/下的Kconfig了,直接修改该目录下的Kconfig即可

 

source "drivers/Kconfig"

 

source "fs/Kconfig"

 

source "arch/arm/Kconfig.debug"

 

source "security/Kconfig"

 

source "crypto/Kconfig"

 

source "lib/Kconfig"

所以要在以下目录下增加目录的话,只需修改相应目录下的Kconfig和Makefile即可

Networking support(/home/fyyy/mini2440/linux-2.6.32.2/net/Kconfig)

Device Drivers(/home/fyyy/mini2440/linux-2.6.32.2/drivers/Kconfig)

File systems(/home/fyyy/mini2440/linux-2.6.32.2/fs/Kconfig)

Kernel hacking()

 

Security options(/home/fyyy/mini2440/linux-2.6.32.2/security/Kconfig)

Cryptographic API(/home/fyyy/mini2440/linux-2.6.32.2/crypto/Kconfig)

Library routines(/home/fyyy/mini2440/linux-2.6.32.2/lib/Kconfig)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值