简体   繁体   中英

Building a Linux kernel using Travis CI

How can I build a Linux kernel in Travis CI. I have added script: make menuconfig to my Travis config and it doesn't work and says

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

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.

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. 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. 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

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

And you really want to upgrade GCC before you even try building a kernel. Travis CI has a very old GCC that will fail if you try to compile the kernel

In my commit I'm building it with GCC 8 linaro built by myself

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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