| 5 | | Description at [https://www.slind.org/Documentation:Internals_Guide SLIND wiki]. |
| | 5 | cross-shell creates rootfs for non-native CPU architectures without using qemu or other emulator. |
| | 6 | |
| | 7 | == Principle of operation == |
| | 8 | |
| | 9 | 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. |
| | 10 | |
| | 11 | == Implementation == |
| | 12 | |
| | 13 | * `cross-shell` package. Contains `cross-bs(1)` and `cross-shell(1)`, for bootstrapping and running programs in target rootfs. |
| | 14 | * `libfakechroot-cross` package. Contains `libfakechroot-cross.so` library, which adjusts paths in many system calls and executes proper binaries, by using `LD_PRELOAD` mechanism. |
| | 15 | |
| | 16 | Unfortunately, this approach needs the support in other packages as well: |
| | 17 | * `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. |
| | 18 | * `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. |
| | 19 | |
| | 20 | More information is at [https://www.slind.org/Documentation:Internals_Guide SLIND wiki]. |