Open Embedded

OpenEmbedded is a cross-compiling toolchain and system builder, using then Angström linux distribution. It typically builds packages in ipkg format.

Preliminary Notes

The OpenEmbedded development environment for the Zipit 2 is constantly being worked upon. Please post questions/comments in the OpenEmbedded Forum.

Subversion Access

The subversion repositories are available for anonymous access at:

To check out:

  • svn co http://linux.zipitwireless.com/svn/zipitforge/openembedded

Write access is granted to registered members.

Getting the latest OpenEmbedded Image for the Zipit 2

Here's a few steps to download and prepare the latest SVN release of the OpenEmbedded base image for the Zipit 2 without needing to compile everything yourself. This is just the latest SVN pull (r59 at the moment) packaged with scripts needed to flash a mini-SD card to run it on the device.

The precompiled base image by itself isn't extremely useful on its own, you'll want to build a few extra packages (such as wpa_supplicant) along with it to do much. It's here to speed things along, and to help present the work done so far.

  1. Download the latest SVN (r59) build.
    wget http://linux.zipitwireless.com/attachment/wiki/OpenEmbedded/z2_oe_base-image_svn_r59.tar.gz?format=raw -O z2_oe_base-image_svn_r59.tar.gz
    
  2. Extract the files and move to the working directory.
    tar -xvf z2_oe_base-image_svn_r59.tar.gz
    cd z2_oe_base-image_svn_r59
    
  3. Finally, flash the base image to a mini-SD card with the next command. Please read the README for SD card flashing. Without doing so, you could potentially destroy your entire system.
    ./prepSDcard.pl --partitions --fatroot=fatroot.zip --tarball=base-image-zipit2.tar
    
  • The boot process should just take a couple minutes. If it is hanging on you, try replacing base-image-zipit2.tar with an older one here.
  • Also, there's a reset pinhole button on the left side of the Zipit 2. It may prove helpful.

Now just turn on the Zipit 2 with the mini-SD card inserted to use the OpenEmbbeded image.

Running OpenEmbedded on Your System

To get OpenEmbedded running on your system to compile the software you need, use the following steps.

  1. First, make sure you have all the prerequisites for your distro of Linux. All the information is available at OpenEmbedded's OE and Your Distro page.
  2. Pull the latest SVN from the repository into your home directory with these commands:
    cd
    svn co http://linux.zipitwireless.com/svn/zipitforge/openembedded
    
  3. Run the Makefile to pull the OpenEmbedded Zipit 2 tree, and also patch support into it for the "zipit2" machine like so:
    cd ~/openembedded
    make
    
    • Pay attention to the notes printed out after running the Makefile. If needed, it will describe the extra lines needed to add the OpenEmbedded software references to your BASH shell.
  4. Next, create the proper symlinks within the "build" directory:
    cd ~/openembedded/build
    cd conf ; ln -s local-zipit2.conf local.conf ; cd ..
    cd machine ; ln -s `pwd`/zipit2.conf ../../org.openembedded.dev/conf/machine/
    
  5. Now the installation is complete. You should then be able to build the basic OpenEmbedded image for the first time with this command:
    cd ~/openembedded
    bitbake base-image
    
  • Building the base-image package takes about 2 GB of space.
  • Be aware, there are a number of additional, supporting, packages which may need to be installed onto your development system. One package that bitbake will not complain about not finding, but needs to be installed, is the static glibc development lib (libc.a) aka: glibc-static-devel
  • Be aware that bitbake will take a long time to build the image. Build time on an Intel Q6600 (Quad4) on a 64bit Linux o/s, RAID-0 volume, with 8Gig of RAM, 15Mb/s cable modem, is about 59 minutes, YMMV.
  • Bitbake runs parallel processes when doing the build, the build may fail due to scheduling. Try invoking a second time to see if it continues running past the failure point.
  1. Finally, you will want to flash the base image to a mini-SD card with the next command. Please read the README for SD card flashing. Without doing so, you could potentially destroy your entire system.
    cd ~/openembedded
    ./zipitZ2BBfiles/fatroot/prepSDcard.pl --partitions --fatroot=zipitZ2BBfiles/fatroot/fatroot.zip --tarball=tmp-zipit2-angstrom/deploy/glibc/images/zipit2/base-image-zipit2.tar
    

Setting up wireless

  1. Use bitbake to build the wireless packages
    bitbake wireless-tools
    bitbake wpa-supplicant
    
  2. Copy wireless-tools_*.ipk and wpa-supplicant_*.ipk from the tmp-zipit2-angstrom/deploy/glibc/ipk/arm-oabi/ directory to the SD card's ext2/3 partition
  3. Boot the device to the SD card. Log in and and run the following commands to get wireless capability.
    ipkg install wireless-tools_*
    ipkg install wpa-supplicant_*
    
    • Unencrypted network: Use iwconfig to associate, though wpa_supplicant could work as well
    • WEP/WPA/WPA2 network: Edit /etc/wpa_supplicant.conf to match your wireless network settings, then run something like the following to test whether it works.
      wpa_supplicant -Dwext -c /etc/wpa_supplicant.conf -ieth0
      
    • Notes:
      1. Sometimes the first access to the wireless extensions kernel interface fails. Rerunning the appropriate command usually helps.
      2. wpa_supplicant sometimes generates messages that aren't really errors. For a WPA/WPA2 network, watch for CTRL-EVENT-CONNECTED in the output, or run wpa_cli status and look for "Supplicant PAE state=AUTHENTICATED" along with "suppPortStatus=AUTHORIZED".
      3. wpa_supplicant takes over the terminal; to exit, Ctrl-C can be sent by combining the Alt, "...", and C keys.
      4. Adding -B to wpa_supplicant will run it in the background, but you won't be able to see any of the messages it generates. Use wpa_cli to talk to the supplicant and get status details.
  4. Run the following to get a DHCP lease:
    udhcpc -i eth0
    
    • ...Or configure the IP and routes manually via:
      ip addr add dev eth0 a.b.c.d/e
      ip route add default via w.x.y.z
      
  5. Give root a password to be able to log in via ssh (ssh wouldn't work for me until a password was assigned):
    passwd
    
  6. SSH into the device, to be sure it works. For convenience of installing packages later on, you may want to set up a package repository.

Getting rotate X11 to work

  1. Build the kdrive package.
    bitbake xserver-kdrive
    
  2. Use scp to copy the various .ipk files from the gtk and xserver-kdrive builds to the device if you do not have your package repository up.
    • List of the packages I needed, including "recommended" packages:
      1. glibc-gconv-iso8859-1, glibc-gconv
      2. libreadline4, ncurses-terminfo, ncurses
      3. I copied gtk+_*.ipk over, then tried to install them. I then pulled each of its dependencies across as ipkg complained about them. This was way too many packages to list here (lots of X libraries, for instance).
      4. xserver-kdrive, then hal-info, hal, libdbus, libdbus-glib, libfontenc1, libpixman, libts, libxfont1, pointercal, tslib-conf, udev-utils, xserver-kdrive-fbdev
      • I also installed lots of python-* packages, and python-pygtk/python-pygobject/python-pycairo/libglade, but those won't be needed unless your program is Python and uses PyGtk.
  3. Install all the .ipk files that you haven't done yet (I installed as I copied)
  4. Copy and install whatever X client program you want to run, and any of its dependencies
  5. Now create a script to launch the X server and the client program. Make sure it does at least the following:
    export DISPLAY=:0.0
    Xfbdev -screen 240x320@90 -hide-cursor -br &
    
  6. Run the client program
    • You may have to sleep a bit after running Xfbdev in the background, before you start the client program. If Xfbdev hasn't started listening yet, client programs obviously can't use it. My Python program takes a while to start up, so in my case this wasn't necessary.
  7. When the client program exits, so will the X server. (If you get a segfault from the server on exit, I'm not sure what the cause is, but I'm not too worried about it.)
  8. If you get an X server error, your screen may still be rotated strangely. "echo 3 > /sys/class/graphics/fbcon/rotate" from the ssh session should help. Also, "ps" and "kill" may be useful (e.g. if your client program won't die). You will not have a window manager, so normal window decorations will not be present!

Automagic Package Installation

Instead of copying packages back and forth on your SD card, you can use OE's packaging system to install packages and their dependencies on the fly. As OE build's packages on your machine, you can add them to a package repository list. The Zipit 2 can then install these packages for you. To find all the packages that can be created, browse to your "~/openembedded/org.openembedded.dev/packages" directory. In there are tons of bitbake recipes (*.bb) that describe packages to install.

Package Repository Setup

First, you'll need to set up a web host for package retrieval.

  1. You'll need a web server. I used Apache 2. To make the packages accessible to the web server, you can make a link to the default directory where Apache hosts content. Remember to replace "your username" and "your OE directory" with the corresponding folder names.
    ln -s /home/"your username"/"your OE directory"/tmp-zipit2-angstrom/deploy/glibc/ipk /var/www/zipit
    
    • If you do not have Apache installed, or any other web server, a quick hint for Debian systems is to run:
      apt-get install apache2
      
  2. Next, change directory to the root of your OE directory and run the following command:
    bitbake package-index
    
    • If you build new packages after running that command, you'll need to rerun it to update the repository each time.

Configuring the Zipit 2

Next, you'll need to set up the client to search for packages at your new host. Make sure the Zipit is connected to a wireless network, and SSH to it to complete these steps.

  1. First, move the old IPKG configuration files out of the way.
    cd /etc/ipkg
    mkdir old
    mv *.conf old/
    
  2. Then you'll want to create four new configuration files. Use your favorite text editor, such as vi, to create the following files with their respective contents in the current directory (/etc/ipkg). Remember, replace "your IP" with the IP address of your repository host.
    • arch.conf
      arch all 1
      arch any 6
      arch arm-oabi 21
      arch zipit2 26
      
    • all-feed.conf
      src all http://"your IP"/zipit/all
      
    • arm-oabi-feed.conf
      src arm-oabi http://"your IP"/zipit/arm-oabi
      
    • zipit2-feed.conf
      src zipit2 http://"your IP"/zipit/zipit2
      
  3. Finally, run the following command to retrieves the latest package list onto the Zipit 2:
    ipkg update
    
    • If your repository contains any new packages since the last time you ran the "ipkg update" command, you'll need to run the "ipkg update" command again to see them.

Now all you'll need to do is run the IPKG "install" command to install your latest packages, like so:

ipkg install "name of package"

Attachments