Poky

Introduction
Poky is a embedded Linux distribution focused on mobile and handsets. Poky is built using OpenEmbedded. It is a complete software development environment for the creation of Linux devices. Poky aids the design, development, building, debugging, simulation and testing of a complete & modern software stack using Linux, the X windowing system and GNOME Mobile based application frameworks.

If you are inside Texas Instruments, you might be interested in Poky for TI Developpers, note that it is an intranet link restricted to people inside TI network.

System setup
References on OE, Bitbake, Poky etc can be found in Technical References page

Requirements
Install a Linux distribution in a PC. Ubuntu 9.10 is recommended. Install some necessary libraries by typing in the console: $ sudo apt-get install build-essential python diffstat texinfo texi2html cvs subversion wget gawk help2man $ sudo apt-get install bitbake python2.4-dev python-dev git-core gnupg corkscrew quilt curl flex bison $ sudo apt-get install xsltproc tofrodos python-psyco socket mercurial

Make a shared directory and change permissions to give read/write/execution permissions to appropriate users: $ sudo mkdir /usr/share/oe $ sudo chown -R $USER /usr/share/oe $ sudo chmod 775 /usr/share/oe


 * In Ubuntu, bash has been replaced by dash, which is a lighter version of bash. However using dash can cause some subtle build issues when building all the various packages required by Poky since some scripts out there use some specific bash features not available in dash... As such please use bash instead. To switch from dash to bash, run the following command, and select 'No' in the window that appears"

$ sudo dpkg-reconfigure dash


 * Ubuntu 9.10 upgrades tar to 1.22. This should be rolled back to 1.20 in order for build to work.

$ sudo apt-get install gcc-4.3 g++-4.3 $ sudo rm /usr/bin/gcc $ sudo rm /usr/bin/g++ $ sudo ln -s /usr/bin/gcc-4.3 /usr/bin/gcc $ sudo ln -s /usr/bin/g++-4.3 /usr/bin/g++
 * Ubuntu 9.10 installs gcc 4.4, but it is incompatible with some Poky components. You have to roll back to gcc 4.3.

Configuring tools (subversion, wget, git)
Set proxy host and port in subversion editing /etc/subversion/servers file if you want to have system-wide config, or ~/.subversion/servers if you want to have user-specific configuration.

$ sudo gedit /etc/subversion/servers (or ~/.subversion/servers) …   #[group1] http-proxy-host =  http-proxy-port =  …   [global] http-proxy-exceptions = *.xyz.com http-proxy-host =  http-proxy-port =  …

Set proxy host and port in wget editing /etc/wgetrc file if you want to have system-wide config, or ~/.wgetrc if you want to user-specific configuration.

$ sudo gedit /etc/wgetrc (or ~/.wgetrc) http_proxy = http://: ftp_proxy = http://:

Configuring GIT Proxy
Configure git proxy creating the script: $ gedit ~/bin/git-proxy.sh    #!/bin/sh exec corkscrew   $*

Change permission to execute it   $ chmod a+x ~/bin/git-proxy.sh

Configure git to use this script $ git config --global core.gitproxy ~/bin/git-proxy.sh

For multiple git proxies, see GIT Proxies

ARM Cross Compiler
CodeSourcery cross-compiling toolchain is needed. Depending on the TI release, it is either version 2008q3 or 2009q1. The toolchain can be downloaded from: CodeSourcery.

Downloading Poky
Export POKYSRC variable (place where you want Poky source)‏, change to that directory and download source $ export POKYSRC="place_where_you_want_poky_source" $ cd $POKYSRC $ svn co -r 5728 -q http://svn.o-hand.com/repos/poky/trunk poky Export POKY variable: $ export POKY=$POKYSRC/poky

Configuring Poky
Two files (local.conf and site.conf) inside $POKY need to be configured before starting to build Poky. There are TI sample files located in meta-texasinstruments/conf/misc that can be copied to the poky/build/conf directory. (In the site.conf if DL_DIR is commented out all the source tarballs used for the build will be accessed and stored in the poky/sources directory.) It is possible to build for a Zoom2 or a Zoom3 board, so select the appropriate board:

build/conf/local.conf  ... BBFILES = "\   ${OEROOT}/meta/packages/*/*.bb" BBFILE_COLLECTIONS = "normal extras" BBFILE_PATTERN_normal = "^${OEROOT}/meta/" BBFILE_PATTERN_extras = "^${OEROOT}/meta-extras/" BBFILE_PRIORITY_normal = "5" BBFILE_PRIORITY_extras = "5" BBPATH = "${OEROOT}/meta:${OEROOT}/meta-extras" ... PARALLEL_MAKE = "-j 4" ... MACHINE ?= "zoom2" MACHINE ?= "zoom3" ... DISTRO ?= "poky" ...

build/conf/site.conf ... CVS_PROXY_HOST =  CVS_PROXY_PORT =  ... GIT_PROXY_HOST =  GIT_PROXY_PORT =  ... ...
 * 1) DL_DIR = "/usr/share/oe"

Recipe to build Zoom2
This is currently built from a private branch. This has a new zoom2.conf board configuration file that specifies board characteristics, and a new Linux kernel recipe linux-omap3-pm_git.bb which builds Kevin Hilman's PM branch (latest) for your board.

git clone git://git.pokylinux.org/poky-contrib.git

This will create a poky-contrib directory and inside it the meta data for building poky will be found. Switch to the branch (origin/mturquette/zoom2) that has the Zoom2 recipe

git branch -a (this will list all the branches available) git checkout -b zoom2 --track origin/mturquette/zoom2

The "git branch -a" command will list something like this:

marcin/pinky origin/HEAD origin/marcin/elroy origin/marcin/pinky origin/marcin/trunk origin/mrchapp/beaglemm origin/mturquette/zoom2
 * zoom2

Now you're in the Zoom2 branch.

Building Poky
Have the local.conf and site.conf files configured above copied into build/conf.

Initialize the build environment running the script source poky-init-build-env

Build Poky bitbake poky-image-sato

Poky filesystem will be available in /build/tmp/deploy/images folder

Troubleshooting
/proc/sys/vm/mmap_min_addr is not 0. This will cause problems with qemu so please fix the value (as root). sudo sysctl -w vm.mmap_min_addr=0

Poky Debugging
To get poky build with debug symbols modify the local.conf as follows

DEBUG_BUILD = "1"

Debugging with GDB
You can run GDB directly on target but in case it crashes with the error "libthread_db.so.1 cannot be found" which makes thread aware debugging not to work from gdb, and seems to prevent remote debugging with gdbserver altogether. This file can be found in $POKY/build/tmp/staging/armv7a-none-linux-gnueabi/lib/libthread_db.so.1 and should be copied to the /lib directory of your target filesystem.

using gdbserver
Using gdbserver allows remote debugging from the PC. To use gdbserver:

on target:

# gdbserver ip_addr_pc*:1234** program [args.....]


 * ip_addr_pc: the IP address given is of the host computer which you will be running gdb on.
 * 1234 is the port number, make sure you give the same port number at the target end

on PC:

Go to the path arm-2008q3/bin/arm-none-linux-gnueabi-gdb path and run

(gdb) target remote ip_addr_board***:1234


 * ip_addr_board:It is the IP address of your board)

'set solib-absolute-prefix' lets you to specify the path to the rootfs so GDB can find the library files.

=Community Release= It is a software release to the OMAP Linux community. It is based on L23.i3.x release with much of the TI code coming from the open source code. In addition, it will have software binaries from TI for OMAP HW acceleration & connectivity integration. The intent of the community release is to enable OMAP community to leverage the power of the platform.

=Subscribe to e-mail lists=

First, and very important suggested step, subscribe to the Poky e-mail lists for the community:

For Community Poky List: send an e-mail to: [mailto:poky+subscribe@openedhand.com poky+subscribe@openedhand.com] You can leave in blank the subject and body message. Upon receiving a confirmation e-mail, reply to it.