当前系统为CentOS 1、查看当前系统内核 # uname -r 2 2.6.32-358.el6.i686 2、下载linux-3.4.56内核包 # cd ~ # wget -c https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.4.56.tar.xz # tar -Jxvf linux-3.4.56.tar.xz # mv linux-3.4.56 /usr/src/linux-3.4.56 # cd linux-3.4.56 3、配置内核并安装 # make mrproper #清除环境变量,即清除配置文件 # make menuconfig #在菜单模式下选择需要编译的内核模块 # make clean #确保所有东西均保持最新状态. # make bzImage #生成内核文件 # make modules #编译模块 # make modules_install #安装模块 # make install #安装
4、编辑 # cat /etc/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/mapper/VolGroup-lv_root # initrd /initrd-[generic-]version.img #boot=/dev/sda default=1 timeout=3 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (3.4.56) 5、重启系统,并查看内核 # reboot # uname -r 3.4.56(责任编辑:IT) |