Close

ArchLinux Kernel Compilation on BeagleBone Black

I recently had to modify and recompile the kernels on my BBB’s. Cross-compilation is well documented on the internet, but what if you want to compile directly on the device? Here are the steps…


Prerequisites

The on-board flash memory is not large enough to compile the kernel. You have to insert and mount an external SD card or USB drive for storage:

Now you can install git and acquire the kernel sources from GitHub:


Compilation

You are now ready to configure, compile and install the kernel. To customize the kernel edit its configuration file:

Note: it looks like the legacy kernel does not compile at the time of this writing. The normal kernel (without -legacy) seems to work fine though.

After modifying the kernel configuration, the corresponding kernel config checksum in the PKGBUILD must be updated:

Replace the last entry in md5sums=(..) with your checksum above, and then compile the kernel:

Note: The –asroot option allows compilation as the root user (not recommended). The PKGBUILDs/core/linux-am33x[-legacy] directory must be writable if not running as root.

Finally, the kernel can be installed:

For example: pacman -U linux-am33x-3.18.0-1-armv7h.pkg.tar.xz linux-am33x-headers-3.18.0-1-armv7h.pkg.tar.xz


Other Notes

  • The linux-am33x kernel is newer than the linux-am33x-legacy kernel, but the latter has better support for BeagleBone I/O and other hardware specific features.
  • Kernel modules are stored in /usr/lib/modules/kernel_release
  • To show all currently loaded kernel modules: # lsmod
  • To show information about a module: # modinfo module_name
  • To add a module to the kernel: # modprobe module_name
  • To unload a module from the kernel: # modprobe -r module_name

Related Resources

Leave a Reply

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