如何加速linux内核编译? [英] How to speed up linux kernel compilation?

查看:351
本文介绍了如何加速linux内核编译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有核心i5与8gb RAM。
我的机器上安装了VMware工作站10.0.1。
我在Linux上安装了fedora 20 Desktop Edition作为客户操作系统。

I have core i5 with 8gb RAM. I have VMware workstation 10.0.1 installed on my machine. I have fedora 20 Desktop Edition installed on VMware as guest OS.

我正在使用linux内核源代码v 3.14.1。我正在为linux内核开发一个I / O调度器。在代码中进行任何修改后,每次编译和安装整个内核代码需要大约1小时30分钟来查看更改。

I am working on linux kernel source code v 3.14.1. I am developing an I/O scheduler for linux kernel. After any modifications in code every time it takes around 1 hour and 30 minutes for compiling and installing the whole kernel code to see the changes.

编译和安装命令:
make menuconfig
make
c $ c> make modules ,
make modules_install
make install

所以我的问题是有可能减少1小时30分钟的时间,只有10到15分钟?

So my question is it possible to reduce 1 hour and 30 minutes time into only 10 to 15 minutes?

推荐答案

对于你对源代码做的每一个改变,不要做 make menuconfig ,因为它会触发一切,无论你的改变是多么微不足道。这只需要内核的配置选项更改,并且应该在您的开发期间发生。

Do not do make menuconfig for every change you make to the sources, because it will trigger a full compilation of everything, no matter how trivial your change is. This is only needed when the configuration option of the kernel changes, and that should sheldom happen during your development.

只需执行:

make

汇编:

make -j4

$ b $

然后, make install 等等。当然,部署最近构建的二进制文件可能需要用到。

Then the make install, etc. may be needed for deploying the recently built binaries, of course.

另一个诀窍是将内核配置为测试所需的最小内存。我发现对于许多任务,UML编译(用户模式Linux)是最快的。您还可以找到有用的 make localmodconfig 而不是 make menuconfig

Another trick is to configure the kernel to the minimum needed for your tests. I've found that for many tasks a UML compilation (User Mode Linux) is the fastest. You may also find useful make localmodconfig instead of make menuconfig to start with.

这篇关于如何加速linux内核编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆