Chinaunix首页 | 论坛 | 博客
  • 博客访问: 49586
  • 博文数量: 23
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2013-12-05 15:34
个人简介

linux c++开发

文章分类

全部博文(23)

文章存档

2013年(23)

我的朋友

分类: LINUX

2013-12-05 15:40:15

原文地址:如何获取kernel 的 .config 作者:mxcai2005

如果只有一个内核映像文件,想要获取他的 .config 配置,有如下两个方法
前提是内核中选择了:
General setup  ---> 
 <*> Kernel .config support                                                 
   [*]   Enable access to .config through /proc/config.gz

─────────
────────Kernel .config support ────────────────
  │ CONFIG_IKCONFIG:                                                                      │ 
  │                                                                                       │ 
  │ This option enables the complete Linux kernel ".config" file                          │ 
  │ contents to be saved in the kernel. It provides documentation                         │ 
  │ of which kernel options are used in a running kernel or in an                         │ 
  │ on-disk kernel.  This information can be extracted from the kernel                    │ 
  │ image file with the script scripts/extract-ikconfig
and used as                       │ 
  │ input to rebuild the current kernel or to build another kernel.                       │ 
  │ It can also be extracted from a running kernel by reading                             │ 
  │ /proc/config.gz
if enabled (below). 
 


1. 运行此内核,在 /proc/config.gz 中的 config.gz 就是此内核的config了,将其copy 出来就可以了

2. 相比上一个方法,这个要方便许多,进入 内核源码目录:
# scripts/extract-ikconfig  zImage
会在终上端打印出此kenrel 的.config

阅读(1166) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~