how to upgrade CentOS kernel

本文提供了一套详细的步骤来指导如何从源代码编译并安装Linux内核2.6.24版本,包括下载内核源码、配置内核选项、编译内核、安装新内核及更新grub启动菜单等关键环节。

1,wget -c http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.4.tar.bz2
2, make mrproper

3, cp /boot/config* .config ; make oldconfig

 or  make defconfig [ use the sample config as the .config file (linux-2.6.24.4/arch/x86/configs/i386_defconfig)]

或者更好的使用命令make localmodconfig来产生配置

4, make dep  
5, Make kernel and install
make -j4 bzImage V=1
make -j4 modules V=1 
make modules_install V=1
6, install others
cp arch/x86/boot/bzImage       /boo/bzImage-2.6.24
   cp System.map         /boo/System.map-2.6.24 
   mkinitrd -v /boot/initrd-2.6.24.img  2.6.24.4

7, Add strings below to grub/menu.lst
title CentOS (2.6.24)
        root (hd0,0)
        kernel /bzImage-2.6.24 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.24.img

8,reboot and select your new kernel

9,有可能需要编辑initrd文件
  解压:

#  zcat initrd.gz | cpio -ivd --no-absolute-filenames
  打包:
# find . | cpio -o -H newc -F tmp_initrd2
# gzip -f9 tmp_initrd2

10, 查看帮组 

[root@Tony32 linux-2.6.39]# make help

11,配置工具比较:

Command Description
make config Text based configuration. The options are prompted one after another. All options need to be answered, and out-of-order access to former options is not possible.
make menuconfig An ncurses-based graphical menu (only text input). Navigate through the menu to modify the desired options.
make defconfig Generates a new config with default from the ARCH supplied defconfig file. Use this option to get back the default configuration file that came with the sources.
make nconfig Graphical menu based on ncurses. Requires sys-libs/ncurses to be installed.
make xconfig Graphical menu using Qt4. Requires dev-qt/qtgui to be installed.
make gconfig Graphical menu using GTK+. Requires x11-libs/gtk+dev-libs/glib, and gnome-base/libglade to be installed.
make oldconfig Review changes between kernel versions and update to create a new .config for the kernel.
make allyesconfig Enables all configuration options in the kernel. target will set all kernel options to *. Make sure a backup of the current kernel configuration is acquired before experimentally using it!
12,编译所有的模块allyesconfig

make mrproper
make allyesconfig
make localmodconfig
make
make modules_install
make install
#重新生成一遍initrd
<pre name="code" class="plain">mkinitrd -v /boot/initrd-2.6.24.img  2.6.24.4

 
参考:

http://www.gentoo.org/doc/en/kernel-upgrade.xml

http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/ch05.html

https://wiki.archlinux.org/index.php/Modprobed-db

Linux 配置项含义查询:http://cateee.net/lkddb/web-lkddb/       http://kernel.xc.net/html/linux-2.6.27/xtensa/



http://blog.faq-book.com/?p=6811

http://wiki.gentoo.org/wiki/Kernel/Configuration


转载于:https://my.oschina.net/stz/blog/726053

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值