Comments

ARM – Raspberry Pi 2 – Kernel Compile.. — 4 Comments

  1. Thanks for this useful guide. I was unable to find the kernel source branch which actually matched the 3.18.7 kernel in the Raspbian distro I downloaded, so I had to rebuild from known source in order to go on to build matching ZFS kernel modules, and that’s working nicely now (using 3.18.9 kernel and 0.6.3-1.3 ZFS).

    There are a some packages you need to add to make the kernel build work. I don’t remember all those I have added (some may have been added originally for other reasons), but I was caught out during the first build attempt as I was still missing “bc” (arbitrary precision calculator language) which the kernel build uses.

  2. The Raspberry Pi 2 can be made to build the kernel much more quickly using ‘make -j5’. This sets up five jobs concurrently, when possible, and makes full use of all the cores.

    The build is also quicker if done on a hard drive.

  3. Thanks from me too for this useful guide. I have my Pi 2 running Fedora 21 3.18.7, but I’d like to move up to kernel 4.0.x.
    Is it ‘safe’ to use the config from /proc/config.gz to configure a 4.0 kernel? Or is there a recognised way of “upgrading” a running config to ensure successful build? Right now, the Pi does not boot if I use a newly built kernel. I notice that the original kernel7.img is about 3.5Mbytes, whilst /arch/arm/boot/Image after build is over double that size – which makes me think the boot loader might need to know about that.

    And thanks, Tim, for the -j5 tip – should speed things up a little for me!

    • There were many changes from 3.18 to 4.x, so best to run # make bcm2709_defconfig, which will generate an appropriate kernel config..

      RG.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.