发表文章 返回首页
当前位置: bitsCN.com > linux > 系统管理 > 内核技术 >

Linux内核升级&补丁安装手册

时间:2007-07-11 08:00来源:中国网管联盟 作者:bitsCN整理 点击:
第一步:Linux2.4.18升级到2.4.31 首先说明下我的环境: 三台装有RedHat8(2.4.18-14)的主机。初步的任务就是升级内核到2.4.31然后再安装补丁Squashfs。 下载升级需要的源代码linux-2.4.31.tar.gz拷贝到/usr/src下
  

第二步:给2.4.31内核打补丁,重新编译内核加载新特性

网管网bitsCN_com

下载squashfs3.1-r2.tar.gz补丁文件,这个版本是针对与2.4内核的,如果你是2.6内核系统的话,需要下载对应2.6版本的。
先打补丁。将squashfs3.1-r2.tar.gz拷贝到/usr/src下

中国网管联盟www、bitsCN、com


CODE:
[root@localhost src]# tar -zxvf squashfs3.1-r2.tar.gz
[root@localhost src]# cd linux

备份我们升级内核用到的配置文件

中国网管联盟www_bitscn_com

CODE:
[root@localhost linux]# cp .config ../backup.config

进行上次编译后的清理

网管联盟www.bitsCN.com

CODE:
[root@localhost linux]# make mrproper

为了将2.4.31的内核跟打过补丁的内核区分开来或者不至引起错误,我们在makefile中添加自定义版本信息来进行区分。
[root@localhost linux]# vi Makefile
修改 54com.cn

CODE:
EXTRAVERSION =

feedom.net

CODE:
EXTRAVERSION = -cucme

保存。
下来需要给内核打补丁 网管网bitsCN.com

CODE:
[root@localhostlinux]#patch -p1 < ../squashfs3.1-r2/linux-2.4.31/squashfs3.1-patch
patching file fs/Config.in
patching file fs/Makefile
patching file fs/squashfs/inode.c
patching file fs/squashfs/Makefile
patching file fs/squashfs/squashfs2_0.c
patching file fs/squashfs/squashfs.h
patching file include/linux/fs.h
patching file include/linux/squashfs_fs.h
patching file include/linux/squashfs_fs_i.h
patching file include/linux/squashfs_fs_sb.h
patching file init/do_mounts.c
patching file lib/Config.in

然后把配置文件拷贝回来,在make menuconfig中再次进行修改。(这次的工作主要是添加squashfs文件系统) 中国网管论坛bbs.bitsCN.com

CODE:
[root@localhost linux]# cp ../backup.config ./.config

由于我们这次编译内核的意图明确,所以可以直奔主题,因为其它的选项都已经选择好了。 中国网管联盟www.bitscn.com

CODE:
[root@localhost linux]#make menuconfig

网管联盟www.bitsCN.com

顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
最新评论 查看所有评论
发表评论 查看所有评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 密码: 验证码:
发布者资料
admin 查看详细资料 发送留言 加为好友 用户等级:注册会员 注册时间:2008-05-08 23:05 最后登录:2009-01-05 20:01
推荐内容