Difference between revisions of "Building OpenEmbedded (Beta)"

From Chumby Wiki
Jump to: navigation, search
(Update to 1.2 and add link to starter image)
Line 4: Line 4:
 
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.
 
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.
  
A previous version of this page can be found at http://wiki.chumby.com/index.php?title=Building_OpenEmbedded_(Beta)&oldid=2903 and contains information relevant to Silvermoon-based devices.  Silvermoon support for this new image-generation mechanism is pending.
+
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".
  
 
==Setting up the Environment==
 
==Setting up the Environment==
Line 18: Line 18:
 
#* {{Command|1=mkdir chumby-oe}}
 
#* {{Command|1=mkdir chumby-oe}}
 
#* {{Command|1=cd chumby-oe}}
 
#* {{Command|1=cd chumby-oe}}
#* {{Command|1=wget http://files.chumby.com/hacks/meta-chumby-1.1.tar.gz}}
+
#* {{Command|1=wget http://files.chumby.com/hacks/meta-chumby-1.2.tar.gz}}
 
#* {{Command|1=tar xvzf meta-chumby-1.1.tar.gz}}
 
#* {{Command|1=tar xvzf meta-chumby-1.1.tar.gz}}
 
#* {{Command|1=wget http://download.berlios.de/bitbake/bitbake-1.12.0.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=tar xvzf bitbake-1.12.0.tar.gz}}
 
#* {{Command|1=git clone git://git.openembedded.org/openembedded # This can take an hour or so}}
 
#* {{Command|1=git clone git://git.openembedded.org/openembedded # This can take an hour or so}}
# Setup OpenEmbedded - This command must be run each time you log on
 
#* {{Command|1=source setup-chumby.sh # Change TOPDIR in this file if you're installing somewhere other than ~/chumby-oe}}
 
 
# If desired, [[Advanced OpenEmbedded|customize the build process]].
 
# If desired, [[Advanced OpenEmbedded|customize the build process]].
  
 
==Building with OpenEmbedded==
 
==Building with OpenEmbedded==
  
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.
+
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.
 +
#* {{Command|1=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.
 
{{Command|1=bitbake chumby-starter-image # As an example, build chumby-starter-image}}
 
{{Command|1=bitbake chumby-starter-image # As an example, build chumby-starter-image}}
  
 
==Writing images to disk==
 
==Writing images to disk==
Built images go in output-angstrom-.9/deploy/eglibc/images/.  Full, bootable ROM images are named rom-chumby-falconwing-IMAGENAME.img.  Other interesting files, such as the bootloader, boot shell, kernel, and boot graphics are also present in this directory.
+
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:
 
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:
Line 44: Line 45:
 
* Windows
 
* Windows
 
*# Download win32-image-writer from https://launchpad.net/win32-image-writer
 
*# 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.

Revision as of 11:01, 10 April 2011

Overview

OpenEmbedded 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".

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

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 [1]. 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.