Reliable build of the Linux Kernel for the BeagleBone Black

Alex Marshall picture Alex Marshall · May 20, 2014 · Viewed 7.9k times · Source

Is there a reliable build of the Linux kernel for the BeagleBone Black platform anywhere ? I've followed the instructions here, as well as numerous other places, and none of them work. Either the modules don't build (the .ko files just don't get built and can't be found in the case of the link above), or there's missing build targets for the kernel. I'm using the Linaro ARM compiler (arm-linux-gnueabihf-gcc) cross compiling on 32-bit x86 Ubuntu 14.04.

Specifically, I've checked out the source at the BeagleBone Git repository, branches 3.8, 3.11, 3.12, 3.13 and 3.14. I've also checked out a 3rd party git clone here. The problems I've encountered are as follows:

  • 3.8: Kernel will compile (with numerous warnings), but the modules fail to compile due to errors in the patching process from running patch.sh in the branch.
  • 3.11: Kernel will compile (with numerous warnings), but the uImage-dtb.am335x-boneblack Make target will not. Compiling modules fails due to at least one file having an incorrect patch that yields incorrect C syntax.
  • 3.12: Kernel will compile (with numerous warnings), along with the modules. Copying kernel and modules to the board succeeds. Booting the kernel fails, and freezes as soon as the bootup begins right out of the boot command in U-Boot.
  • 3.13, 3.14: The kernel compilation fails with numerous syntax errors.
  • 3.8.13+ from TowerTech: The kernel compilation succeeds (with numerous warnings), the module compilation fails, again due to incorrect patching from patch.sh.

In the cases where I could compile a kernel, I copied it to a fresh, vanilla board in memory using a TFTP boot server from U-Boot, and booted the kernel in memory. However, none of the successfully compiled kernels could work properly because they were missing their modules / firmware / dtbs. What could be causing the incorrect patching ? Surely, the developers who've written the code and patches must have tested it, so there may be something wrong with my workspace, though I can't imagine what at this point. The commands I used were the same as those at link 1.

Answer

ragu foss picture ragu foss · Dec 5, 2014

I also followed the link you have mentioned and I am able to boot the BBB. I am using the mainline kernel from https://www.kernel.org/. The following are the steps I followed

  1. Download the latest kernel. My version is 3.18-rc4
  2. Use "omap2plus_defconfig" which is the default config for beaglebone black
  3. Make commands are

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- omap2plus_defconfig -j4

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage dtbs LOADADDR=0x80008000 -j4.

    The image produced is present in the following path.

    arch/arm/boot/uImage uImage

    arch/arm/boot/dts/am335x-boneblack.dtb

  4. After this compile the modules.

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules -j4

  5. I was using busybox and NFS server as root

Compiler used is arm-linux-gnueabi-gcc. With this I am able to boot successfully and run modules. It has the advantage that we are using the latest kernel available.