官方的编译方式如下:
cd /usr/src/linux-2.6.32.9
make mrproper 清除环境变量,即清除配置文件
make menuconfig/oldconfig 在菜单模式下选择需要编译的内核模块
make clean 确保所有东西均保持最新状态.
make bzImage 生成内核文件
make modules 编译模块
make modules_install 安装模块
make install 安装
#mkinitrd /boot/initrd-2.6.32.9.img 2.6.32.9 根据内核版本和指定参数生成映像文件
#cp arch/x86/boot/bzImage /boot/vmlinuz-2.6.32.9
#cp /usr/src/linux-2.6.32.9/System.map /boot/System.map-2.6.32.9
vim /etc/grub.conf:
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32.9)
root (hd0,0)
kernel /vmlinuz-2.6.32.9 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.32.9.img
title CentOS (2.6.18-194.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-194.el5.img
可是却会碰到如下的问题:

解决方式:
vim .config:
CONFIG_EXT3_FS=y
CONFIG_SYSFS_DEPRECATED_V2=y
然后reboot即可!
如果需要绑定IP的,用system-config-networkUncheck Edit Devices->ethX->Use DHCP然后设置静态IP即可:
[root@ ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
IPADDR=192.168.64.9
NETMASK=255.255.255.0
GATEWAY=192.168.64.2
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
更新
如果要启用kgdb,参考下面:
- http://blogold.chinaunix.net/u3/93140/showart_2028729.html
- http://blog.csdn.net/jie12310/archive/2009/09/18/4564853.aspx
- http://wenku.baidu.com/view/4b81837001f69e314332948d.html
主要是钩上kgdb相关选项并配置grub.conf
