need to make sure debootstrap is installed
|Deletions are marked like this.||Additions are marked like this.|
|Line 17:||Line 17:|
|sudo apt-get install qemu-arm-static||sudo apt-get install qemu-arm-static debootstrap|
The binfmt-misc module in the kernel makes it possible to execute binaries of foreign arches under linux. Qemu can use this fact to enable several architecture specific execution environments in userspace without the need to run a kernel of the target architecture. ARM EABI support is included in the 0.11.x release used in ubuntu karmic today.
To make use of this feature to build chroots, qemu needs to be build as a static binary. A binary package called qemu-arm-static exists in the karmic universe repository now. The package contains such a static binary, automatically enables the binfmt configuration, sets the proper sysctl variables and ships a wrapper script to debootstrap called build-arm-chroot.
Note that the way the qemu userspace emulation is implemented makes it act like a translation layer for syscalls, the syscalls between ARM and x86 systems do not match 1:1 so you still might see some that are not properly translated by the patches (mono packages specifically do not work here). While the setup below works fine, it should not be trusted for critical work (do not use it to implement a buildd if you plan to rebuild the whole distro for example, its fine for home use to do testbuilds of packages or rolling chroots for creating root filesystems that you want to run on real hardware later on though)
Setting up an ARM chroot on your x86 machine
To use an arm eabi enabled chroot on your i386 system, install the qemu-arm-static package from karmic's universe repository ...
sudo apt-get update sudo apt-get install qemu-arm-static debootstrap
And create the chroot with the included debootstrap wrapper script (it takes/requires the same options debootstrap uses)
ogra@osiris:~$ build-arm-chroot karmic eabi-chroot [sudo] password for ogra: I: Retrieving Release I: Retrieving Packages ... I: Base system installed successfully. arm-eabi chroot successfully created in eabi-chroot ogra@osiris:~$ sudo chroot eabi-chroot root@osiris:/# uname -m armv5tel
Now you can build/test packages etc, the chroot works like any other x86 chroot on your system as long as you have the qemu-arm-static package installed with the advantage that you can make use of all resources your host system provides (CPU speed, RAM, diskspeed etc)