免费注册 查看新帖 |

Chinaunix

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

原创:Red Hat 9.0 Kernel Compiling [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-01-11 06:43 |只看该作者 |倒序浏览
Before you compile, strongly suggest you read the README under your source_code_root and modules.txt under source_code_root/Documentation.

Here, I only give the sample for GRUB, if you are using LILO, please read the files I mentioned above.

1.        Get the kernel version
bash # rpm –q kernel
2.        Download appropriate kernel source on RHN
3.        Install kernel source
4.        If you are recompiling, you’d better to run:
bash # make mrproper
to clean all configurations
5.        Configure kernel
In xWindows, start terminal
bash # cd /usr/src/linux2.4.20.8
bash # make xconfig

if you are using remote terminal, run:
bash # make menuconfig

Must be Enabled
File System ->; Ext3
Block Device ->; Loopback Device Support

Backup config in kernel source root to another file if you want to recompile
bash # cp config myconfig
6.        Compile Kernel
bash # make install
7.        Compile and install modules
bash # make modules
bash # make modules_install
8.        Copy new kernel bzImage to /boot/bzImage.myker
9.        Change grub.conf
bash # cat 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/hdb6
#          initrd /initrd-version.img
#boot=/dev/hdb
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-
        root (hd0,0)
        kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi
        initrd /initrd-2.4.20-8.img
change the line:        kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi
to:        kernel /bzImage.myker ro root=LABEL=/ hdc=ide-scsi

Because not sure the new kernel works well, suggest you keep two files, one is grub.conf.orig, another is grub.conf.new
grub.conf.orig:
# 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/hdb6
#          initrd /initrd-version.img
#boot=/dev/hdb
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-
        root (hd0,0)
        kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi
        initrd /initrd-2.4.20-8.img

grub.conf.new
# 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/hdb6
#          initrd /initrd-version.img
#boot=/dev/hdb
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-
        root (hd0,0)
        kernel /bzImage.myker ro root=LABEL=/ hdc=ide-scsi
        initrd /initrd-2.4.20-8.img

regarding to your needs, you just copy the proper file to grub.con
10.        reboot the system
bash # reboot

论坛徽章:
0
2 [报告]
发表于 2004-01-11 07:05 |只看该作者

原创:Red Hat 9.0 Kernel Compiling

已收藏

论坛徽章:
0
3 [报告]
发表于 2004-01-11 10:41 |只看该作者

原创:Red Hat 9.0 Kernel Compiling

不错

论坛徽章:
0
4 [报告]
发表于 2004-01-11 10:50 |只看该作者

原创:Red Hat 9.0 Kernel Compiling

6错误 ...
make install改为make zImage或者make bzImage

另外 ,这里System.map不用更新?
很基础的教程,如果给新手看,建议10用 make install代替 ...

论坛徽章:
0
5 [报告]
发表于 2004-01-11 13:06 |只看该作者

原创:Red Hat 9.0 Kernel Compiling

6 is OK, make bzImage and make install are alternative. and I used make install.

Please reply after you make sure u r right.

论坛徽章:
0
6 [报告]
发表于 2004-01-11 13:08 |只看该作者

原创:Red Hat 9.0 Kernel Compiling

那么您使用的2.6的内核吗?
如果您使用的2.4的,那么您在使用make install之后不用作任何事情,直接重新起动就可以了...
您也可以测试一下...

论坛徽章:
0
7 [报告]
发表于 2004-01-11 13:13 |只看该作者

原创:Red Hat 9.0 Kernel Compiling

如果您原意纠正一下我的错误,请看一看 ...谢谢...
http://bbs.chinaunix.net/forum/viewtopic.php?t=208791

论坛徽章:
0
8 [报告]
发表于 2004-01-12 23:03 |只看该作者

原创:Red Hat 9.0 Kernel Compiling

very good, If I found yours, I wouldn't post mine.

Thx for sharing

论坛徽章:
0
9 [报告]
发表于 2004-01-14 22:14 |只看该作者

原创:Red Hat 9.0 Kernel Compiling

After make install, you have to run
make modules
make modules_install

otherwise, when you reboot your computer, maybe you have errors. Because the kernel requires the modules ready at that time.

论坛徽章:
0
10 [报告]
发表于 2004-01-15 08:36 |只看该作者

原创:Red Hat 9.0 Kernel Compiling

2.4的内核难道不用
cd  /lib/modules ;mkinitrd /boot/initrd-version  2.4.*?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP