ptitSeb / box86

Box86 - Linux Userspace x86 Emulator with a twist, targeted at ARM Linux devices
https://box86.org
MIT License
3.36k stars 233 forks source link

binfmt configuration not registered on Debian (sid) #419

Open CalcProgrammer1 opened 3 years ago

CalcProgrammer1 commented 3 years ago

I have installed both Box86 and Box64 on my Rock Pi 4B (Armbian Sid) and then used multiarch support to install i386 mesa-utils. The expectation is that glxgears would run without calling 'box86 glxgears'. Instead, I get exec format error.

I fixed it by making the following files:

/usr/share/binfmts/box86.conf:

package box86
interpreter /usr/local/bin/box86
magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff

/usr/share/binfmts/box64.conf:

package box64
interpreter /usr/local/bin/box64
magic \x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff

Seems Debian uses a different format than what box86/64's installer puts in /etc/binfmts.d.

After rebooting, I can open i386 applications without manually invoking box86.

ptitSeb commented 3 years ago

I use the format that seemed official: https://man7.org/linux/man-pages/man5/binfmt.d.5.html

My lsb_release -a gives me "Ubuntu 20.04 focal" That's strange the format just evolved and is not compatible? How should I do to support both?

EDIT This seems to be the update-binfmts format : https://manpages.debian.org/testing/binfmt-support/update-binfmts.8.en.html

Still unsure how to handle both formats.

CalcProgrammer1 commented 3 years ago

Looks like it might be two different systems then, systemd's binfmt capability and binfmt-support. They appear to have different formats. Perhaps just install both, or maybe test to see which directory exists (/etc/binfmt.d or /usr/share/binfmts).

DarkevilPT commented 11 months ago

@CalcProgrammer1 where did that came from? and where/how can we keep that "hack" updated? that helps also to get steam running on arm64 versions of chromiumos.