termux / proot-distro

An utility for managing installations of the Linux distributions in Termux.
GNU General Public License v3.0
1.8k stars 208 forks source link

[Feature]: Ability to set proot's built in qemu flag #418

Closed jsonmona closed 4 months ago

jsonmona commented 5 months ago

Feature description

proot has flag to run every guest executables with certain emulator. It can help with lack of binfmt_misc.

A flag to pass the argument would be useful.

Although manual says QEMU, it is compatible with any software like binfmt_misc.

proot manual:
-q *command*  Execute guest programs through QEMU as specified by *command*
sylirre commented 4 months ago

That is already built-in.

User needs to choose an architecture and based on choice, proot-distro will automatically select appropriate QEMU user mode emulator.

jsonmona commented 4 months ago

No. I do not want qemu because I have actual aarch64 binaries in the rootfs. wine is the only i386 binary I have in my rootfs. I'm trying to use box86 emulator, which requires both i386 library AND aarch64 library to be present.

With that being said, I'll test if -q flag indeed works in this scenario. Although box86 fallback to execute natively on non-i386 binary, I'm worried if proot will try to run box86 even on that fallback path, causing an infinite loop.

zavocc commented 4 months ago

proot's -q argument only accepts qemu, since it passes certain qemu-user parameters anyway when executing a foreign binary inside proot

sylirre commented 4 months ago

@jsonmona You seem don't get the purpose of -q flag. This flag requires you to specify QEMU user mode emulator. When everything done properly, it enables you to run programs made for foreign architecture that matches specified QEMU emulator.

Foreign architecture usage explained in https://github.com/termux/proot-distro?tab=readme-ov-file#installing-a-distribution.

jsonmona commented 4 months ago

Ah, I see. I should've tested things before creating an issue. Thanks you all for clarifying! ❤️