Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
econcz authored Aug 23, 2024
1 parent 7d6ad17 commit 93e343d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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_\<arch\> 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) 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!
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_\<arch\> 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 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:
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)"
Expand All @@ -10,7 +10,7 @@ sudo debchroot —-install
sudo debchroot -—setup
```

After this, simply run **ampl**, **gams**, **stata**, **xstata**, **stata-se**, etc., **texmacs**, and **crossover** (CrossOver has to be run "outside the chroot", therefore please use the provided 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).
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 \<architecture\>, \<user\>, and \<path\> with the required values, e.g., **amd64**, **$(whoami)** (or your username if run under root) and **/usr/local/bin/**:

Expand All @@ -26,9 +26,9 @@ sudo debchroot "echo hello world"
sudo debchroot "host 'echo this runs a command under host'"
```

**NB** The instructions on how to avoid password in **host** are provided in **sudo chroot --help**.
**NB** The instructions on how to avoid password on running the **host** command under chroot are provided in **sudo chroot --help**.

**PS** A 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.
**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 `# <!-- concrete apps -…->` and `# <!-- /concrete apps -…->`.

Expand Down Expand Up @@ -74,5 +74,5 @@ PS to speed up chroot, you may want to add this line to your crontab

**If something doesn't work, please post the error into issues**.

**Buy me a coffee if you like the script!**
**Buy me a coffee via a donation if you like the script!**
[paypal.me](https://www.paypal.com/paypalme/IBOLOTOV?country.x=CZ&locale.x=cs_CZ)

0 comments on commit 93e343d

Please sign in to comment.