https://github.com/econcz/debchroot
Run your Linux and Wine-based i386 (x86)/amd64 (x86_64) apps on armhf/arm64 (aarch64) devices!
https://github.com/econcz/debchroot
arm64 armhf chroot chroot-script i386 x11 x86-64
Last synced: 7 months ago
JSON representation
Run your Linux and Wine-based i386 (x86)/amd64 (x86_64) apps on armhf/arm64 (aarch64) devices!
- Host: GitHub
- URL: https://github.com/econcz/debchroot
- Owner: econcz
- License: mit
- Created: 2024-08-20T22:52:12.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-23T18:49:35.000Z (about 1 year ago)
- Last Synced: 2025-01-12T06:25:10.190Z (9 months ago)
- Topics: arm64, armhf, chroot, chroot-script, i386, x11, x86-64
- Language: Shell
- Homepage:
- Size: 41 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# debchroot
With this **highly configurable bash script** you can enable your 32-bit/64-bit Raspberry Pi, Orange Pi, Arduino UNO, ASUS Tinker Board S R2.0, etc., as well as Android/Harmony OS-based devices (root access required) with ARM architecture support 32-bit/64-bit x86_64 applications, such as every version of **AMPL**, **GAMS**, **Stata**, **TeXmacs**, or **Wine/CrossOver** software, with **a single command**. The script creates a minimal Debian/Ubuntu-based chroot in /var/chroot_\ mirroring your user's home folder and bind-mounting all directories matching '\~/\*', together with the '~/.config/\*' (this allows to run the same app, e.g., Calibre, on different architectures with shared configuration and can be turned off if needed). Technically, you can create multiple chroots, each with a different architecture (so far, one for each architecture), an open filesystem (in contrast to **docker**), and a shared X11 server, including a /var/chroot_arm64 on an x86_64 machine (or /var/chroot_armhf on an x86 one). The apps in chroot are then run with the help of **QEMU** (AMPL, GAMS, Stata, TeXmacs, etc.) and **box86/box64** (Wine/CrossOver, box86 and box64 need to be compiled by you following an easy manual) binary format configurations. The **crossover** command allows both binfmt configurations to co-exist, i.e., you can launch your Stata (TeXmacs) and EndNote (or a Steam game) on your device simultaneously with one short command/single click!This repository provides several pre-configured versions of the script for these five cases: a) AMPL, b) GAMS, a) Stata (which is, by default, configured with *evince* as the Stata manual viewer in chroot, please install it in host as well), b) TeXmacs, and c) Wine/Crossover. The AMPL, GAMS, and Stata-specific versions of the script search for files matching '\*ampl\*gz', '\*gams\*exe', '\*stata\*gz\*', and '\*crossover\*.deb' (string case irrelevant) in the user's home directory. If you are interested in using the script, put the script file into **/usr/local/bin/** or **~/.local/bin**, an appropriately-named installer (if required) into **~**, and run these commands in your terminal:
```bash
chmod 0755 "$(which debchroot)"
sudo debchroot —-help
sudo debchroot —-install
sudo debchroot -—setup
```After this, simply run **ampl**, **gams**, **stata**, **xstata**, **stata-se**, etc., **texmacs**, or **crossover** (CrossOver has to be run "outside the chroot", therefore please use the provided *crossover* script). Please note that GAMS Studio and AMPL IDE do not work under chroot, neither does, e.g., [SDMX.jar](https://github.com/amattioc/SDMX) in Stata (I found a workaround though).
To avoid typing **sudo debchroot --setup** every session, you can add this line to your user's or root's crontab, replacing \, \, and \ with the required values, e.g., **amd64**, **$(whoami)** (or your username if run under root) and **/usr/local/bin/**:
```bash
@reboot sleep 60; sudo ARCH= CHROOT_USER= /debchroot --setup
```For advanced uses, such as to start a shell (bash) session and to run a command, simply type **sudo debchroot** and **sudo debchroot "cmd"**, for example:
```bash
sudo debchroot
sudo debchroot "echo hello world"
sudo debchroot "host 'echo this runs a command under host'"
```**NB** The instructions on how to avoid password on running the **host** command under chroot are provided in **sudo chroot --help**.
**PS** A single line in crontab, changing the priority (*niceness*) of selected processes, can significantly increase the speed of QEMU-run chroots, please follow the instructions in **sudo chroot --help** to set it up. However, TeXmacs performs the worst in all cases.
**PS** The **debchroot** script is divided into sections, please add all your custom code into the ones labeled `#