Ubuntu 10.04内核源码树的编译和安装

参考博客:Ubuntu内核源码树的构建与安装

简介

本文主要讨论在Ubuntu10.04 LTS环境下,构建内核代码树的流程。

构建环境

1. 使用Vmware安装Ubuntu10.04的光盘镜像,并配置好网络,WIFI下使用NAT模式,网线可以使用桥接模式

2. 更新sources.list,由于Ubuntu10.04属于比较古老的Ubuntu版本,目前官方已经不在支持此版本。在/etc/apt目录下打开sources.list,将源粘贴进去即可。源如下,测试可以使用,如果不好用或者速度不快的话可以去网上寻找其他源。
 
## Major bug fix updates produced after the final release of the  
## distribution.  
deb http://old-releases.ubuntu.com/ubuntu/ maverick main restricted  
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick main restricted  
deb http://old-releases.ubuntu.com/ubuntu/ maverick-updates main restricted  
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick-updates main restricted  
   
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu  
## team. Also, please note that software in universe WILL NOT receive any  
## review or updates from the Ubuntu security team.  
deb http://old-releases.ubuntu.com/ubuntu/ maverick universe  
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick universe  
deb http://old-releases.ubuntu.com/ubuntu/ maverick-updates universe  
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick-updates universe  
   
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu  
## team, and may not be under a free licence. Please satisfy yourself as to  
## your rights to use the software. Also, please note that software in  
## multiverse WILL NOT receive any review or updates from the Ubuntu  
## security team.  
deb http://old-releases.ubuntu.com/ubuntu/ maverick multiverse  
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick multiverse  
deb http://old-releases.ubuntu.com/ubuntu/ maverick-updates multiverse  
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick-updates multiverse  
   
## Uncomment the following two lines to add software from the 'backports'  
## repository.  
## N.B. software from this repository may not have been tested as  
## extensively as that contained in the main release, although it includes  
## newer versions of some applications which may provide useful features.  
## Also, please note that software in backports WILL NOT receive any review  
## or updates from the Ubuntu security team.  
# deb http://us.old-releases.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse  
# deb-src http://us.old-releases.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse  
   
#remastersys for backup installed system  
deb http://www.remastersys.com/ubuntu maverick main  

3. 安装编译工具

 apt-get install kernel-package libncurses5-dev  

kernel-package是Debian提供的一个编译Linux内核的一个工具集,安装kernel-package 会同时安装上build-essential、libncurses-dev、linux-source等一系列工具。libncurses5-dev是一个可视化的配置界面UI。主要是支持使用menuconfig配置内核。

4. 下载和安装源码包

使用

apt-cache search linux-source

命令可以查看可用的源码包:

然后使用apt-get install 安装linux-source-2.6.35,下载完成后,代码位于/usr/src目录下,将软件包解压出来:

 tar -xjvf linux-source-2.6.35.tar.bz2

 

内核编译

1. 使用系统配置文件

进入当前系统的源码目录下:linux-headers-2.6.32-24-generic ,将其中的.config文件复制到解压后的源码目录中。

2. menuconfig

加载CONFIG文件选项框中,选择.config 然后退出menuconfig的界面。

3. make bzImage 编译内核

4. make modules 编译模块

5.make modules_install 安装模块

6.make install 安装系统

安装完成后,在lib/modules可以看到安装后的系统。

 

进入boot目录下,生成系统的boot信息: update-initramfs -c -k  2.6.35.14
然后将其加入到grub当中:update-grub 
 
在VMWARE环境下如果需要调出GNU GRUB界面需要长按shift健
 
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值