1. Working Emdebian build environment

1.1. Introduction

This scratchbox-based environment is intended for building emdebian [1] packages. It uses scheme based on emdebian STAG framework ideas [2]. It can also be used for making root filesystem images out of emdebian packages.

This is an attempt to share Nokia experience of Nokia 770 development and building bootable root filesystem images using emdebian packaging scheme.

Embedded Debian(Emdebian) is a project to make Debian GNU/Linux a mainstream choice for embedded projects.

This was taken from emdebian website [4] as an explanation of one of the project's ideas: "We need a scheme that allows emdebian to stay in sync with Debian as much as possible, whilst having fine control over package generation. To do this we need to keep emdebian package modifications in each package, maintained by package maintainers as much as possible." [4]

One of the implementation of this scheme is STAG embedded framework [2] The idea is to have a separate emdebian directory included into debian source package, i.e. to have a possibility to make both debian and emdebian packages out of the same source package. STAG proposes patched version of dpkg and debhelper packaging tools packages using emdebian directory instead of debian.

This enviroment is used STAG ideas, but a bit different way. It also offered patched debian packaging tools, but modifications allow developer to make both emdebian and debian packages using the same tools. It can be done by changing DEBIAN_DIR environment variable. Moreover, it's possible to have even more debian-like directories and have more than one type of packages built from the same sources.

This implementation uses scratchbox as a cross-compilation environment. It includes modified scratchbox, emdebian development rootstrap, set of about 40 emdebianized debian packages and 3 root filesystems built out of these packages: minimal, dpkg+apt, dpkg+apt+xserver. Rootfses have been tested on Nokia 770 device. Only basic tests like booting, ability to loging and get working shell, working apt and dpkg and xserver depending on image.

Project infrastructure includes svn source repository, debian package repository filled by emdebianized packages and downloadable rootfs and rootsrtap images.

Please note that this is a work in progress and any kind of help/feedback/suggestionsfrom emdebian developers is more than welcome. If you're interested in this you can look at the TODO list at the end of this document.

1.2. Initial setup

First of all it's assumed that you have Debian installalled on your PC. This is a requirement. At least all this environment was developed and tested on Debian.

All you need for building is to install and configure scratchbox environment, configure scratchobox target, install development rootstrap into this target. Below is explanations of the setup in details.

1.2.1. Setting up scratchbox environment

1.2.1.1. Installing scratchbox packages

        deb http://repository.maemo.org/ emdebian/tools glibc[[BR]]
        deb-src http://repository.maemo.org/ emdebian/tools glibc[[BR]]

     $ sudo apt-get update

     $ sudo apt-get install scratchbox-core scratchbox-libs scratchbox-devkit-debian scratchbox-doctools

     $ sudo apt-get install scratchbox-toolchain-arm-gcc3.4.cs-glibc scratchbox-toolchain-i686-glibc_0.9.8.5 scratchbox-toolchain-arm-gcc3.4.cs-uclibc

     $ sudo /scratchbox/sbin/sbox_adduser 

1.2.1.2. Creating new scratchbox target

     $ scratchbox

     [sbox-HOST: ~]> sbox-config -ct 

     [sbox-HOST: ~]> sbox-config -st 

     [sbox-target: ~]> sbox-config -cc
     [sbox-target: ~]> sbox-config -cf

1.2.1.3. installing development rootstrap inside scratchobx:

     $ scratchbox

     [sbox-target: ~]> wget http://repository.maemo.org/emdebian/configurations/arm-glibc-emdebian-dev/arm-glibc-emdebian-dev-rootstrap.tgz

     [sbox-target: ~]> sbox-config -er arm-glibc-emdebian-dev-rootstrap.tgz

1.2.2. Svn source repository

1.2.2.1. Repository location

1.2.2.2. Repository layout

1.2.2.3. How to check out source from repository:

     $ scratchbox

     [sbox-target: ~]> svn co https://stage.maemo.org/svn/emdebian/

1.3. Building packages

   $ scratchobox

   [sbox-target: ~]> export DEBIAN_DIR=emdebian

   [sbox-target: ~]> cd emdebian/target/trunk/

   [sbox-target: ~]> svn-buildpackage -rfakeroot -uc -us -sa -D

1.4. Root filesystem creation

1.4.1. initial setup

     $ sudo apt-get install rootimagescripts

1.4.2. Rootstrap creation using emdebian package repository

     $ scratchbox

     [sbox-target: ~]> cd emdebian/configurations/
     [sbox-target: ~]> make_rootimage.sh -p arm-glibc-nokia770-apt/packages -o arm-glibc-nokia770-apt/arm-glibc-nokia770-apt --jffs --rootfs --genlists -f

     [sbox-target: ~]> make_rootimage.sh -p arm-glibc-nokia770-minimal/packages -o arm-glibc-nokia770-minimal/arm-glibc-nokia770-minimal --jffs --rootfs --genlists --strip=all -f

1.4.3. Rootstrap creation using local directory with packages

     $ scratchbox
     [sbox-target: ~]> cd emdebian/configurations/

     [sbox-target: ~]> mkdir workarounds
     [sbox-target: ~]> cp *.deb workarounds/

1.5. TODO list

1.6. References


CategoryEmdebian