timower / rM-docker

Docker images for emulating the remarkable 2
GNU General Public License v3.0
8 stars 3 forks source link

Allow allocating more CPU/memory #9

Open Eeems opened 11 months ago

Eeems commented 11 months ago

It would be useful if the run_vm.sh script allowed overriding the cpu core count and the memory allocation. Automated build processes using this image would benefit from more resources.

timower commented 11 months ago

Honestly, for CPU intensive work, it might be worth setting up user mode qemu emulation. The system mode emulation is heavy, but allows us to run xochitl easily. The SOC is limited to 2 cores, so enabling more won't be possible without changing SOCs.

https://www.qemu.org/docs/master/user/main.html + a sysroot (maybe even from the official sdk). Or something like https://github.com/tonistiigi/binfmt to auto-run qemu user mode in a docker container might be a better solution

timower commented 11 months ago

The user mode branch now has a qemu-user target that uses user mode emulation (see Readme). toltec doesn't install though:

43aa0b46792f: ~/ echo "04a28483286f88c5c7f39e352afb62adc57f6162a29fd7e124d832205bb0980e  bootstrap" | sha256sum -c && bash bootstrap
bootstrap: OK
INFO:  Fetching secure wget
INFO:  Bootstrapping Opkg
2023-10-08 19:30:20 URL:https://bin.entware.net/armv7sf-k3.2/installer/opkg [752476/752476] -> "/home/root/.local/bin/opkg" [1]
2023-10-08 19:30:21 URL:https://toltec-dev.org/stable/rmall/toltec-bootstrap_0.2.2-1_rmall.ipk [6667/6667] -> "/tmp/toltec-bootstrap_0.2.2-1_rmall.ipk" [1]
INFO:  Installing Toltec and Entware
Mounting '/home/root/.entware' over '/opt'
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
ERROR: Unexpected error on line /home/root/.local/bin/toltecctl:107 in function add-bind-mount
ERROR: This script failed to install. If you can't solve the above
       issue yourself, please report it at:

           <https://github.com/toltec-dev/toltec/issues>

       (Please also include these error logs to help solving the
       problem faster. Thank you!)
Removing mount over '/opt'
umount: /opt: must be superuser to unmount.
Eeems commented 11 months ago

Using systemd as the init is required for toltec to work, as it's heavily assumed in most of the packages.