1.首先下载一个版本的内核(注意:此内核的版本一定要能够被你你gcc编译,不然就下载低版本的内核或者下载高版本的gcc)
2.将某个已经配置好的内核的配置文件拷贝到你的内核的主目录下面,将文件名改为.config(如红帽企业版5/boot/config-2.6.18-8.el5xen)
3.在终端将目录打开到你要编译的内核,make menuconfig,进行配置
4.配好之后make bzImage(编译内核),编译好的内核在/arch/x86/boot/bzImage
5.make modules(编译内核模块)
6.make modules_install(安装内核模块)安装之后形成的文件在/lib/modules/2.6.27.2 下面
7.制作 init ramdisk
mkinitrd init-2.6.27.2 2.6.27.2 生成init-2.6.27.2,就在主目录下面
8.将bzImage和init-2.6.27.2移到 /boot/下面,并且将bzImage 改为bzImage-2.6.27.2
9.修改/etc/grub.conf
title Red Hat Enterprise Linux Server (2.6.18-8.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-8.el5
module /vmlinuz-2.6.18-8.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
module /initrd-2.6.18-8.el5xen.img
title Cfc_Linux_2.6.28
root (hd0,0)
kernel /bzImage-2.6.28 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.28
title Cfc_Linux_2.6.27.2
root (hd0,0)
kernel /bzImage-2.6.27.2 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.27.2
2.将某个已经配置好的内核的配置文件拷贝到你的内核的主目录下面,将文件名改为.config(如红帽企业版5/boot/config-2.6.18-8.el5xen)
3.在终端将目录打开到你要编译的内核,make menuconfig,进行配置
4.配好之后make bzImage(编译内核),编译好的内核在/arch/x86/boot/bzImage
5.make modules(编译内核模块)
6.make modules_install(安装内核模块)安装之后形成的文件在/lib/modules/2.6.27.2 下面
7.制作 init ramdisk
mkinitrd init-2.6.27.2 2.6.27.2 生成init-2.6.27.2,就在主目录下面
8.将bzImage和init-2.6.27.2移到 /boot/下面,并且将bzImage 改为bzImage-2.6.27.2
9.修改/etc/grub.conf
title Red Hat Enterprise Linux Server (2.6.18-8.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-8.el5
module /vmlinuz-2.6.18-8.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
module /initrd-2.6.18-8.el5xen.img
title Cfc_Linux_2.6.28
root (hd0,0)
kernel /bzImage-2.6.28 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.28
title Cfc_Linux_2.6.27.2
root (hd0,0)
kernel /bzImage-2.6.27.2 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.27.2