necrose99 / Arm64-Linux-prep

docker pre-prep-container for managerial scripts... , emulation bits.
GNU General Public License v2.0
1 stars 0 forks source link

wrong mask in registered architectures? #1

Open timcoote opened 6 years ago

timcoote commented 6 years ago

This may be irrelevant from the point of view of the repo, but I found the binfmt registrations in Arm64-Linux-prep/register.sh very useful, so I thought that I'd mention it.

In that file (register.sh), I think that this line: echo ':aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64:' > /proc/sys/fs/binfmt_misc/register

may have the wrong mask in byte 8, so it maybe ought to be: echo ':aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64:' > /proc/sys/fs/binfmt_misc/register

gcc is an example program that breaks the original pattern. Trying to run it results an Exec format error. The eighth byte in gcc is 0x03, rather than 0x00.

necrose99 commented 6 years ago

https://wiki.gentoo.org/wiki/Embedded_Handbook/General/Compiling_with_qemu_user_chroot

Often easier to register wine binfmt , and others on local host. However getting dockerhub to grind on arm64 with emulation... and work.. priceless... And the holy grail. And building pkgs much easier...

Gentoo rpi3 sakai also has a wrapper for qemu as well.

However I ve had scaleway. So native arm64... rock64 also known to run docker.. Kinda let this backburner for a bit.

I'll take a run at fixing or pull request away.

necrose99 commented 6 years ago

updated based on new wiki data added units... etc.

timcoote commented 6 years ago

Excellent to get more links. I think that I need to chase upstream. If my change is correct and the gentoo wiki is wrong, I'll ping when I confirm it.