RHEL 5.6编译安装3.2.9的内核

就6步了:

1/下载内核3.2.9 kernel.org上去下载,解压到/usr/src:

[root@localhost src]# ls -la
total 141172
drwxr-xr-x 6 root root 4096 Mar 11 19:31 .
drwxr-xr-x 15 root root 4096 Mar 10 09:55 ..
drwxr-xr-x 2 root root 4096 Oct 1 2009 debug
drwxr-xr-x 3 root root 4096 Mar 10 09:56 kernels
drwxrwxr-x 23 root root 4096 Mar 11 19:27 linux-3.2.9
-rwxrw-rw- 1 root root 78132997 Mar 11 09:48 linux-3.2.9.tar.bz2
drwxr-xr-x 7 root root 4096 Mar 10 09:57 redhat

2/make gconfig,如果没有什么修改就直接保存退出,会在本地生成.config文件,修改一下:把

CONFIG_SYSFS_DEPRECATED

修改为:

CONFIG_SYSFS_DEPRECATED=y

否则有些系统的新内核无法启动

3/make,会有如下提示:

[root@localhost linux-3.2.9]# make -j4
scripts/kconfig/conf --silentoldconfig Kconfig
warning: (AX88796_93CX6 && RTL8180 && RTL8187 && ADM8211 && RT2400PCI && RT2500PCI && RT61PCI && RT2800PCI && R8187SE) selects EEPROM_93CX6 which has unmet direct dependencies (MISC_DEVICES)
*
* Restart config...
*
*
* General setup
*
Prompt for development and/or incomplete code/drivers (EXPERIMENTAL) [Y/n/?] y
Cross-compiler tool prefix (CROSS_COMPILE) []
Local version - append to kernel release (LOCALVERSION) []
Automatically append version information to the version string (LOCALVERSION_AUTO) [N/y/?] n
Kernel compression mode
> 1. Gzip (KERNEL_GZIP)
2. Bzip2 (KERNEL_BZIP2)
3. LZMA (KERNEL_LZMA)
4. XZ (KERNEL_XZ)
5. LZO (KERNEL_LZO)
choice[1-5?]: 1
Default hostname (DEFAULT_HOSTNAME) [(none)] (none)
Support for paging of anonymous memory (swap) (SWAP) [Y/n/?] y
System V IPC (SYSVIPC) [Y/n/?] y
POSIX Message Queues (POSIX_MQUEUE) [Y/n/?] y
BSD Process Accounting (BSD_PROCESS_ACCT) [Y/n/?] y
BSD Process Accounting version 3 file format (BSD_PROCESS_ACCT_V3) [N/y/?] n
open by fhandle syscalls (FHANDLE) [N/y/?] n
Export task/process statistics through netlink (EXPERIMENTAL) (TASKSTATS) [Y/n/?] y
Enable per-task delay accounting (EXPERIMENTAL) (TASK_DELAY_ACCT) [Y/n/?] y
Enable extended accounting over taskstats (EXPERIMENTAL) (TASK_XACCT) [Y/n/?] y
Enable per-task storage I/O accounting (EXPERIMENTAL) (TASK_IO_ACCOUNTING) [Y/n/?] y
Auditing support (AUDIT) [Y/n/?] y
Enable system-call auditing support (AUDITSYSCALL) [Y/n/?] y
Kernel .config support (IKCONFIG) [N/m/y/?] n
Kernel log buffer size (16 => 64KB, 17 => 128KB) (LOG_BUF_SHIFT) [19] 19
Automatic process group scheduling (SCHED_AUTOGROUP) [N/y/?] n
Enable deprecated sysfs features to support old userspace tools (SYSFS_DEPRECATED) [Y/n/?] y
Enable deprecated sysfs features by default (SYSFS_DEPRECATED_V2) [N/y/?] (NEW)


输入y,开始编译

4/make modules_install,会把lib文件拷贝到/lib/modules下去:

[root@localhost linux-3.2.9]# ls /lib/modules/
2.6.18-238.el5 3.2.9

5/make install

[root@localhost boot]# ls -la
total 17660
drwxr-xr-x 3 root root 4096 Mar 11 20:22 .
drwxr-xr-x 26 root root 4096 Mar 11 19:21 ..
-rw-r--r-- 1 root root 67210 Dec 20 2010 config-2.6.18-238.el5
drwxr-xr-x 2 root root 4096 Mar 11 20:22 grub
-rw------- 1 root root 2787124 Mar 10 12:45 initrd-2.6.18-238.el5.img
-rw-r--r-- 1 root root 4024934 Mar 10 11:41 initrd-2.6.18-238.el5kdump.img
-rw------- 1 root root 2784350 Mar 11 20:22 initrd-3.2.9.img
-rw-r--r-- 1 root root 94600 Jul 13 2006 memtest86+-1.65
-rw-r--r-- 1 root root 113923 Dec 20 2010 symvers-2.6.18-238.el5.gz
lrwxrwxrwx 1 root root 22 Mar 11 20:22 System.map -> /boot/System.map-3.2.9
-rw-r--r-- 1 root root 1260254 Dec 20 2010 System.map-2.6.18-238.el5
-rw-r--r-- 1 root root 1879493 Mar 11 20:22 System.map-3.2.9
lrwxrwxrwx 1 root root 19 Mar 11 20:22 vmlinuz -> /boot/vmlinuz-3.2.9
-rw-r--r-- 1 root root 2094684 Dec 20 2010 vmlinuz-2.6.18-238.el5
-rw-r--r-- 1 root root 158 Dec 20 2010 .vmlinuz-2.6.18-238.el5.hmac
-rw-r--r-- 1 root root 2861840 Mar 11 20:22 vmlinuz-3.2.9
[root@localhost boot]#

生成了vmlinuz-3.2.9 ,initrd-3.2.9.img, System,map-3.2.9

就可以了。


修改启动目录:

1 # grub.conf generated by anaconda
2 #
3 # Note that you do not have to rerun grub after making changes to this file
4 # NOTICE: You do not have a /boot partition. This means that
5 # all kernel and initrd paths are relative to /, eg.
6 # root (hd0,0)
7 # kernel /boot/vmlinuz-version ro root=/dev/sda1
8 # initrd /boot/initrd-version.img
9 #boot=/dev/sda
10 default=0
11 timeout=5
12 splashimage=(hd0,0)/boot/grub/splash.xpm.gz
13 hiddenmenu
14 title Red Hat Enterprise Linux Server (3.2.9)
15 root (hd0,0)
16 kernel /boot/vmlinuz-3.2.9 ro root=LABEL=/ rhgb quiet crashkernel=128M@16M
17 initrd /boot/initrd-3.2.9.img
18 title Red Hat Enterprise Linux Server (2.6.18-238.el5)
19 root (hd0,0)
20 kernel /boot/vmlinuz-2.6.18-238.el5 ro root=LABEL=/ rhgb quiet crashkernel=128M@16M
21 initrd /boot/initrd-2.6.18-238.el5.img

从新的内核启动。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值