Building for ARM systems

Dan Nicholson nicholson at endlessm.com
Fri Mar 17 17:28:23 UTC 2017


On Thu, Mar 16, 2017 at 8:56 PM, Aleix Pol <aleixpol at kde.org> wrote:
>
> I've been trying it for a bit more, I am getting these contents now,
> still getting the same execvp error message.
>
> # cat /proc/sys/fs/binfmt_misc/qemu-arm
> enabled
> interpreter /usr/bin/qemu-arm-static
> flags:
> offset 0
> magic 7f454c4601010100000000000000000002002800
> mask ffffffffffffff00fffffffffffffffffeffffff

Ah, I lied. I thought that the behavior of the kernel was to make the
new "F" feature default if the flags were not set. Now I actually
tried on yakkety and it fails. Here's my full working test recipe.

# apt-get install qemu-user-static
# update-binfmts --package qemu-user-static --remove qemu-arm
/usr/bin/qemu-arm-static
# echo ":qemu-arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:OFC"
> /etc/binfmt.d/qemu-arm.conf
# systemctl restart systemd-binfmt.service
# cat /proc/sys/fs/binfmt_misc/qemu-arm
enabled
interpreter /usr/bin/qemu-arm-static
flags: OCF
offset 0
magic 7f454c4601010100000000000000000002002800
mask ffffffffffffff00fffffffffffffffffeffffff

The OC aren't to my knowledge needed, but that just maintains the way
that the qemu-user-static set it up with the additional F flag. Now
for a test with a debootstraped armhf system. Note that if the above
isn't working, I'd have to use qemu-debootstrap which copies
/usr/bin/qemu-arm-static into the target system.

# apt-get install debootstrap debian-archive-keyring
# debootstrap --arch=armhf unstable unstable
# chroot unstable ls
bin   dev  home  media    opt   root  sbin  sys  usr
boot  etc  lib     mnt    proc  run   srv   tmp  var

Success! I haven't actually tested flatpak yet in this scenario, but
I'm confident it will succeed.

Looks like there's a debian bug for supporting the F flag in
binfmt-support -
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853820. After that
the qemu-user-static package would need to be updated to make use of
the new binfmt-support feature. Or, even better, binfmt-support adds F
by default if the kernel supports it with maybe an option to disable
it.

--
Dan



More information about the xdg-app mailing list