注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

艾伯特的鸟屋

 
 
 

日志

 
 

ubuntu下重新编译内核(转载)  

2015-01-24 13:08:41|  分类: linux |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
转载于https://vuanhduy.wordpress.com/2014/05/03/recompiling-kernel-for-ubuntu-14-04-trusty-tahr/

Recompiling kernel for Ubuntu 14.04 (Trusty Tahr)
By Anh-Duy Vu
Ubuntu-trusty

Install necessary tools
The required tools are: fakeroot, make-kpkg and git. To install these tools, you simply do as below:

sudo apt-get install fakeroot kernel-package git
Get the the source code
The Ubuntu Linux kernel git repository is located at git://kernel.ubuntu.com/ubuntu/ubuntu-<release>.git. To obtain a local copy of Ubuntu 14.04 (Trusty Tahr) you simply git clone its repository as below:

git clone git://kernel.ubuntu.com/ubuntu/ubuntu-trusty.git
It will take you about 15 to 30 minutes to get all the code. When finishing, a new directory named ubuntu-trusty is created and it contains the downloaded source code. Change into the directory to do the further works:

cd ubuntu-trusty
Create the configure file
I wish to re-use the configuration of my currently-running kernel so I copy the current config contained in /boot directory and parse it:

cp /boot/config-`uname -r` .config
make oldconfig
Build the kernel
Now, you can compile the kernel and create *.deb packages. This improves the portability of the kernel, since installation on a different machine is as simple as installing the packages. Do as bellow:

fakeroot make-kpkg --initrd kernel-image kernel-headers
Optionally, you can append some personal string to the output deb file by utilizing –append-to-version=-some-string-here option.
We can parallel compilation with make-kpkg by defining the CONCURRENCY_LEVEL environment variable:

export CONCURRENCY_LEVEL=3
Once the compilation has completed, the deb files live in the parent of the current directory and we can install them using dpkg:

cd ..
sudo dpkg -i linux-image-<some string>.deb
sudo dpkg -i linux-headers-<some string>.deb
  评论这张
 
阅读(50)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017