Jul 26

目次linux内核编译详解方法手艺文档系统治理l艺文

Posted by liuxu at 14:41 | 电脑教程 | 评论(0) | 阅读(23) | 转自 本站原创 | |
目次  内核  号令  版本  链接  文件  系统  子目  需求  源代码  装置  适宜  符号  满意  状况  条件  名字  装备  真实  平安  映像  次序  初始化  软体  地主  磁盘  恰当  局部  源码  模块  选项  手工  效果器  平常  资本  准确  结构  方法  新感受
linuxNei∴He∴Bian∴Yi∴Xiang∴Jie∴Fang∴Fa∴Shou∴Yi∴Wen∴Dang∴Xi∴Tong∴Zhi∴Li∴l

编译装置新内核的条件  
您能够从http://www.kernel.org/下载最新版本的内核!获得新内核的以后将其搬移到/usr/src目次下!并且需求确保满意以下条件  
Gnu C至少该当是2.91.66或者以上版本!可经过施行"gcc --version"号令检查
Gnu make至少该当是3.77或者以上版本!可经过施行" make --version"号令检查
binutils至少该当是2.9.1.0.25或者以上版本!可经过施行" ld -V"号令检查
util-linux 至少该当是2.10o或者以上版本!可经过施行" fdformat --version"号令检查
modutils至少该当是2.4.0或者以上版本!可经过施行"insmod -V"号令检查  
e2fsprogs至少该当是1.19或者以上版本!可经过施行"tune2fs --version"号令检查
pcmcia-cs至少该当是3.1.21或者以上版本!可经过施行"cardmgr -V"号令检查
PPP至少该当是.4.0或者以上版本!可经过施行"pppd --version"号令检查
isdn4k-utils至少该当是3.1beta7或者以上版本!可经过施行"isdnctrl 2gt。1|grep version"号令检查
若发觉任何壹个软体是低于请求的版本!就需求到
http://www.freshmeat.net
下载新版本停止装置!一般状况下若以后系统是2.2.x!则除modutils以外都能够满意需求  
正在编译新内核之前起首增除/usr/src/linux这个符号链接!然后再解压源代码!并创立新的linux符号链接指向新的内核源码目次  
rm /usr/src/linux  tar xzpvf linux-2.4.3.tar.gz  mv linux linux-2.4.3  ln -s/usr/src/linux-2.4.3 linux  
确保"/usr/include/asm"!"/usr/include/linux"和"/usr/include/scsi"等子目次是指向内
核源代码的链接子目次asm!linux和scsi都是链向源代码目次下的真实的!该盘算机系统结构所需求的真实的include子目次如asm指
向"/usr/src/linux/include/asm-i386"等若没有这些链接!就需求手工创立!依照下面的方法停止
rootdeep cd /usr/include/ rootdeep rm -rf asm linux scsi
rootdeep ln -s /usr/src/linux/include/asm-i386 asm rootdeep ln
-s /usr/src/linux/include/linux linux rootdeep ln -s
/usr/src/linux/include/scsi scsi 这是建设拾分主要的壹局部增除掉落
"/usr/include"下的asm!linux和scsi目次后!再创立新的链接指向新内核源代码目次下的同名的目次这些头文件目次包含着包管内
核正在系统上准确编译所需求的主要的头文件 下壹步就需求编译内核  make dep clean modules
modules_install bzImage
拷贝新内核文件"/usr/src/linux/arch/i386/boot/bzImage"到发动目次!并改成适宜的名字 rootdeep cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.4.3 拷贝"/usr/src/linux/System.map"到发动目次下!并设定适宜的名字 rootdeep cp /usr/src/linux/System.map /boot/System.map-2.4.3 进进发动目次下!将目次下的链接文件"vmlinuz"及"System.map"指向新的内核 rootdeep cd /boot rootdeep ln -fs vmlinuz-kernel.version.number vmlinuz rootdeep ln -fs System.map-kernel.2.4.3 必须将链接文件vmlinuz及System.map指向新内核的相干文件!因为假设没有新的链接!LILO次序递次将缺省地主动使用老内核 增除发动目次下无用过期的文件 rootdeep rm -f module-info rootdeep rm -f initrd-2.2.12-20.img  
"module-info"链接指向系统的陈内核的模块目次因为平常装置了新内核!我们就无需保持这个文件文件"initrd-2.2.12-
2"包含正在能够使用磁盘之前初始化系统所需的RAM盘映像这个文件只要正在系统有scsi装备的状况下才会正在装置系统时天生因为这里天生编译的是壹个单
块的新内核所以即使系统有scsi装备!这里依然能够平安的增除该文件
最后!编纂"/etc/lilo.conf"参与新内核作为指导选项 第壹步 编纂文件"lilo.conf "文件对"image=/boot/"壹行做恰当的改正 rootdeep vi /etc/lilo.conf
例 boot=/dev/sda map=/boot/map install=/boot/boot.b
prompt timeout=00 restricted password=somepasswd
image=/boot/vmlinuz-2.4.3 label=linux root=/dev/sda6 read-only 第贰步更新对lilo.conf作的改正 rootdeep
/sbin/lilo -v LILO version 21! Copyright 1992-1998 Werner Almesberger
Reading boot sector from /dev/sda Merging with /boot/boot.b Boot image:
/boot/vmlinuz-2.4.3 Added linux  /boot/boot.0800 exits no backup copy
made. Writing boot sector.  
然后从头启效果器就可以够享用2.4.x内核的新感受  
资本链接  
Kernel.org  
Linux software/tools at Freshmeat  
Compiling the Linux kernel  
Other articles by Amit Chattopadhyay  
-------------------------------------------------- --------------------------------------- 编译装置新内核的条件您能够从http://www.kernel.org/下载最新版本的内核!获得新内核的以后将其搬移到/usr
刘旭 ' blog  http://www.liuxu.info
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]