Linux内核编译,模块尺寸变大的解决办法
来源:互联网 发布:淘宝打开商品w异常 编辑:程序博客网 时间:2024/06/05 21:59
现象:
最近在研究Linux的裁剪定制,编译内核的时候发现编译后同样的模块比以前内核版本的大好多,比如下面这个例子:
[root@CentOS5 ~]# find /lib/modules/ -name ext3.ko
/lib/modules/3.8.8-chensh3.0/kernel/fs/ext3/ext3.ko
/lib/modules/2.6.18-308.el5/kernel/fs/ext3/ext3.ko
[root@CentOS5 ~]# ll -h /lib/modules/3.8.8-chensh3.0/kernel/fs/ext3/ext3.ko
-rw-r--r-- 1 root root 3.7M 09-08 07:33 /lib/modules/3.8.8-chensh3.0/kernel/fs/ext3/ext3.ko
[root@CentOS5 ~]# ll -h /lib/modules/2.6.18-308.el5/kernel/fs/ext3/ext3.ko
-rwxr--r-- 1 root root 226K 2012-02-22 /lib/modules/2.6.18-308.el5/kernel/fs/ext3/ext3.ko
[root@CentOS5 ~]#
问题分析和解决办法:
The default kernel configuration is configured to support as many hardware as possible. A non-stripped kernel with default configuration resulted in a size of 1897996 kB (including kernel + modules). When stripping many unnecessary drivers and options, it resulted in a size of 892892 kB which is a size reduction of 53% compared to the stock kernel.
When installing the kernel modules, append the INSTALL_MOD_STRIP=1 option. This will strip all debugging symbols and reduced the size by 92% for me (from 892892 kB to 69356 kB). Note this will only affects modules to be installed and not the kernel (vmlinuz) itself.
Use the INSTALL_MOD_STRIP option for removing debugging symbols:
# make INSTALL_MOD_STRIP=1 modules_install
Similarly, for building the deb packages:
# make INSTALL_MOD_STRIP=1 deb-pkg
- Linux内核编译,模块尺寸变大的解决办法
- linux内核模块的编译
- Linux内核模块:模块的编译
- linux内核模块编译
- linux内核模块编译
- Linux内核模块编译
- Linux内核模块编译
- Linux 内核 模块 编译
- linux内核模块编译
- linux内核模块编译
- Linux内核模块编译
- Linux内核模块编译
- linux内核模块编译
- linux内核模块编译
- Linux编译内核模块
- Linux 编译内核模块的Makefile
- Linux内核模块的编译基础知识
- 单独编译linux内核模块的命令
- 根据按钮切换表单
- 什么是 MIME TYPE?
- POJ-1308 Is It A Tree?
- JAVA array,map 转 json 字符串
- 实例讲解黑客如何执行SQL注入攻击
- Linux内核编译,模块尺寸变大的解决办法
- iOS-延迟操作方法总结
- spring之整合websocket
- android.support.design
- git submodule 初始更新
- 第十二章内存管理
- GridControlToExcel
- MFC ActiveX 控件:添加自定义事件
- iOS支付宝接口调用总结