Rechercher une page de manuel

Chercher une autre page de manuel:


Langue: en

Version: Sun 11 Jan 2009 19:55:45 GMT (debian - 07/07/09)

Section: 1 (Commandes utilisateur)


emsetup - Check your system for Emdebian cross-build support.


emsetup [[-a] | [--arch] ARCH] [[-s] | [--simulate]] [[-y] | [--yes]] [[-v] | [--verbose]] [[-q] | [--quiet]]
emsetup [[-a] | [--arch] ARCH] [--report]
emsetup [[-a] | [--arch] ARCH] [--download] VERSION
emsetup [[-h] | [--help]] [[--version]]



checks your system for Emdebian compatible cross-build support and determines some defaults for other emdebian-tools scripts. Run this before other emdebian-tools scripts, using the simulate option to see what changes may be needed. If a usable toolchain is already installed, emsetup exits without making any changes.

emsetup uses apt-cross to determine the latest versions of toolchain packages.

Use --report to see the package names that emsetup has checked or installed for the default or specified architecture.

If emsetup identifies that a suitable toolchain exists in Emdebian but is not installed, edos-debcheck can be used to check that the toolchain packages are installable by calling emsetup with the --report option.

Sometimes, emsetup can fail to find a suitable toolchain even if one does exist. This can be due to problems with apt-cross or because the default compiler in Debian has recently changed and the toolchains are waiting to catch up. See What to do next.


-a|--arch ARCH

Override the dpkg-cross default architecture.
emsetup tries to determine the current default architecture setting of dpkg-cross - managed by debconf in dpkg-cross (>= 1.33). Prior to version 1.33, dpkg-cross used ~/.dpkg-cross/cross-compile, copied from /etc/dpkg-cross/cross-compile and manually edited to update the default_arch:
 # default architecture for dpkg-cross (to avoid always typing the -a option
 # if you do cross installations only for one architecture)
 # default_arch =


Summarise the changes required to enable cross-building for your selected architecture on this system without making any changes, then exit. emsetup will run through each of the checks and determine if you need an additional source in /etc/apt/sources.list. If you choose to add this source manually, ensure you run 'sudo apt-get update' before restarting emsetup. Next, emsetup will output a list of toolchain packages that are needed to build your chosen architecture on this system. If these packages are not available in the current emdebian toolchain repository, emsetup will output a hint about using emchain. Packages that are available but not installed can be checked for installability using the --report option to emsetup.
-s is ignored if --report is used.


Proceed with the toolchain installation without getting a prompt from the apt-agent (either apt-get or aptitude according to debconf or ~/.apt-cross/emsource preferences).


View the status of packages that emsetup has either installed or checked to support cross-building for the default or specified architecture. If the required packages are not installed, emsetup prints a list of the package names that were checked and runs edos-debcheck to test that the toolchain packages are installable on your system. If edos-debcheck reports that any toolchain packages fail, please ask for help on the debian-embedded mailing list:, attaching the emsetup report.

--download VERSION

Sometimes, the Emdebian toolchains get behind the version of gcc in Debian itself and problems in the later version of gcc could mean that it does not build cleanly so emchain cannot fill the gap. In this situation, there will be a delay in providing an updated Emdebian toolchain for the new version. emsetup will attempt to install the previous version of gcc.
Download mode can also help you, a little bit. VERSION specifies the version of gcc that you want to be able to use, e.g. for gcc-4.2, specify 4.2. The relevant gcc packages for your selected architecture are downloaded from the Emdebian repository. Supporting packages are downloaded using apt-cross. Packages that are already installed are omitted.
With the necessary files available, emsetup can do no more for you - see dpkg-cross (1) for information on how to build suitable cross packages from the foreign binaries. Use dpkg --force-depends on the packages that have the correct architecture. (e.g. to build for ARM on amd64, use dpkg-cross on the ARM packages and dpkg --force-depends on the amd64 packages.)
It is best to use dpkg-cross -b not dpkg-cross -i because it is very likely that you will need to use sudo dpkg --force-depends -i to actually install most (all?) of the toolchain packages. This part of the process needs to be done manually because if an automated method was likely to work, --download would be unnecessary. Other packages may also be necessary, these should be downloaded using apt-cross, using --force if an old version is already installed.
If this method still fails, ensure that you use:
 $ sudo apt-get -f install

to try to tidy up the mess left behind.

Even if the installation succeeds, it is worth checking the installation with the above command or you may come up against problems with installing other packages.

Consquences of forced toolchain installation
empdebuild will not be able to use the same method (without an amount of manual hacking of an existing empdebuild chroot). This is not really a problem - forced toolchain installations are intended to be the exception, not the rule. The lack of clean chroot build support should act as a disincentive to upload cross built packages to repositories, until such a time as a full Emdebian toolchain becomes installable.


be verbose. -v can be repeated to increase verbosity, up to a maximum of three times. When running emsetup directly, it is recommended to use at least one -v option.


be quiet (default) - can also be used to reduce verbosity set using -v.


Since emsetup was written, auto-building of binary toolchains for Debian machines has improved substantially and is largely automated. It is therefore usually possible to install an existing toolchain even if emsetup fails to find the latest toolchain.

The problem for emsetup is that it doesn't know which version to try to find. If the default version of gcc in Debian has changed, emsetup may get confused until the toolchain build has caught up. In this situation, you can install a binary toolchain manually, by specifying the previous version of gcc in Debian instead of needing emchain. e.g. for armel using the gcc-4.3 compiler:

 $ sudo apt-get install libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi gcc-4.3-arm-linux-gnueabi g++-4.3-arm-linux-gnueabi 

Usually, this can be shortened to:

 $ sudo apt-get install gcc-4.3-arm-linux-gnueabi g++-4.3-arm-linux-gnueabi 


In some circumstances (e.g. inside a chroot), hostname -f fails and emsetup reports an error about being unable to determine the fully qualified hostname. This usually occurs because of an old /etc/hosts file.

Example 1.1. Fixing hostname for mybox.mydomain

The typical fix is to add an extra line to fix the hostname configuration. Substitute mybox with your short hostname (use hostname -s or simply copy the first line of /etc/hosts). If you have a local domain, specify it instead of mydomain. If you have no local domain, use localdomain: mybox.mydomain mybox

If the chroot will only ever be used on the same system that created the chroot, it is sometimes sufficient to copy the /etc/hosts file from the host system verbatim into the chroot. If you need to copy that debootstrapped environment onto another machine as an installation, you will need to fix hostname -f properly.

If your /etc/hosts is missing or if the extra line does not complete the fix, you will need to find out how to fix hostname -f before emsetup can work. The actual changes necessary for this task are beyond the scope of emdebian-tools or emsetup.

AMD64 VS I386

emsetup checks to see if a toolchain is necessary by comparing the requested cross build architecture against the host architecture. If the two are the same, no toolchain is necessary and emsetup does the other tasks and simply exits.

i386 and amd64 are a special case where it is possible to prepare an i386 chroot on amd64 (and vice versa) and build within that chroot using a normal toolchain. How to set up such a chroot is beyond the scope of this manpage but feel free to add to the m[blue] Emdebian Wikim[][1] content.

i386 vs 486 vs 586 vs 686

In Debian, the various x86 flavours are treated equally so there is generally no need to have particular toolchains for 686 or 586, just one for i386. If this causes problems, ask on the m[blue]debian-embedded@lists.debian.orgm[] mailing list.


You will need the deboostrap utility and at least 250Mb of free space (not including the builds that you want to do inside the chroot). Create a new directory that is writable by a normal user:

 $ mkdir ./debian-chroot

Download a minimal Debian setup: (can take a bit of time)

 $ sudo debootstrap sid ./debian-chroot

Change into the chroot and install emdebian-tools:

 $ sudo chroot ./debian-chroot
 sh # apt-get update
 sh # apt-get dist-upgrade
 sh # apt-get install emdebian-tools

Now continue with emsetup as before.


emsetup uses the Debian Bug Tracking System for bug management. Known bugs can be found at m[blue][] and new bugs filed using:

 $ reportbug emdebian-tools


emsetup was written by Neil Williams

This manual page was written by Neil Williams


See also apt-cross (1), dpkg-cross (1), em_make (1), emdebian-tools (1).



Neil Williams

Debian and Emdebian developer.


Emdebian Wiki
Ces qualités du Corps qui n'en peuvent être séparées, je les nomme
qualités originales et premières, qui sont la solidité, l'étendue, la
figure, le nombre, et le mouvement, ou le repos, et qui produisent en
nous des idées simples, comme chacun peut, à mon avis s'en assurer par
soi-même. Il y a, en second lieu, des qualités qui dans le Corps ne
sont effectivement autre chose que la puissance de produire diverses
sensations en nous par le moyen de leurs premières qualités,
c'est-à-dire, par la grosseur, figure, contexture et mouvement de leurs
parties insensibles, comme sont les couleurs, les sons, les goûts, etc.
Je donne à ces qualités le nom de secondes qualités.
-+- John Locke (1632-1704), Essai sur l'entendement humain -+-