How to get the Angstrom distribution

From IGEP - ISEE Wiki

Redirect page
Jump to: navigation, search

How to get the Ångström distribution

The Ångström distribution is a Linux distribution for a variety of embedded devices. Ångström was started by a small group of people who worked on the Openembedded, Openzaurus and Opensimpad projects to unify their effort to make a stable and userfriendly distribution for embedded devices like handhelds, set top boxes and network-attached storage devices and more. All Ångström images are built using Openembedded. Openembedded offers a best-in-class cross-compile environment. It allows developers to create a complete Linux Distribution for embedded systems. Some of the Openembedded advantages include:

  • Support for many hardware architectures
  • Multiple releases for those architectures
  • Tools for speeding up the process of recreating the base after changes have been made
  • Easy to customize
  • Runs on any Linux distribution
  • Cross-compiles 1000's of packages including GTK+, Qt, the X Windows system, Mono, Java, and about anything else you might ever need

Overview of How-To

This How-To is meant to be a starting point for people to learn build and run Ångström images for IGEP v2 devices as quickly and easily as possible.

This How-To works with the Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine but most of the contents are valid also for other GNU/Linux distributions. We do not issue any guarantee that this will work on other distributions.

This How-To will start out by a Openembedded Setup Environment introducing you to the Openembedded environment and the way you can build an Ångström-based image.

Next, we will cover the Ångström images supported.

Lastly, we will learn how to Installing and Using the Result on a NFS-mounted root filesystem.

Requirements

  • Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine

Feedback and Contributing

At any point, if you see a mistake you can contribute to this How-To.

References

Much of this How-To is extracted from different sources. If you would like to read some of the original articles or resources, please visit them and thank the authors:

Openembedded Setup Environment

In order to function properly, the Virtual Machine need some adaptations of the development system.

The first thing we need to do is set Bash as default sh shell, execute

$ sudo dpkg-reconfigure dash

and answer no when asked whether you want to install dash as /bin/sh. So, now, "/bin/sh" file links to "/bin/bash" (not to "/bin/dash").

An other change we need to perform is to change some default settings of the kernel. Edit the /etc/sysctl.conf file as root with your preferred editor and set the vm.mmpap_min_addr to 0

$ sudo nano /etc/sysctl.conf
vm.mmap_min_addr = 0

then, run this command

$ sudo sysctl -p

Install extra packages necessary for bitbake to function.

$ sudo apt-get update
$ sudo aptitude install subversion cvs git-core \
       build-essential help2man diffstat texi2html texinfo \
       libncurses5-dev gawk python-dev python-psyco python-pysqlite2 \
       scrollkeeper gnome-doc-utils gettext automake

Openembedded is available from a GIT repository located at git://git.openembedded.net/openembedded. The first thing you will do is clone the Openembedded project.

$ git clone git://git.openembedded.net/openembedded

or for the firewall challenged try

$ git clone http://repo.or.cz/r/openembedded.git

After that, you need to create an user configuration (local.conf). The configuration file who defines various configuration variables which govern what Poky platform does.

$ cd openembedded
$ mkdir -p build/conf

And create with your preferred editor the build/conf/local.conf file, the result will be like this:

#sh
# Other supported machines
MACHINE = "igep0020"

TARGET_FPU = "hard"

DISTRO ?= "angstrom-2008.1"

# Where to store sources
DL_DIR ?= "${OETREE}/downloads"

# Which files do we want to parse:
BBFILES += "${OETREE}/recipes/*/*.bb"

BBMASK = ""

# Uncomment this to specify where BitBake should create its temporary files.
# Note that a full build of everything in OpenEmbedded will take GigaBytes of hard
# disk space, so make sure to free enough space. The default TMPDIR is
# <build directory>/tmp
TMPDIR = "${OETREE}/build/tmp-${MACHINE}"

CACHE = "${TMPDIR}/cache"

# What kind of images do we want?
IMAGE_FSTYPES = " tar.bz2 "

ENABLE_BINARY_LOCALE_GENERATION = "0"

# INHERIT += " rm_work "

# Make sure you have these installed
ASSUME_PROVIDED += "gdk-pixbuf-csource-native imagemagick-native librsvg-native"

# Make use of SMP and fast disks
# PARALLEL_MAKE = "-j4"
# BB_NUMBER_THREADS = "4"

At this point the Openembedded build environment needs to be set up, you will do this with the oe-init-build-env script. Sourcing this file in a shell makes changes to PATH and sets other core bitbake variables based on the current working directory.

#!/bin/sh
OETREE=`pwd`

BBPATH=${OETREE}:${OETREE}/build/
PKGDIR=${OETREE}/build/
DL_DIR=${OETREE}/downloads

# Kill off the TERMINFO variable, as glibc will grab its contents in its 'make
# install' if set
unset TERMINFO
# kill this so we don't link non-arm libraries
unset LD_LIBRARY_PATH

PATH=${OETREE}/bitbake/bin:${PATH}

export PATH LD_LIBRARY_PATH BBPATH OETREE

# Stop multi byte characters breaking the patcher stuff - This is for Redhat / Fedora people really
export LANG=C
# Kill PYTHONPATH as otherwise the Python specified there will conflict with
# python-native.
unset PYTHONPATH
# Don't allow custom GConf schema paths to get into the system
unset GCONF_SCHEMA_INSTALL_SOURCE

echo
echo "### Shell environment set up for OE builds. ###"
echo

cd $PKGDIR
export BB_ENV_EXTRAWHITE="MACHINE DISTRO OETREE ANGSTROM_MODE ANGSTROMLIBC LIBC"

Lastly install the bitbake program into your openembedded tree. Download the latest stable version (1.8.18) from http://developer.berlios.de/projects/bitbake/ and untar.

$ tar xzf bitbake-1.8.18.tar.gz
$ ln -s bitbake-1.8.18 bitbake 

Ångström images supported

As discussed above the Openembedded build environment needs to be set up using the following command:

$ source oe-init-build-env

Once the Openembedded build environment is set up, a target can now be built using:

$ bitbake <target>

The target is the name of the recipe you want to build. Common targets are the images (in recipes/images/) or the name of a recipe for a specific piece of software like busybox. More details about the images are listed below with details of what they contain:

  • minimal-image - Ångström minimalist image with ssh access
  • x11-image - The Ångström X11 image.

For example, you will build the Ångström X11 image using the following command:

$ bitbake x11-image

After a long time the complete file system images are placed here,

   tmp-igep0020/deploy/glibc/images/

and any resulting .ipk packages emitted by Openembedded are placed here.

   tmp-igep0020/deploy/glibc/ipk/

7. Installing and Using the Result on a NFS-mounted root filesystem

The target system can NFS-mount its root filesystem from your file server to provide a complete diskless Linux system. The target system will attempt to mount its root filesystem from the server as /srv/nfs/<distro>/<project>/<machine>, where

<distro> where distro is <your distro>
<project> where project is <your project>
<machine> where machine is <your machine>

Create the directory structure and extract the root file system to the NFS server

$ sudo mkdir -p /srv/nfs/angstrom/x11-image/igep0020b
$ sudo tar jxf x11-image-igep0020.tar.bz2 -C /srv/nfs/angstrom/x11-image/igep0020b

After this the only configuration that needs to be added is an entry for your target root directory to your /etc/exports file, for instance like this:

# Angstrom X11 image rootfs
/srv/nfs/angstrom/x11-image/igep0020b       *(rw,no_root_squash,no_subtree_check,sync)

After modifying the /etc/exports file you will make sure the NFS system is notified about the change, for instance by issuing the command:

$ sudo exportfs -a

The target also can get its kernel image from your tftp server. Similar to the NFS root filesystem, the target system will attempt to get its kernel image from the server as /srv/tftp/<distro>/<project>/<machine>. Follow next steps to configure your board and run the your new image.

Create the directory structure and copy the kernel image to the TFTP server.

$ mkdir -p /srv/tftp/angstrom/x11-image/igep0020b
$ cp tmp-igep0020/deploy/glibc/images/igep0020/uImage-igep0020.bin /srv/tftp/angstrom/x11-image/igep0020b/uImage

Then, connect your development board as explained in IGEP v2 Software SDK Manual

Next, power up your board and stop u-boot's autoboot by pressing a key.

Now, it's time to change the U-Boot environment.

U-Boot> setenv distro angstrom
U-Boot> setenv project x11-image

If you want to set as default boot option, you can also save your new environment

U-Boot> saveenv

The last step is run the boot command.

U-Boot> run nfs-boot

--- That's all folks ---

See also