Building and Setup Ångström Distribution from Scratch

Building and Setup Ångström Distribution from Scratch

Building and setup Ångström distribution from scratch Host platform: Ubuntu Desktop 10.10 Target platform: Olimex CS-E9302 Development board 1. Overview Å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 binaries 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 Bitbake handles the parsing and execution of the data files. The data itself is of various types; recipes which give details about particular pieces of software, class data which is an abstraction of common build information (e.g. how to build a Linux kernel) and configuration data for machines, policy decisions, etc., which acts as a glue and binds everything together. Bitbake knows how to combine multiple data sources together, each data source being referred to as a layer. Bitbake is responsible for parsing the metadata, generating a list of tasks from it and then executing them. The most common usage is bitbake packagename where packagename is the name of the package you wish to build (from now on called the target). This often equates to the first part of a .bb filename, so to run the simple- package_1.2.3.bb file, you might type bitbake simple-package. Several different versions of simple-package might exist and bitbake will choose the one selected by the distribution configuration. Bitbake will also try to execute any dependent tasks first so before building simple-package it would build a cross compiler and glibc if not already built. The Metadata (recipes) are .bb files that are usually referred to as 'recipes'. In general, a recipe contains information about a single piece of software such as where to download the source, any patches that are needed, any special configuration options, how to compile the source files and how to package the compiled output. Class (.bbclass) files contain information which is useful to share between metadata files. An example is the autotools class which contains the common settings that any application using autotools would use. The configuration (.conf) files define various configuration variables which govern what Poky does. These are split into several areas, such as machine configuration options, distribution configuration options, compiler tuning options, general common configuration and user configuration (local.conf). 2. Setup OpenEmbedded toolchain First of all you may want to install some useful packages(if you haven’t installed them already). Next commands have to be executed as root user. apt-get install nano mc openssh-server lrzsz htop Now you can work on SSH terminal. Required software for OpenEmbedded can be found at OE host distributions wiki. Check that /bin/sh (ls -l /bin/sh) is not symbolically linked to dash. "dash" is a POSIX compliant shell that is much smaller than "bash" -- however some broken shell scripts still make use of bash extensions while calling into /bin/sh. To work around this issue call dpkg-reconfigure dash and select No when it asks you to install dash as /bin/sh. If you don’t want to use packages from repository, you can build them manually from source. For this purpose check all OpenEmbedded Required Software or use special script for Ubuntu distribution I prefer to use packages from Ubuntu universe repository. So let’s start with installing of necessary packages: apt-get 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 Then we have to install some supplementary packages: apt-get install libxml2-utils xmlto python-psyco OPTIONAL: following packages and their dependencies need to be installed in order to build the bitbake documentation (warning: over 160MB of installed packages). apt-get install docbook Building and setup Ångström distribution from scratch page 2 of 54 This package is necessary to build some packages (in particular the esound documentation needs it). NOTE: If you are building in container (LXC/OpenVZ) check presence of loadkeys tool (/bin/loadkeys). If there is no loadkeys, install console- tools package. apt-get install console-tools Finally we have to install automake and autoconf packages apt-get install automake autoconf autoconf2.13 autoconf-archive gnu-standards autoconf-doc libtool gettext Now we have all needed packages for using OpenEmbedded toolchain. 3. Setup Ångström environment First we have to create directory where to setup an environment. My choise is /angstrom in root directory, but you are free to use whatever you want mkdir /angstrom We have to change owner of directory – all other commands have to be executed as non root user. In this case I’ll use user named user chown user.user /angstrom Now login as non root user: su – user Building Ångström includes a setup script - go to the the setup-scripts repository and clone it, the URLS are on top of that page. You should end up doing something like: git clone git://git.angstrom-distribution.org/setup-scripts /angstrom Next step is to define our target machine and start updating process MACHINE=cs-e9302 ./oebb.sh update After executing of script – OpenEmbedded and BitBake will be obtained. Also script creates a environment file with all needed path variables. This file is stored in user home directory. It’s recommended to execute this in user profile. Edit file ~/.bashrc. nano ~/.bashrc and add following line in the end of file: . ~/.oe/environment-2008 Restart your terminal. Check if everything is fine by typing: bitbake --version Building and setup Ångström distribution from scratch page 3 of 54 You should see something like BitBake Build Tool Core version 1.12.0, bitbake version 1.12.0 To complete process we have to run first building of package(image) using the Angstrom script. I choose to build nano package MACHINE=cs-e9302 ./oebb.sh bitbake nano After a wait we already have the basic structure. It should looks like picture below: 4. Custom bbfile repository In next steps we will make custom bbfile repository in order to make modifications in distributions and recipes without any change in OpenEmbedded repository. OpenEmbedded, Bitbake and packages sources are stored in /angstrom/sources directory. Let's create our custom repository mkdir /angstrom/sources/local bbfile collections exist to allow the user to have multiple repositories of bbfiles that contain the same exact package. Edit the configuration file nano /angstrom/build/conf/local.conf and add the following in the end of file BBFILES =+ "/angstrom/sources/local/recipes/*/*.bb" BBFILE_COLLECTIONS = "local oe" BBFILE_PATTERN_local = "/angstrom/sources/local" BBFILE_PRIORITY_local = "5" BBFILE_PATTERN_oe = "/angstrom/sources/openembedded" BBFILE_PRIORITY_oe = "0" BBPATH =. "${BBFILE_PATTERN_local}:" I suggest to comment out the following line INHERIT += "rm_work" This option will keep all temporary files in process of recipes building. Another option for custom bbfile repositories is bitbake layers. bitbake has a powerful mechanism called layers which provides a way to handle this Building and setup Ångström distribution from scratch page 4 of 54 extension in a fully supported and non-invasive fashion. It is easy to add the layers path to the BBLAYERS variable in your bblayers.conf. # LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf # changes incompatibly LCONF_VERSION = "1" BBFILES ?= "" # Add your overlay location to BBLAYERS # Make sure to have a conf/layers.conf in there BBLAYERS = " \ /angstrom/sources/local \ /angstrom/sources/openembedded \ " Bitbake parses the conf/layer.conf of each of the layers in BBLAYERS to add the layers packages, classes and configuration. To create your own layer, independent of the main OpenEmbedded repository, you need only create a directory with a conf/layer.conf file and add the directory to your bblayers.conf. BBFILES =+ "${LAYERDIR}/recipes/*/*.bb" BBPATH =. "${LAYERDIR}:" BBFILE_COLLECTIONS =+ "local" BBFILE_PRIORITY_local = "10" BBFILE_PATTERN_local = "^${LAYERDIR}/" 5. Building linux kernel We are going to build the latest version of linux kernel (2.6.37) for cs- e9302 target platform. However our machine configuration couldn't be found at OpenEmbedded linux recipes for latest kernel version Building and setup Ångström distribution from scratch page 5 of 54 Next few steps demonstrate process of configuring and building latest linux kernel in Angstrom distribution. First build the kernel normally with bitbake by running this command: bitbake virtual/kernel This will create a source directory in /angstrom/build/tmp- angstrom_2008_1/work/cs-e9302-angstrom-linux-gnueabi/. In this case it will be /angstrom/build/tmp-angstrom_2008_1/work/cs-e9302-angstrom-linux- gnueabi/linux-2.6.24-r46/ Add the following file in your build configuration directory nano /angstrom/build/conf/site.conf and add preferred version of linux kernel PREFERRED_VERSION_linux ?= "2.6.37" Next we will add some patches to the kernel. We want ADC and LED driver support which can't be found in main stream of linux kernel. All patches will be added in the following directory /angstrom/sources/local/recipes/linux/linux-2.6.37 Bitbake must know for our patches, so we have to edit file /angstrom/sources/local/recipes/linux/linux_2.6.37.bb and add the following lines SRC_URI_append_cs-e9302 = " \ file://ep93xx_adc_driver.patch \ file://ep93xx_adc_driver_my.patch \ file://ep93xx_leds.patch \ " ep93xx_adc_driver.patch could be downloaded from here.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    54 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us