redhat5.0下安装linux-2.6.28内核步骤

本文详细介绍了如何使用Linux-2.6.28源码包进行内核安装、配置、编译、构建和安装过程,包括解压、设置配置、编译内核、构建模块、创建引导文件等步骤,并最终将自定义内核添加至GRUB启动菜单。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、解压文件linux-2.6.28.tar.bz2,解压之后的文件中还少个.config的文件,所以要将usr/src/kernels下的系统原有的.config移动过来;

2、make distclean;

3、make  menuconfig;

3 、make bzImage;(i为大写)

这步执行完毕后记录最后的ready路径,我的为:"arch/x86/boot/bzImage"

4、make modules;

5、make modules_install;

6、进入/lib/modules目录下;

7、mkinitrd  initrd-2.6.28   2.6.28;(此步骤在/lib/modules目录下),执行完毕后,当前文件夹下多了一个文件initrd-2.6.28 ,

8、将文件initrd-2.6.28 移动到boot下:mv  initrd-2.6.28  /boot;

9、将第三步中的bzImage文件移动到/boot下并更名为:vmlinuz-2.6.28;

10、修改文件:vi  /boot/grub/grub.conf;源文件如下:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-164.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-164.el5.img

其中最后四行为当前的系统内核,现在添加内核2.2.68,添加后如下:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-164.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-164.el5.img
title Red Hat Enterprise Linux Server (2.6.28)
        root (hd0,0)
        kernel /vmlinuz-2.6.28 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.28

只是将最后四行复制了一遍,然后修改一下内核名称就可以了。title后面为在系统启动时显示的内核名称;

11、reboot重启系统,在系统刚开启的时候有两个内核供选择(很快,只闪一下),选择刚新安装的2.6.68就可以。

到此,安装完毕!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值