emdebian logo
 

About Emdebian
 Emdebian & Debian
 Purpose
 Customisations
 Flavours
 Extending Emdebian
 Localisation support
 Emdebian Tdebs

Cross toolchains
 Toolchain packages

Emdebian Crush
 Packages
 Build Tools
 Repository Key
 Installation Guide

Emdebian Grip
 Packages
 Repository Key
 Update logs
 Installation Guide

Documentation
 Introductory Guide
 Emdebian Wiki
 Emdebian FAQ
 Packaging rules
 Packaging infrastructure
 Packaging guideline
 DebConf paper

Support
 Contact Us
 Mailing List Archives

Help Emdebian
 Developers' Info
 Subversion
 ToDo list

News

History
 Slind
 Stag
 Emdebsys

Links
 Emdebian Bootldr
 Emdebian Kernel
 Emdebian JTAG
 Scratchbox
 QEmu
 CELF

Valid HTML 4.01!

 
   

[ Installing toolchains ] [ Cross building ] [ Mixing Emdebian and Debian ]


Emdebian Howto (continued)

Building a rootfs

emsandbox

Emdebian has a set of binary packages that can be used to create a basic root filesystem for an embedded device. More packages are being added as the tools and support develops, with the aim that a full Gtk+2 GUI can be available using the GPE Palmtop Environment and the Gnome libraries.

Unlike the Debian debootstrap environment, upon which emsandbox is based, Emdebian will need a variety of root filesystems and a variety of installation tarballs. emsandbox includes support for such customisations on a machine specific or machine variant specific basis.

Gradually, Debian packages are including patches contributed by Emdebian to ease cross-building and the Emdebian toolset is also expanding to allow easier updates to the latest version in Debian unstable.

emsandbox started as a test script to reduce the number of packages required for a Debian bootstrap process. The cross-built Emdebian packages are smaller than the Debian equivalents and the dependencies have been modified to allow emsandbox to avoid bulky packages like perl.

Using emsandbox to customise debootstrap

emsandbox uses Emdebian packages and a native chroot via 'debootstrap --foreign' and code from pbuilder. The native chroot is intended to support testing of a rootfs and package installability. edos-debcheck can check if an Emdebian package is installable according to the dependencies but the test chroot is needed to ensure that the maintainer scripts operate normally and that systems can upgrade the packages cleanly.

emsandbox creates a chroot for the target architecture, not the architecture of the system running emsandbox. This has some important results:

  • The chroot is an Emdebian system running an Emdebian rootfs e.g. using busybox. Perl and debconf are not available inside the chroot (cdebconf replaces debconf).

  • Initially, emsandbox only supports creating the chroot, other options like login and update would require some form of emulator. The expectation at this time is that the user will copy or install the created rootfs onto a device that can execute the installed binaries. Once installed, the binaries do not need to be executed from emsandbox. emsandbox is a work-in-progress.

  • emsandbox supports customising the list of packages that are used to create the initial rootfs. The default apt source for the chroot is already set as deb http:://www.emdebian.org/emdebian unstable main but can be altered by the user to include a Debian mirror. Such mixed systems do have potential problems, covered later.

  • Using configuration files in your Emdebian working directory, emsandbox can add extra packages to your rootfs, replace the default emdebian suite script with your own, replace the mirror used by the final system, use a proxy to load the packages and set a custom tarball name. Future versions will include additional support for other common case situations.

  • Customisations can be machine specific (variant = default) and then further customised for variants of that device.

Customising emdebuild with machine variants

more than one version of busybox router/PDA plain native minimised builds buildd init setup (initng?) packages not in Debian could have their own source in our repository. emdebuild remove .svn if using patches from machine variants.

Likely customisations include:

  • set up devices (mtd, sd, fb, ttyS0-2)
  • Create /etc/network/interfaces for eth0 etc using dhcp
  • Add /etc/securetty to ttyS1 and ttyS2 to allow root logon (may be disabled later.)
  • Set /etc/hostname - probably needs user configuration in case a lucky person has more than one board. :-)
  • Work out sensible defaults for /etc/fstab.
  • Set /etc/passwd or /etc/shadow root password.
  • /dev/random pointed at /dev/urandom so ssh keys can be generated.
$ sudo emsandbox --create --machine balloon

Installing the Emdebian rootfs

Initially, the root filesystem created by emsandbox is likely to be installed only as a chroot on the embedded device - i.e. where an existing Debian system already exists. The intention is that as the Emdebian root filesystem develops, it will eventually supplant the Debian one and become much easier to use.

emsandbox can use configurations that use dpkg instead of busybox but busybox is out-of-step with apt and the default emsandbox configuration uses dpkg as well as busybox. This also means that the emsandbox can use the filtering support being enabled upstream in dpkg.

Filtering makes it possible to control a wide range of devices from a set of metapackages that include customised scripts for specific board / device combinations. Depending on a unique reference for a particular board or device, the emdebian packages will use dpkg to selectively install (or replace) scripts and configuration files as well as patches during package installation. In a similar fashion to the existing Debian installer, the Emdebian installer should be a single component capable of installing Emdebian on any device that can run Emdebian. It is hoped that the experience of the Debian Installer team and the debian-live team can be brought to bear on the Emdebian installer to improve the coverage and usability of the installation process.

The use of busybox still means that the second stage of debootstrap needs a little careful handling. The emsecondstage script wraps the debootstrap commands, the busybox package itself has been patched for Emdebian to improve installation and the debootstrap suite-script (/usr/lib/emdebian-tools/ emdebian.crossd) ensures that the modified busybox install can proceed.

In the text below, $TARGET represents the directory containing the emsandbox tarball and into which the tarball can be extracted.

emsandbox prepares a cross-compiled executable built from pkgdetails.c in the debootstrap source and installs it into the debootstrap directory, ready for the second stage of the installation.

Outline of the rootfs outside a chroot

In a similar manner to the installation of Familiar onto an iPAQ, the bootloader is used to copy the root filesystem to the device. In each of the uploading options below you will then need to initiate an xmodem transfer of the appropriate file using your terminal software when prompted with "ready for xmodem download.." (ctrl-A, S on minicom, for example). When loading the root file system, do not unzip the file before loading, load the .gz file directly.

Currently untested

The following section is almost entirely theoretical but will become part of the Emdebian rootfs usage once the creation of a chroot is simplified.

For updated information on specifics of the Balloon board, see the balloonboard wiki.

  • Connect up a serial console and power (not battery)
  • reset the board (reset button on board, or power switch) then hit a key within 10 seconds to get a 'boot>' prompt
  • Load a new bootloader with 'load bootldr'
  • Load a new kernel with 'yaffs write zImage' or 'load boot', depending on the filetype.
  • Load a new rootfs with 'load root'

[ Installing toolchains ] [ Cross building ]


See the emdebian contact page for information on contacting us.

Last Modified: Mon, Dec 8 06:25:13 UTC 2008
Copyright © 2000-2008 The Embedded Debian Project;
Emdebian is an offical subproject of Debian.