EBC Exercise 25 Configuring U-boot

From eLinux.org
Revision as of 19:22, 24 March 2010 by Yoder (Talk | contribs) (Created page with 'Category:ECE597 Category:BeagleBoard This follows the approach taken in ECE597 Configuring the Kernel. We'll use '''bitbake''' to get the source files for U-boot an…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


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.

bitbake

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
ls

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-*
ls

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-2.6.29-r46
ls

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

You can now configure the kernel.

sudo apt-get install libqt3-mt-dev
make xconfig

After saving the configuration changes to update the .config file, it is a simple matter of rerunning the forced compile step from above to rebuild the kernel:

$ bitbake -f -c compile linux-omap-2.6.29
$ bitbake -f -c deploy linux-omap-2.6.29

If your kernel configuration modifications happen to result in the generation of any loadable modules, then you will wind up with another file in the deployment images folder:

  • What does the bitbake deploy command do? See if you can find out
$ cd ${OETREE}/angstrom-dev/deploy/glibc/images/beagleboard
$ ls

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.