linux系统配置选项增加

linux系统配置选项增加
摘要由CSDN通过智能技术生成

linux系统如果想在系统配置界面make menuconfig时增加自定义配置及代码,基本步骤是:
1.找到相应增加代码路径下的Kconfig文件;
2.按需求添加配置选项;
3.找到相应路径下的Makefile文件,将自己代码的.o文件添加进去,使其可以编译到内核;
4.kernel目录下 执行 make menuconfig,找到自己添加的菜单进行选择;
步骤及每步含义如下,拿intel i210网卡驱动为例:

  1. cat ./kernel/drivers/net/ethernet/intel/Kconfig
    config e1000
    config关键字是一个新的配置选项的入口
    tristate “intel® pro/1000 gigabit ethernet support”
    三态 y n m / 如果是bool “this is a test module” 这句话显示在menuconfig菜单上,显示为[]
    depends on pci
    依赖的模块
    —help—
    this driver supports intel® pro/1000 gigabit ethernet family of
    adapters. for more information on how to identify your adapter, go
    to the adapter & driver id guide at:…
    to compile this driver as a module, choose m here. the module
    will be called e1000.
    这项配置是make menuconfig时,界面显示的配置选项

  2. 在相应目录下Makefile里边添加编译语句:与Kconfig同目录
    obj- ( C O N F I G

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

android framework

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值