编译安装新内核
2013-06-22 01:02
127 查看
编译安装新内核
一: 内核下载:
内核的官网是:https://www.kernel.org
这里下载内核的版本是linux-2.6.30.10
一: 内核下载:
内核的官网是:https://www.kernel.org
这里下载内核的版本是linux-2.6.30.10
[root@localhost ~]# wget https://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.10.tar.bz2[/code]
二: 准备工作:
需要安装gcc编译工具、make编译器;并且编译内核时需使用root用户进行。
三: 操作步骤:
编译安装新内核的步骤为:
1:将下载的安装包解压到/usr/src目录
2:为内核目录创建连接。
3:配置内核 #make menuconfig
4:编译内核 #make
5:安装,包括模块安装和内核安装
6:重启系统,选用新内核
四: 实现过程:[root@localhost ~]# tar xvf linux-2.6.30.10.tar.bz2 /usr/src/ root@localhost ~]# cd /usr/src/ [root@localhost ~]# ln -sv linux-2.6.30.10/ linux [root@localhost ~]# cd linux [root@localhost ~]# make menuconfig //会打开一个基于文本的窗口,在里面可以启用或者关闭某个功能: // [ ]:不启用此项 // [*]:直接编译进内核 (使用时方便,但一些不常用的功能会占用内核空间) [M]:编译成模块 (使用时要动态装载,效率低)
此文本窗口如下,可根据自己的需求选择行的选取,如果对各个功能不是很了解,可以在网上查一下:[root@localhost ~]# make //这一步骤时间会稍长 [root@localhost ~]# make modules [root@localhost ~]# make modules_install [root@localhost ~]# make install
至此,内核编译完成,要想使用新内核,需要重启系统,并选用新内核。
补充:
1:执行完make menuconfig之后,会在执行命令的目录里生成一个隐藏文件:.config,此文件就是内核的配置信息。[root@localhost linux]# pwd /usr/src/linux [root@localhost linux]# ls -a | grep .config .config在配置内核时,如果不是很清楚各项字段的意义,且感觉配置比较复杂,可以复制当前正在使用的内核的.config文件到/usr/src/linux目录下,然后执行make menuconfig命令,配置一下即可。
2:执行完make install之后会自动在grub.conf中新增一个内核启动选项:[root@localhost ~]# cat /boot/grub/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You do not have a /boot partition. This means that # all kernel and initrd paths are relative to /, eg. # root (hd0,0) # kernel /boot/vmlinuz-version ro root=/dev/sda1 # initrd /boot/initrd-version.img #boot=/dev/sda default=1 timeout=5 splashimage=(hd0,0)/boot/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (2.6.30.10asange) root (hd0,0) kernel /boot/vmlinuz-2.6.30.10asange ro root=LABEL=/ rhgb quiet initrd /boot/initrd-2.6.30.10asange.img title Red Hat Enterprise Linux Server (2.6.18-164.el5) root (hd0,0) kernel /boot/vmlinuz-2.6.18-164.el5 ro root=LABEL=/ rhgb quiet initrd /boot/initrd-2.6.18-164.el5.img
相关文章推荐
- centos7下用内核源码单独编译安装KVM模块
- Linux-3.10.1内核编译安装
- 内核编译安装学习笔记
- 在Ubuntu10.04LTS上Android 内核的下载、编译与安装
- FreeBSD 6.2 编译安装内核
- Linux内核驱动学习(一)----内核简介 | 配置 | 编译| 安装(PC平台下)
- inux内核的编译与安装 (转)
- linux 编译系统的简单介绍与内核编译与安装
- 在Ubuntu上下载、编译和安装Android最新内核源代码(Linux Kernel)
- 嵌入式开发实作(Linux内核编译及安装)
- Ubuntu 10.04 编译安装最新版本Linux-2.6.34内核
- 我的Ubuntu 5.10光盘安装流程(包括编译内核)
- 内核的编译及安装
- 编写、编译、安装、移除一个内核模块的基本过程,不能再简单了的
- Linux 内核的配置编译安装
- 我的y450安装gentoo,内核编译选项记录
- 为pc编译配置安装当前最新的内核
- 在Ubuntu上下载、编译和安装Android最新内核源代码(Linux Kernel)
- 在ubuntu下编译安装内核及其卸载
- Linux内核分析(一)---linux体系简介|内核源码简介|内核配置编译安装