also, there is additional mechanism used by Termux, it does not require root-level commands
should be faster than full VM for compiling, but might not work for testing /proc/self pointing at wrong image? also ALSA still not work if called under qemu-user, last I checked)Installing packagesThe binfmt-support package contains a helper script to easily register/unregister binary formats with the kernel using the binfmt_misc module.Install qemu, binfmt-support, and qemu-user-static:# apt install qemu binfmt-support qemu-user-staticCheck whether the binfmt entries were successfully registered:# update-binfmts --displayThis command should print entries for each supported target user emulator, except for the host system.===see appendix if you already have chroot folder with arm systemor try to use Raspbian's one froma bit involved when it comes to image resizing...===Note: If the host system is Debian Buster and the chroot will be Debian Bullseye, it is good to make sure the host has the version 5.2 of qemu-user-static, available from buster-backports. Otherwise some binaries may cause qemu-user-static to Seg Fault, see 987497. For example setting locale(s) in chroot fails without the upgrade of qemu-user-static.{..}sudo losetup -f -P --show 2020-08-20-raspios-buster-arm64.img Mounting the imageMount the image with root permissions:sudo mount /dev/loop0p2 -o rw /mntOptional: If you want to mount the RaspiOS /bootsudo mount /dev/loop0p1 -o rw /mnt/bootAlso mount necessary host directories.cd /mntsudo mount --bind /dev dev/sudo mount --bind /sys sys/sudo mount --bind /proc proc/sudo mount --bind /dev/pts dev/pts(not necessary/advised if you use systemd-nspawn)To get everything work (e.g., network) you need to comment out everything in /mnt/etc/ld.so.preload before you chroot in. Take care of that now!(not sure if copying qemu binary into chroot still needed on latest Debian?)cp /usr/bin/qemu-aarch64-static /mnt/usr/binor qemu-arm-static for armhfNow chroot in!cd /mnt(not needed if we already in mnt?)sudo chroot . bin/bashnow you can try to get git sources and install usual deps for Cin-gg compilation from inside arm/aarch64 chroot and see how far it comes!===