Difference between revisions of "Building OpenEmbedded (Beta)"

From Chumby Wiki
Jump to: navigation, search
m (Building with OpenEmbedded)
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
==Setting up the Environment==
+
==Overview==
Determine what directory will house your build systemAll of these steps must be performed under this directoryIt must contain no symlinks at all, and must be on a case-sensitive filesystem. The default is ~/oe/
+
OpenEmbedded[http://www.openembedded.org/index.php/Main_Page] is a build environment that contains a large number of packagesIt's possible to use OpenEmbedded to build a bootable image for certain chumby devices, such as the Falconwing-series of devicesThese instructions assume you're using Ubuntu 10.04 LTE, though they can be adapted to work on different platforms.
  
# Install the required packagesFollow the instructions for your particular operating system at http://wiki.openembedded.net/index.php/OEandYourDistro
+
Re-imaging a device requires access to the internal micro-SD portYou will also need a USB micro-SD reader of some sort. These can be obtained very cheaply, and sometimes can be found bundled with micro-SD media.
# 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.
+
 
# 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
+
These instructions assume you're running on a Falconwing platform, such as the Hacker Board or a chumby One.  If you're using a Silvermoon-based platform such as Infocast 8 or chumby 8, replace all instances of "falconwing" with "silvermoon".
# 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.
+
==Quickstart==
 +
Building OE can take several hours, since it pulls down the source for the entire world and builds every piece from scratch; the initial build configuration is also a bit finicky at times.
 +
 
 +
In order to facilitate rapid evaluation and development, you can launch one of our public, pre-built Amazon EC2 cloud instance images. Please see [[quickstarting OE]] for directions on how to do this.
 +
 
 +
==Setting up the Environment==
 +
This assumes you're using Ubuntu 10.04 LTE
 +
# Install prerequisites
 +
#* {{Command|1=sudo aptitude install sed wget cvs subversion git-core coreutils unzip texi2html texinfo libtool docbook-utils gawk python-pysqlite2 diffstat help2man make gcc build-essential g++ desktop-file-utils chrpath libxml2-utils xmlto screen python-ply libxml2-utils xsltproc python-progressbar python-psyco}}
 +
#Make /bin/sh not be part of dash
 +
#* {{Command|1=sudo dpkg-reconfigure dash # Select "No" at the prompt}}
 +
# Fix mmap_min_addr
 +
#* {{Command|1=sudo sh -c 'echo 0 > /proc/sys/vm/mmap_min_addr'}}
 +
#* {{Command|1=sudo sh -c 'echo "vm.mmap_min_addr = 0" >> /etc/sysctl.conf'}}
 +
# Download OpenEmbedded
 +
#* {{Command|1=mkdir chumby-oe}}
 +
#* {{Command|1=cd chumby-oe}}
 +
#* {{Command|1=wget http://files.chumby.com/hacks/meta-chumby-1.2.tar.gz}}
 +
#* {{Command|1=tar xvzf meta-chumby-1.2.tar.gz}}
 +
#* {{Command|1=wget http://download.berlios.de/bitbake/bitbake-1.12.0.tar.gz}}
 +
#* {{Command|1=tar xvzf bitbake-1.12.0.tar.gz}}
 +
#* {{Command|1=git clone git://git.openembedded.org/openembedded # This can take an hour or so}}
 +
# If desired, [[Advanced OpenEmbedded|customize the build process]].
  
 
==Building with OpenEmbedded==
 
==Building with OpenEmbedded==
  
# To set up your environment, source the “setup-chumby.sh” scriptE.g. run . setup-chumby.sh”.  Chose Silvermoon as the preferred platform.
+
Every time you log onto your build system, you must set up the environment.  There is a command called "setup-chumby.sh" that will do this for youYou must source the command and not run it. If you've installed openembedded to a path other than ~/chumby-oe/ you must edit the command and change the variable TOPDIR.
# Build an imageAvailable 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.
+
{{Command|1=source setup-chumby.sh # Select your platform at the prompt}}
# 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.
+
 
 +
Once setup, you use the bitbake command to build packages and imagesValid image files can be found in openembedded/recipes/images/and meta-chumby/recipes/images, and a full build from scratch can take ten hours or moreBuilding individual recipes is much quicker.
 +
{{Command|1=bitbake chumby-starter-image # As an example, build chumby-starter-image}}
 +
 
 +
''Need to add information here on how to roll back to a buildable snap-shot as it seems that packages are often checked into the git repository without validating this build process.''
 +
 
 +
==Writing images to disk==
 +
Built images go in output-angstrom-.9/deploy/eglibc/images/.  Full, bootable ROM images are named rom-chumby-MACHINE-IMAGENAME.img.  Other interesting files, such as the bootloader, boot shell, kernel, and boot graphics are also present in this directory.
  
Under linux with dd, a sample command to write it out would be
+
To write a ROM file to disk, use dd, or on Windows use win32-image-writer.  If you're working on a remote system, use SCP or SFTP to download the image file locally.  Then write the file out to an SD card:
   
+
* Linux
{{Command|1=dd if=rom-chumby-silvermoon-console-image.img of=/dev/sdX bs=8M}}
+
*# Determine what drive letter your SD card is. After inserting the card, run "dmesg" and note the drive name.  For example, it might be "sdb" or "sdc" depending on how many hard drives your system has.
 +
*# Unmount the drives
 +
*#* {{Command|1=for i in $(ls -1 /dev/sdb*); do sudo umount $i; done}}
 +
*# Write the ROM image out
 +
*#* {{Command|1=sudo dd if=rom-chumby-silvermoon-chumby-starter-image.img of=/dev/sdX bs=8M}}
 +
* Windows
 +
*# Download win32-image-writer from https://launchpad.net/win32-image-writer
  
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.
+
An example of a ROM image may be downloaded from [http://files.chumby.com/hacks/rom-chumby-falconwing-chumby-starter-image.img.gz].  Un-gzip this file and write it to an SD card, then insert the card in a Falconwing-based device. It should boot, and eventually bring up a prompt on the serial console.

Latest revision as of 08:24, 3 October 2011

Overview

OpenEmbedded[1] is a build environment that contains a large number of packages. It's possible to use OpenEmbedded to build a bootable image for certain chumby devices, such as the Falconwing-series of devices. These instructions assume you're using Ubuntu 10.04 LTE, though they can be adapted to work on different platforms.

Re-imaging a device requires access to the internal micro-SD port. You will also need a USB micro-SD reader of some sort. These can be obtained very cheaply, and sometimes can be found bundled with micro-SD media.

These instructions assume you're running on a Falconwing platform, such as the Hacker Board or a chumby One. If you're using a Silvermoon-based platform such as Infocast 8 or chumby 8, replace all instances of "falconwing" with "silvermoon".

Quickstart

Building OE can take several hours, since it pulls down the source for the entire world and builds every piece from scratch; the initial build configuration is also a bit finicky at times.

In order to facilitate rapid evaluation and development, you can launch one of our public, pre-built Amazon EC2 cloud instance images. Please see quickstarting OE for directions on how to do this.

Setting up the Environment

This assumes you're using Ubuntu 10.04 LTE

  1. Install prerequisites
    • sudo aptitude install sed wget cvs subversion git-core coreutils unzip texi2html texinfo libtool docbook-utils gawk python-pysqlite2 diffstat help2man make gcc build-essential g++ desktop-file-utils chrpath libxml2-utils xmlto screen python-ply libxml2-utils xsltproc python-progressbar python-psyco
  2. Make /bin/sh not be part of dash
    • sudo dpkg-reconfigure dash # Select "No" at the prompt
  3. Fix mmap_min_addr
    • sudo sh -c 'echo 0 > /proc/sys/vm/mmap_min_addr'
    • sudo sh -c 'echo "vm.mmap_min_addr = 0" >> /etc/sysctl.conf'
  4. Download OpenEmbedded
  5. If desired, customize the build process.

Building with OpenEmbedded

Every time you log onto your build system, you must set up the environment. There is a command called "setup-chumby.sh" that will do this for you. You must source the command and not run it. If you've installed openembedded to a path other than ~/chumby-oe/ you must edit the command and change the variable TOPDIR.

source setup-chumby.sh # Select your platform at the prompt

Once setup, you use the bitbake command to build packages and images. Valid image files can be found in openembedded/recipes/images/and meta-chumby/recipes/images, and a full build from scratch can take ten hours or more. Building individual recipes is much quicker.

bitbake chumby-starter-image # As an example, build chumby-starter-image

Need to add information here on how to roll back to a buildable snap-shot as it seems that packages are often checked into the git repository without validating this build process.

Writing images to disk

Built images go in output-angstrom-.9/deploy/eglibc/images/. Full, bootable ROM images are named rom-chumby-MACHINE-IMAGENAME.img. Other interesting files, such as the bootloader, boot shell, kernel, and boot graphics are also present in this directory.

To write a ROM file to disk, use dd, or on Windows use win32-image-writer. If you're working on a remote system, use SCP or SFTP to download the image file locally. Then write the file out to an SD card:

  • Linux
    1. Determine what drive letter your SD card is. After inserting the card, run "dmesg" and note the drive name. For example, it might be "sdb" or "sdc" depending on how many hard drives your system has.
    2. Unmount the drives
      • for i in $(ls -1 /dev/sdb*); do sudo umount $i; done
    3. Write the ROM image out
      • sudo dd if=rom-chumby-silvermoon-chumby-starter-image.img of=/dev/sdX bs=8M
  • Windows
    1. Download win32-image-writer from https://launchpad.net/win32-image-writer

An example of a ROM image may be downloaded from [2]. Un-gzip this file and write it to an SD card, then insert the card in a Falconwing-based device. It should boot, and eventually bring up a prompt on the serial console.