免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 877 | 回复: 0
打印 上一主题 下一主题

编译内核树流程 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-02-03 23:28 |只看该作者 |倒序浏览
1、下载内核文件如:linux-2.6.20.tar.gz   ftp://ftp.kernel.org/pub/linux/kernel/   拷贝到/usr/src目录并解压缩。
#   cd   /usr/src
#   tar   zvxf   linux-2.6.20.tar.gz
2、进入解压目录。(/usr/src/linux-2.6.20.tar.gz,视文件名而定)
ln   –s   linux-2.6.20   linux,因为在ipvs-1.24中的makefile文件中默认指定Kernel   Source的路径为:KERNELSOURCE   =   /usr/src/linux   
#   cd   /usr/src/linux-2.6.20.tar.gz
#   make   mrproper
#   make   xconfig
#   make   menuconfig(如果需要   Virtual   Server   Configuration,则需要执行此项)执行make   menuconfig时,我们将进入一个图形化的界面,在其中可以对Linux   Kernel进行详细设置。与LVS相关的kernel选项都在“Networking   options”中,进入“Networking   options”,可以查看到“IP:   Virtual   Server   Configuration”选项,将其它所有的子选项都选上。
3、进行选译,自己设定个性化的内核。完后点“save   and   exit”
4、进行编译。
#   make   dep
#   make   clean
#   make   bzImage   (I要大写哟)
5、编译模块。
#   make   modules
#   make   modules_install
#   depmod   -a
6、编译完成,开始替换文件。
#   cd   /boot
#   rm   System.map
#   rm   vmlinuz
#   mv   /usr/src/linux-2.6.20/System.map   System.map
#   mv   /usr/src/linux-2.6.20/arch/i386/boot/bzImage   vmlinux
7.修改开机设定。
GRUB是   /boot/grub/grub.conf文件
lilo是/etc/lilo.conf文件
可以用命令
#   mkinitrd   /boot/initrd-2.6.20.img   2.6.20来生成initrd文件。如果用命令,则会自动生成System.map   vmlinux   还会修改grub.conf文件,最后之后检查一下,看是否正确。
用GRUB来举例子说。(红色部分)


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/46723/showart_1811643.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP