Index: debian/neon-settings.postinst =================================================================== --- debian/neon-settings.postinst +++ debian/neon-settings.postinst @@ -38,6 +38,31 @@ mangle_unattended_upgrades +# Special hack to fix qemu-arm so one can build flatpaks for plasma-mobile. +# The problem is that by default binfmt interpreters are applied lazily which +# breaks with bubblewrap because of namespaces. Instead we override the original +# qemu-user-static binfmt configuration to also set the F flag (fix-binary) +# to ensure the emulation is immediately applied. +# This is fixed in 18.10 onwards. +# Note that this requires fairly excessive triggers unfortunately. +# https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1815100 +. /etc/os-release +qemu_arm=/usr/bin/qemu-arm-static +update_binfmts=/usr/sbin/update-binfmts +if [ -e $qemu_arm ] && [ -e $update_binfmts ] && [ "18.04" = "$VERSION_ID" ]; then + echo "Overriding qemu-arm binfmt configuration with fix binary flag" + update-binfmts \ + --package qemu-user-static \ + --install qemu-arm \ + $qemu_arm \ + --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 + +fi + # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. Index: debian/neon-settings.triggers =================================================================== --- /dev/null +++ debian/neon-settings.triggers @@ -0,0 +1,2 @@ +interest-noawait /usr/bin/qemu-arm-static +interest-noawait /usr/sbin/update-binfmts