emdebian logo
 

About Emdebian
 Emdebian & Debian
 Purpose
 Customisations
 Flavours
 Extending Emdebian
 Tdeb support

Cross toolchains
 Toolchain packages

Emdebian Crush
 Packages
 Root Filesystem
 Build Tools
 Autobuild Report
 Repository Key
 Crossbuild bugs
 Packaging bugs

Emdebian Grip
 Packages
 Repository Key
 Packaging bugs

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!

 
   

Emdebian rootfs

The root filesystem is a basic set of packages needed to provide a usable login environment around a kernel and kernel modules. The rootfs must be extensible to a full system so normal packaging tools need to be supported.

The main Debian root filesystem is based on 'Essential' - a collection of packages that contain: Essential: yes in debian/control and although small in Debian terms, it is still much too large for Emdebian.

Emdebian uses several methods to reduce this size:

  1. Drop the Essential tag

    dpkg and apt have special behaviour for packages that contain the tag - tending to bring in the rest of the entire Debian 'Essential' set. Emdebian therefore removes all 'Essential' tags from cross built packages to provide full flexibility. (This also means that you should test your new rootfs thoroughly as there is no guarantee that your list of packages actually works. emsandbox supports creating a chroot on the embedded device to provide for such testing.)

  2. Drop perl

    perl is huge (in embedded terms) but removing it has other consequences. Emdebian packages need patching to replace perl maintainer scripts and prevent calls to perl scripts from 'Essential' packages from postinst or prerm shell maintainer scripts. (The irony is that emdebian-tools is written, principally, in perl. emsandbox and associated scripts are written in shell and only use the perl support in emdebian-tools for operations on the build machine.)

  3. Replace debconf

    debconf is written in perl so cdebconf can be used to replace it, written in C. cdebconf needs a little careful handling - it is not actually expecting to be installed without debconf so Emdebian builds a new package from the debconf source that includes the non-perl components and initialises the debconf template database.

  4. Replace coreutils

    busybox can implement most of the functionality of coreutils. Note that Emdebian has had problems getting the busybox implementation of dpkg to work with apt. Hence, the Emdebian busybox package does not implement dpkg, Emdebian uses the Debian dpkg, cross-built for Emdebian.

Other methods yet to be investigated include:

  • Replace glibc (libc6) with uclibc
  • Split the gconv data into individual packages along with the zoneinfo data from tzdata and finish development of a userspace tool that installs and updates translations for only those zones that are configured on that one device.
  • ipkg can be a smaller alternative to dpkg and apt

Emdebian Rootfs packages

debootstrap method

The current Emdebian rootfs uses debootstrap - the same tool as Debian itself. There are limitations with using debootstrap but it is familiar to those using Debian (or Debian-derivative distributions) already.

To reduce the workload on the target device, the standard debootstrap method has been altered for Emdebian. This is called the unpacking method. debootstrap is still used to create the first part of the eventual system but each .deb is unpacked using dpkg, without running any maintainer scripts. Other adjustments are then made to the debootstrap environment to support booting without packages that would normally be available in Debian (like perl). The modified first stage install process of debootstrap results in an almost complete filesystem with no .deb packages remaining.

debootstrap requires that there is at least a nominal split between "base" and "required" packages and it is advisable to retain a similar split as with normal debootstrap - "required" for packages that debootstrap can unpack directly and "base" for packages that need to be unpacked separately.

The actual list of packages used for any particular run of emsandbox can change between releases of emdebian-tools and can be customised for specific machines and machine variants. The following should be read as an example of a working rootfs, not as a definition of what emsandbox would provide for your rootfs.

Required

busybox dash dpkg libstdc++6 libgcc1 libc6 cdebconf libdebian-installer4 zlib1g libnewt0.52 libslang2

Base

apt gpgv libncurses5 libreadline5 readline-common mktemp debconf-shell debianutils makedev base-passwd whiptail gnupg udev

Sources

busybox dpkg glibc gcc-4.2 cdebconf ncurses mktemp libdebian-installer zlib apt gnupg readline5 debianutils makedev base-passwd newt slang2 udev debconf

Creating the rootfs

Emdebian expects that most users will want to customise their rootfs and the packages contained in the basic rootfs outlined above are being continually updated as new versions are uploaded to Debian. Therefore, there is no static link to a downloadable root filesystem for Emdebian.

Instead, emdebian-tools includes emsandbox which sets up debootstrap to create a basic Emdebian rootfs. emsandbox also supports customisation through a system of machine variants - a default set for a particular machine and custom sets of variants of that machine.

emsandbox works from prebuilt binary packages and so creating a root filesystem requires that the full set of packages have already been cross built for Emdebian and are available in a repository that debootstrap can use. Currently, Emdebian hosts prebuilt binary packages for ARM. If you want a different architecture or packages that have not yet been cross built for Emdebian, use emsource and emdebuild to create the packages and then create your own repository (e.g. with reprepro).

Configuring the root filesystem

The Emdebian rootfs, as generated by emsandbox is not fully configured - packages are unpacked and certain support files are created but none of the packages are configured (not even the pre-install scripts). This last stage is the only process that must be run on the actual device before the first boot, using the emsecondstage script which requires a working chroot environment. Typically, emsecondstage is run from some kind of minimal bootloader environment that has sufficient support for mounting subsystems like proc and filesystems like the root filesystem partition and can chroot into the root filesystem. This method means that the majority of the work of creating the root filesystem can be done on the build machine.

Using machine:variant customisation, you can choose between:

  1. /usr/lib/emdebian-tools/emdebian.crossd - a minimal emsandbox rootfs that is similar to a typical Debian debootstrap environment but over 80% smaller,
  2. /usr/lib/emdebian-tools/emdebian.gtk - a larger rootfs with libgtk2.0-0 and dependencies but no GUI applications and
  3. /usr/lib/emdebian-tools/emdebian.gpe - a full Emdebian GUI environment using the GNOME Palmtop Environment and including applications like a calendar, todo list, text editor, games, expenses, contact manager, image preview and system configuration.

Set the script you want to use (which could also be one of your own) in the packages.conf machine:variant customisation file:

...
SCRIPT=/usr/lib/emdebian-tools/emdebian.gpe


See the emdebian contact page for information on contacting us.

Last Modified: Wed, Sep 10 02:31:14 UTC 2008
Copyright © 2000-2008 The Embedded Debian Project;
Emdebian is an offical subproject of Debian.