Linux 内核编译 —— make localmodconfig 简化内核配置流程
来源:互联网 发布:怎么打开mac的airplay 编辑:程序博客网 时间:2024/06/03 20:29
http://blog.163.com/vic_kk/blog/static/4947052420108132423450/
简介: Most people uses the kernel shipped by distros - and that's good. But some people like to compile their own kernels from kernel.org, or maybe they like following the Linux development and want to try it. Configuring your own kernel, however, has become a very difficult and tedious task - there're too many options, and some times userspace software will stop working if you don't enable some key option. You can use a standard distro .config file, but it takes too much time to compile all the options it enables. To make the process of configuration easier, a new build target has been added: make localmodconfig. It runs "lsmod" to find all the modules loaded on the current running system. It will read all the Makefiles to map which CONFIG enables a module. It will read the Kconfig files to find the dependencies and selects that may be needed to support a CONFIG. Finally, it reads the .config file and removes any module "=m" that is not needed to enable the currently loaded modules. With this tool, you can strip a distro .config of all the unuseful drivers that are not needed in our machine, and it will take much less time to build the kernel. There's an additional "make localyesconfig" target, in case you don't want to use modules and/or initrds. 以上内容摘自:Kernel Newbies。 这样做确实方便了很多,但是也有个缺点:该方法仅能使编译出的内核支持当前内核已经加载的模块。 这样,内核的编译可以分成如下几个步骤来进行:
前些天才知道, Linux 2.6.32 开始引入了一个 make localmodconfig 用于简化 kernel 的配置。
刚刚找了一下这个方面的资料,分享一下。
大概意思是说, make localmodconfig 会执行 lsmod 命令查看当前系统中加载了哪些模块 (Modules), 并最后将原来的 .config 中不需要的模块去掉,仅保留前面 lsmod 出来的这些模块,从而简化了内核的配置过程。
因为该方法使用的是 lsmod 的结果,如果有的模块当前没有加载,那么就不会编到新的内核中。
例如,我有的时候需要制作 squashfs , 因此在当前的内核中,将 squashfs 编译成了模块。 当使用 make localmodconfig 来配置 Kernel 的时候,如果当前系统中没有加载这个模块, 那么新编出来的内核中就不会将 squashfs 编译成模块,在新的内核中就没办法使用这个模块了。
所以建议在使用 make localmodconfig 之前,首先折腾一下系统,插个优盘,开开摄像头之类, 以便让内核加载上平时使用时候所需要的模块;执行 make localmodconfig 之后,再执行一下 make menuconfig 来手动检查一下, 是否还有其他模块需要手动选择。
OK, that's all.
http://www.kernel.org, 不必多言。 下载之后解压到自己的目录,例如 /usr/src/linux-2.6.35/ , 后文中将以 $SRC 代表这个目录。
可以从自己的 Linux 发行版中拷贝一个出来,拷贝到为 $SRC/中, 并重命名为.config 。
- Linux 内核编译 —— make localmodconfig 简化内核配置流程
- Linux 内核编译 —— make localmodconfig 简化内核配置流程
- Linux 内核编译 —— make localmodconfig 简化内核配置流程
- linux 内核编译配置内核make menuconfig 出错解决方法
- 精简Linux内核的一种方式--localmodconfig
- 精简Linux内核的一种方式--localmodconfig
- Linux内核配置与编译流程
- 编译LINUX 内核流程
- Linux内核编译流程
- Linux内核编译流程
- 内核配置与编译-make config /make
- linux、内核源码、内核编译与配置、内核模块开发、内核启动流程
- linux、内核源码、内核编译与配置、内核模块开发、内核启动流程
- linux、内核源码、内核编译与配置、内核模块开发、内核启动流程
- Linux内核配置(make menuconfig)
- linux 内核配置 make menuconfig
- 内核编译——make mrproper
- 用make-kpkg简化Ubuntu系统的内核编译过程
- 使用FormsAuthentication进行身份验证的优缺点
- MYSQL重装时需要旧密码解决方法
- 百度Hadoop分布式系统揭秘:4000节点集群
- SQL Server 2005 创建到 Oracle10g 的链接服务器
- C中“##”符号的用法
- Linux 内核编译 —— make localmodconfig 简化内核配置流程
- 作业论文1 --- 对目前拍拍网的一些建议
- pipelined 函数
- Error creating bean with name 'userService' defined in class path resource [beans.xml]: Unsatisfied dependency expressed through
- 2010最危险的编程错误
- SendDTMF
- 通用线程:POSIX 线程详解------------作者——Daniel Robbins
- 序列化Serializable(asp.net C#)
- 软件架构师应该知道的97件事