一、下载 linux 内核源代码
1.0 www.kernel.com 下载源代码
2.0 将下载的源程序解压到 /usr/src 内
二、下载工具
2.0 下载 build-essential:apt-get install build-essential
2.1 下载 libqt3-header:apt-get install libqt3-header
2.2 下载 gcc:apt-get install gcc
备注:如果不下载,后面的 make xconfig 将提示:没有规则可以创建
三、配置并编译
进入 /usr/src 目录,以下操作都是在该目录下进行:
3.0 make xconfig 配置 linux 内核信息,如果需要在嵌入式中装 linux 这点很重要。
详见:http://lamp.linux.gov.cn/Linux/kernel_options.html 讲解了内核配置
3.1 make clean (当源被重新编译需要执行)
3.2 make
3.3 make modules_install
3.4 cp /arch/i386/boot/bzImage /boot/vmlinuz-<version>
3.5 cp System.map /boot/System.map
3.6 mkinitramfs -o /boot/initrd.img-<version> <version>
3.7 修改 /boot/grub/grub.cfg
Reboot
四、遇到问题
4.0 ‘No rule to make target `xxx‘.’和 “没有规则可以创建目标** ”解释为:
This means that make decided it needed to build a target, but then couldn’t find any instructions in the makefile on how to do that, either explicit or implicit (including in the default rules database).
If you want that file to be built, you will need to add a rule to your makefile describing how that target can be built. Other possible sources of this problem are typos in the makefile (if that filename is wrong) or a corrupted source tree (if that file is not supposed to be built, but rather only a prerequisite).
学编译内核,推荐一个网站
http://www.linuxfromscratch.org/
嘎嘎,你好快啊
快~哈哈我有法宝
工欲善其事必先利其器
google reader推荐你~
你们服务器上的时间有问题,该调一调了
恩,是的。时间乱七八糟的