cross-shell
Purpose
cross-shell creates rootfs for non-native CPU architectures without using qemu or other emulator.
Principle of operation
In order to run maintainer scripts during generation of rootfs, shadow rootfs for the native CPU architecture is generated. Binaries from this shadow rootfs are used when some program is about to run during generation of target rootfs.
Implementation
- cross-shell package. Contains cross-bs(1) and cross-shell(1), for bootstrapping and running programs in target rootfs.
- libfakechroot-cross package. Contains libfakechroot-cross.so library, which adjusts paths in many system calls and executes proper binaries, by using LD_PRELOAD mechanism.
Unfortunately, this approach needs the support in other packages as well:
- glibc need to be patched (debian/patches/any/rtld-allow-specifying-argv0.diff) in order to be able to run foreign binaries correctly. See the src/execve.c in fakechroot-cross source code.
- dpkg need to be patched (debian/patches/02-cross-shell-architecture-override.patch), as dpkg's architecture is compiled in during build time, so it needs to be explicitly overriden.
More information is at SLIND wiki.
