给子坚兄,以前的技术文档: <如何编译内核>
时间:2006-10-16 来源:wangchunyi
注:实践后的文挡,也许并不详尽,有问题自己多考虑一下.
在redhat 9.0上如何重新编译并安装内核
make mrproper
make menuconfig
在这一部分涉及几个重要模块的配置请,特别注意.一般用"make menuconfig"命令来配置内核.
输入以上命令后出现一个菜单界面,用户可以对需要的模块.下面着重讲几个重要的配置
1)文件系统
请务必要选中ext3文件系统,
File systems--->
[*] Ext3 journalling file system support
[*] Ext3 Security Labels
[*] JBD (ext3) debugging support
以上三项一定要选上,而且要内建(即标*). 这个非常重要,在配置完后一定要检查一下
make dep
make clean
make bzImage (zImage 编译不通,因为核心太大)
生成的核心在src/linux/arch/i386/boot下:
cp bzImage /boot/bzImage
make modules
make modules_install
生成的module目录在/lib/modules下,名字为2.4.20-8custom
cd /lib/modules
mkinitrd happy.img 2.4.20-8custom
cp happy.img /boot
grub.conf文件的修改
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,5)
# kernel /boot/vmlinuz-version ro root=/dev/hda6
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,5)/boot/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-8)
root (hd0,5)
kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /boot/initrd-2.4.20-8.img
title DOS
rootnoverify (hd0,0)
chainloader +1
title new kernel
root (hd0,5)
kernel /boot/bzImage ro root=LABEL=/
initrd /boot/happy.img
修改完成后,执行grub.
#grub
<quit
ok~~
reboot