workaround a defect with bubblewrap and binfmt and qemu-arm-static

Authored by sitter on Feb 7 2019, 5:55 PM.



binfmt is a kernel module that magically allows the kernel to figure out
an interpreter for any given binary. qemu-static can use it to
transparently run foreign architecture binaries against the kernel.
specifically this for example allows running an arm container on amd64.
alas, the way it is configured in 18.04 is kaput and actually prevents it
from working in certain cases (notably flatpak/bubblewrap).

fixed for 20.04 already

Diff Detail

No Linters Available
No Unit Test Coverage
Build Status
Buildable 7995
Build 8013: arc lint + arc unit
sitter requested review of this revision.Feb 7 2019, 5:55 PM
sitter created this revision.
sitter added a subscriber: dkardarakos.
sitter added a comment.Feb 7 2019, 6:09 PM

actual workaround call for the record: sudo update-binfmts --package qemu-user-static --install qemu-arm /usr/bin/qemu-arm-static --magic "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00" --mask "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff" --offset 0 --credential yes --fix-binary yes

After executing the workaround command, flatpak-builder for arm works as expected.

bshah accepted this revision.Feb 7 2019, 8:57 PM

Perhaps similar needs to be done for aarch64?

This revision is now accepted and ready to land.Feb 7 2019, 8:57 PM

If we need it right now then yes, if not I'd rather wait until we do. The ubuntu maintainer of qemu is seems super responsive and is open to fixing this in ubuntu proper, so we may not need the workaround in the long run.