I have already posted on how we can build a vanilla Angstrom distribution from source at this post: Building Angstrom for Beaglebone from Source. This post looks at how we can add SPI to the kernel and rebuild the Linux kernel and Angstrom distribution. The post isn’t specific to SPI, so it may be that you are looking to make a different change to the distribution.

Initial Setup

If you have not done these steps already as explained in the previous post you should:

This should have you at the same point as the previous post and ready to go. If you receive any errors at this point then please go back to that post.

Really useful guide on using bitbake for open embedded and how everything works:

http://docs.openembedded.org/usermanual/usermanual.html#chapter_using_bitbake_and_oe

This is a substantial document; however, if you ever want to understand what is going on and how to create your own recipes you need to read this.

Back up the Default Kernel Configuration

Because we are about to replace the default configuration for the Beaglebone it is useful to back it up:

This means that we can always replace it if something goes wrong.

Modify the Kernel Configuration on the Beaglebone using Menuconfig

We can make modifications to the kernel configuration as follows:

The directory after build will depend on what your current build directory is. This directory appeared because I have already built the kernel in the last post: Building Angstrom for Beaglebone from Source

However, if you haven’t built a distribution already you could type:

depending on your target distribution.

When you execute make menuconfig you should see an interface like in Figure 1. In this case I am going to enable Debug support for SPI drivers. You could be doing this for another reason; for example in Figure 3 I am enabling CAN bus support.

make menuconfig

 Figure 1: menuconfig user interface

Go to -> Device Driver -> SPI support and then enable “Debug support for SPI drivers” by pressing Y

make menuconfig 2

Figure 2: Enable “Debug support for SPI drivers” by pressing ‘Y’

make menuconfig can

Figure 3: Enabling ‘CAN bus subsystem support’ (Networking Support -> CAN bus subsystem support)

If you were doing what I was doing your screen should appear as in Figure 2. Exit by pressing Exit back to the main menu and then exit completely. You can then copy the config file to your linux-ti33x-psp-3.2 directory so that it won’t be lost on a bitbake clean:

This should come back with CONFIG_SPI_SPIDEV=y

You can then build your distribution with the custom kernel settings you have made by doing something like:

to build the standard recipes – however if you want to change the recipe have a look at the next section.

Changing the Angstrom Beaglebone build Recipes

I was having problems with the latest release with nodejs and it is not something I needed for the project I had planned. So the question arose – how do I change the Angstrom build recipe?

Here is one way – it is probably not very elegant:

I have build my version from the cloud9-image.bb file, except I have removed nodejs and anything else that had nodejs as a dependency. Here is the content of my derek-image.bb file:

Now, to build this recipe:

Note: do not add .bb to the end of the derek-image, even though that is the name of the file.

This should be enough for you to build your own custom distribution. You should then find the build in the directory like “~/beaglebone/setup-scripts/build/tmp-angstrom_v2012_12-eglibc/deploy/images/beaglebone”, which will change according to your build etc. Here is the directory listing:

You can then deploy this to your SD card using the instructions in my post: Building Angstrom for Beaglebone from Source

 

Custom patches for the Beaglebone kernel build and distribution:

All of the beaglebone specific patches are in the directory: ~/beaglebone/setup-scripts/sources/meta-ti/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone

For example, the patches related to the LCD4 Cape are:

You can step back one directory and view the bitbake file at: ~/beaglebone/setup-scripts/sources/meta-ti/recipes-kernel/linux/linux-ti33x-psp_3.2.bb

nano is useful for this as there are a lot of pages:

At the bottom of a long list can see the 102 beaglebone patches (use CTRL-V to quickly page down) on this date. You would be able to modify the linux-ti33x-psp_3.2.bb and add in a custom patch or remove a patch if you felt it was causing difficulty. The process to build is then the same as before.