- (Optional if on Docker) Run your docker instance
- Ensure that you include
--privilegedflag - Ensure to have
qemu-user-staticpackage in your Dockerfile
- Ensure that you include
- Add
--archflag to flatpak's manifest orbuild-init,runtime --install,runtime --update,build-export, andbuild-bundlestages if doing it manually. - Add new binfmt for your target arch. This is because you won't have qemu within the Sdk probably and you can't bindmount
/usrinto the flatpak container- WARNING! This will change handling of those arch QEMU emulators on your host too!
- Mount binfmt with
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc - Remove old qemu mapping with
echo -1 > /proc/sys/fs/binfmt_misc/qemu-<arch_name> - Add your new mapping with
echo 'magic string' > /proc/sys/fs/binfmt_misc/register. You can use this as a template for them but make sure to append 'OC' as flags on them.
- Add
--bind-mount=/var/opt/qemu-<arch_name>-static=/usr/bin/qemu-<arch_name>-staticto yourflatpak buildstep
That's it!