[howto] Building the cloud9-image from scratch

Thanks to the various messages on the list over the last few days, I have finally managed to get the cloud9 image to compile properly. Here is what I documented, starting from a brand new Ubuntu vmware image. Let me know if this helps others!

1. Install an Ubuntu 11.10, 64bits desktop distribution on a VM. On my setup, I used 4 virtual CPUs, 4096MB or RAM and a 40GB HDD, with bridged networking. The only important parameter as far as I can tell is disk size, you will probably need more than 20GB.

2. Setup your environment:

  • Login

  • On a terminal, add yourself to the “disk” group: adduser your_username disk

  • Logout, then login again to refresh group permissions for your user.

  • Make sure /bin/sh points to bash and not dash! This is a nasty one, thanks to Leigh Klotz for pointing it out, this made me waste several evenings! (use sudo dpkg-reconfigure bash if necessary, or update the symbolic link manually).

  • cd Documents

  • mkdir Beaglebone

  • cd Beaglebone
    Then add the various packages required to compile the Angstrom cloud9 image. This is the exact minimum list I needed when I did the compilation on the 8th of January 2011:

  • sudo apt-get install git build-essential diffstat texi2html texinfo subversion chrpath ncurses-dev

Last, get the Angstrom build scripts:

At this stage, If you need a proxy: edit oebb.sh and input your proxy configuration at the beginning of the file. Don’t forget to delete the empty PROXYHOST definition. You will also have to apt-get install corkscrew . If at a later stage you need to add/modify the proxy information, the best is still to delete ~/.oe, as well as setup-scripts/git_config and setup-scripts/subversion_config as the git and subversion config dirs are never rebuilt when the proxy information is modified.

Now, configure for your machine, and source the configuration in your shell session:

  • ./oebb.sh config beaglebone
  • . ~/.oe/environment-oecore

You are now ready to build images for your BeagleBone:

  • bitbake systemd-image will build a minimum bootable image
  • bitbake cloud9-image will build the complete cloud9 demo image that is shipped with the BBone. The first attempt will fail, and bitbake will give you instructions to add a line in /etc/fstab (on you Ubuntu host, not on the rootfs of your target!).

If you followed those instructions thoroughly, nothing should go wrong (famous last words :wink: ).

Issues your can encounter, and a few questions I had:

  • My compilation stops with an error at nodejs: this means that your shell is still dash, not bash, double-check!

  • I am lost, things are wrong, how do I start over?: delete your “build” directory, delete ~/.oe/, delete git_config and subversion_config if those directories exist in setup-scripts, logout, login again, and start over. Avoid deleting the “sources” directory and in particular the sources/download which contains a cache of all the archives that have already been downloaded, this will save you a lot of bandwidth and time when starting over.

  • By the way… where are the results of those bitbake commands? They are in build/tmp-angstrom_2010_x-eglibc/deploy and its subdirectories: images, ipk, licenses. The cloud9-image target creates a “.img” file which you can zcat to your microSD device directly. The systemd-image target creates a bunch of pieces you have to assemble to create the disk image, this goes beyond the scope of this post.
    Hoping this was useful to some!

Ed