Difference between revisions of "EBC Exercise 25 Configuring U-boot"

From eLinux.org
Jump to: navigation, search
m (Compiling U-boot)
Line 56: Line 56:
Save the file and enter:
Save the file and enter:
source source-me.txt
$ source source-me.txt
Now a simple <code>make</code> should compile U-boot.   
Now a simple <code>make</code> should compile U-boot.   

Revision as of 12:08, 24 March 2010

This follows the approach taken in ECE597 Configuring the Kernel. We'll use bitbake to get the source files for U-boot and then we'll edit them.


When you did ECE597 Installing The Ångström Distribution you used bitbake to build console-image. During that build the kernel was downloaded and compiled. If you used the default configure, the source code was removed once it was done. Check and see:

cd ${OETREE}/angstrom-dev/work/beagleboard-angstrom-linux-gnueabi

You should see a directory starting with u-boot-. The rest of the name tells what version you have. Change to that directory and see what's there:

cd u-boot-*

If you see a git directory, you are in luck. If you see just a temp directory you need to do the following to reload the sources:

cd ${OETREE}/build/conf
gedit local.conf

Find the line near the top that says INHERIT += " rm_work " and comment it out.

# INHERIT += " rm_work "

Save the file and then:

 cd ${OETREE}/openembedded
$ bitbake -c clean u-boot
$ bitbake -f -c compile u-boot
  • The first bitbake command tells bitbake to remove the previously made binary file for that package (think "make clean"), which will force it to re-do what it previously did with the console-image build.
  • The second bitbake line forces bitbake to rebuild the u-boot package, which will require re-extracting the previously deleted source code, and apply the relevant OE related patches.

This took XXXX hours on my machine. (Time it when you do it and update the XXXX.)

Once done go back to

cd ${OETREE}/angstrom-dev/work/beagleboard-angstrom-linux-gnueabi/linux-omap-*

You should now see the git directory. cd to it and look around.

Compiling U-boot

You can now compile U-boot. Put the following in a file called source-me.txt.

export OETREE="${HOME}/oe"
export ARCH=arm
export CROSS_COMPILE=arm-angstrom-linux-gnueabi-


Save the file and enter:

$ source source-me.txt

Now a simple make should compile U-boot.

Assignment: Modify u-boot to include your initials in the prompt.

Hint: Look for the omap3_beagle.h file.

Doing it yourself

If you would prefer to maintain your own kernel source tree outside of OE, see these directions: BeagleBoardLinuxKernel

Alternatively it is possible to run the official omap branch of the linux kernel. Take a peek at this page. BeagleBoard#Linux_kernel (Please continue reading for the modifications I needed)

  • Since we are using OE, our paths are set up slightly different, I have made the relevant changes below that I needed to do it manually. Take note on the second path command is arch specific (if you get an error about mkimage not being found, make sure you have the second path right)
PATH=~/oe/angstrom-dev/cross/armv7a/bin:~/oe/angstrom-dev/staging/i686-linux/usr/bin:$PATH  # add cross tools to your path
make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- distclean
make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- omap3_beagle_defconfig
make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- menuconfig  # only needed if you want to change the default configuration
make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- uImage
  • It is important to note that the kernel in the official branch will be newer then the ones that OE provides (2.6.33 at the time of this writing), and as such there are no OE related patches to apply.
  • There is no reason why you can't steal the OE kernel config, and apply it to the newer kernel. See if you can figure out how to do this. (Hint: You will need to combine both above links directions)
  • Alternatively if you've previously built the kernel, take a peek in your ${OETREE}/downloads. This is where the old kernel source (pre-patches) was downloaded, and see if you can manually apply the OE patches.