简体   繁体   English

使用Travis CI构建Linux内核

[英]Building a Linux kernel using Travis CI

How can I build a Linux kernel in Travis CI. 如何在Travis CI中构建Linux内核。 I have added script: make menuconfig to my Travis config and it doesn't work and says 我已经添加了script: make menuconfig到Travis配置中,它不起作用并说

No output has been received in the last 10 minutes

How can I fix this? 我怎样才能解决这个问题?

Link to GitHub repo : https://github.com/ProjectPolyester/tegra_kernel and submit fixes in PRs if possible 链接到GitHub存储库: https : //github.com/ProjectPolyester/tegra_kernel并在可能的情况下在PR中提交修复

Travis monitors your build process and if there is no output for about 10 minutes, it assumes that your process is stuck somewhere for unknown reasons, and then kills it. Travis会监视您的构建过程,并且如果大约10分钟没有输出,它将假定您的过程由于未知原因卡在某个地方,然后将其杀死。

Solution in your case : 您的解决方案:

You need to provide with the actual build command. 您需要提供实际的构建命令。

make menuconfig

actually just allows you to configure the kernel. 实际上只允许您配置内核。 It doesn't really starts the kernel build process. 它并没有真正启动内核构建过程。 So there is no output of this command. 因此,此命令没有输出。

Also, the kernel should already be configured or you can download the appropriate .config file if its available some where online. 另外,应该已经配置了内核,或者可以下载适当的.config文件(如果在线时可用)。 And then there will be no need to execute: 然后就无需执行:

make menuconfig

The build command 构建命令

It can be simply 可以很简单

make

or something like 或类似的东西

make -j3 modules ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOCALVERSION=-$SOURCE_VERSION

The second one is actually to perform cross compilation. 第二个实际上是执行交叉编译。 You also need to set all the prerequisites like downloading the header file etc 您还需要设置所有先决条件,例如下载头文件等

You may want to take a look at this script , it crosscompiles the modules only, not the entire kernel. 您可能要看一下此脚本 ,它只交叉编译模块,而不是整个内核。

If you want to use the old config for a new kernel, you can use make olddefconfig. 如果要将旧配置用于新内核,则可以使用make olddefconfig。 Here is my example how to compile and boot a new kernel in travis: https://github.com/avagin/criu/blob/linux-next/scripts/travis/kexec.sh#L54 这是我在travis中如何编译和引导新内核的示例: https : //github.com/avagin/criu/blob/linux-next/scripts/travis/kexec.sh#L54

I know that this is an old thread but I was recently able to get Travis CI working on building a Linux kernel https://github.com/GlassROM-devices/android_kernel_oneplus_msm8994/commit/6ed484812bbd4a25c3b22e730b7489eaaf668da1 GCC fix is for toolchains compiled on Debian unstable, arch, gentoo, etc. These toolchains will fail to compile on Ubuntu so you'll have to use the GCC fix for these toolchains 我知道这是一个旧线程,但是我最近能够使Travis CI致力于构建Linux内核https://github.com/GlassROM-devices/android_kernel_oneplus_msm8994/commit/6ed484812bbd4a25c3b22e730b7489eaaf668da1 GCC修复用于在Debian上不稳定编译的工具链, arch,gentoo等。这些工具链将无法在Ubuntu上编译,因此您必须对这些工具链使用GCC修复程序

And you really want to upgrade GCC before you even try building a kernel. 而且,您甚至在尝试构建内核之前就真的想升级GCC。 Travis CI has a very old GCC that will fail if you try to compile the kernel Travis CI有一个非常老的GCC,如果您尝试编译内核,它将失败

In my commit I'm building it with GCC 8 linaro built by myself 在我的提交中,我将使用自己构建的GCC 8 linaro进行构建

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM