Difference between revisions of "Building OpenEmbedded (Beta)"

From Chumby Wiki
Jump to: navigation, search
m (clarify directory structure. This frustrated me for longer than I'd care to share.)
Line 7: Line 7:
 
# Download http://files.chumby.com/hacks/chumby-oe-1.2.zip and extract it to your build directory.  This will create a directory called “chumby”, and will add a script called “setup-chumby.sh”.
 
# Download http://files.chumby.com/hacks/chumby-oe-1.2.zip and extract it to your build directory.  This will create a directory called “chumby”, and will add a script called “setup-chumby.sh”.
 
# Edit setup-chumby.sh and modify TOPDIR such that it points to your working directory.  It defaults to ${HOME}/oe.
 
# Edit setup-chumby.sh and modify TOPDIR such that it points to your working directory.  It defaults to ${HOME}/oe.
 +
 +
You should now have a directory structure which looks like this:
 +
~/oe/setup-chumby.sh
 +
~/oe/chumby
 +
~/oe/openembedded
  
 
==Building with OpenEmbedded==
 
==Building with OpenEmbedded==
  
# To set up your environment, source the “setup-chumby.sh” script.  E.g. run “. setup-chumby.sh”.  Chose Silvermoon as the preferred platform.
+
# To set up your environment, source the “setup-chumby.sh” script.  E.g. run “. setup-chumby.sh”.  Choose Silvermoon as the preferred platform.
 
# Build an image.  Available images are in openembedded/recipes/images/.  For example, to build a very basic console image, run “bitbake console-image”.  TO do a fancier OPIE image, run “bitbake opie-image”.  This will take several hours, and will download a lot of code.
 
# Build an image.  Available images are in openembedded/recipes/images/.  For example, to build a very basic console image, run “bitbake console-image”.  TO do a fancier OPIE image, run “bitbake opie-image”.  This will take several hours, and will download a lot of code.
 
# Write the resulting SD image to disk.  Under your working directory (by default ~/oe), there will be a new directory called “output”.  The ROM image is under output/deploy/eglibc/images/chumby-silvermoon/rom-chumby-silvermoon-[image-type].img.  Write this file to an SD card using either dd, or on Windows use win32 Image Writer.
 
# Write the resulting SD image to disk.  Under your working directory (by default ~/oe), there will be a new directory called “output”.  The ROM image is under output/deploy/eglibc/images/chumby-silvermoon/rom-chumby-silvermoon-[image-type].img.  Write this file to an SD card using either dd, or on Windows use win32 Image Writer.

Revision as of 14:18, 4 February 2011

Setting up the Environment

Determine what directory will house your build system. All of these steps must be performed under this directory. It must contain no symlinks at all, and must be on a case-sensitive filesystem. The default is ~/oe/

  1. Install the required packages. Follow the instructions for your particular operating system at http://wiki.openembedded.net/index.php/OEandYourDistro
  2. Install BitBake. Go to http://wiki.openembedded.net/index.php/Getting_started and follow the instructions under "Obtaining BitBake". You can either install bitbake to your system, or you can just add it to your PATH.
  3. Obtain OpenEmbedded. Go to http://wiki.openembedded.net/index.php/Getting_started and follow the instructions under "Obtaining OpenEmbedded using Git". Checkout the code to your build directory, by default ~/oe
  4. Download http://files.chumby.com/hacks/chumby-oe-1.2.zip and extract it to your build directory. This will create a directory called “chumby”, and will add a script called “setup-chumby.sh”.
  5. Edit setup-chumby.sh and modify TOPDIR such that it points to your working directory. It defaults to ${HOME}/oe.

You should now have a directory structure which looks like this:

~/oe/setup-chumby.sh
~/oe/chumby
~/oe/openembedded

Building with OpenEmbedded

  1. To set up your environment, source the “setup-chumby.sh” script. E.g. run “. setup-chumby.sh”. Choose Silvermoon as the preferred platform.
  2. Build an image. Available images are in openembedded/recipes/images/. For example, to build a very basic console image, run “bitbake console-image”. TO do a fancier OPIE image, run “bitbake opie-image”. This will take several hours, and will download a lot of code.
  3. Write the resulting SD image to disk. Under your working directory (by default ~/oe), there will be a new directory called “output”. The ROM image is under output/deploy/eglibc/images/chumby-silvermoon/rom-chumby-silvermoon-[image-type].img. Write this file to an SD card using either dd, or on Windows use win32 Image Writer.

Under linux with dd, a sample command to write it out would be

dd if=rom-chumby-silvermoon-console-image.img of=/dev/sdX bs=8M

Where /dev/sdX is the device of the SD card, and bs=8M helps speed up the write dramatically. Note that you write to the raw device, /dev/sdX, and not the partitions /dev/sdX1, because the image as generated contains an MBR that it will replace on the target drive.