In eg-app-fw meeting 2021-09-08 we demoed using Flatpak to run apps inside AGL demo platform. (Video at https://www.youtube.com/watch?v=nZCSvBNtmHQ)
Here is how to recreate the demo:
1. Set up AGL build environment following usual instructions. Use qemux86-64 target.
2. Check out branch sandbox/samthursfield/flatpak-sdk
cd meta-agl-demo git checkout sandbox/samthursfield/flatpak-sdk
2. Follow Flatpak in AGL guide to modify local.conf
and bblayers.conf
.
3. Build the QEMU image containing flatpak
:
bitbake agl-demo-platform # Output in tmp/deploy/images/qemux86-64/
4. Build the Flatpak SDK and runtime:
bitbake agl-demo-platform-flatpak-runtime bitbake agl-demo-platform-flatpak-sdk # Output in ./agl-demo-platform-flatpak-runtime.flatpak/ and ./agl-demo-platform-flatpak-sdk.flatpak/
5. Run local web server to share runtime and SDK (using caddy in this example):
caddy file-server --listen :8000 --browse .
6. Build the Flatpak app using flatpak-builder
git clone https://git.automotivelinux.org/apps/ondemandnavi/ --branch sandbox/samthursfield/flatpak cd ondemandnavi flatpak remote-add --user --no-gpg-verify local-agl http://localhost:8000/agl-demo-platform-flatpak-sdk.flatpak flatpak-builder --repo=../../qemux86-64/ondemandnavi.repo ./_build ./org.automotivelinux.apps.Navigation.yml --force-clean --install-deps-from=local-agl --user
7. Boot the AGL demo image in qemu and install the Flatpak app. Replace $HOSTNAME with the machine running the web server:
flatpak remote-add agl-runtime http://$HOSTNAME:8000/agl-demo-platform-flatpak-runtime.repo/ --no-gpg-verify flatpak remote-add agl-app http://$HOSTNAME:8000/ondemandnavi.repo --no-gpg-verify flatpak install org.automotivelinux.apps.Navigation flatpak run --command=navigation org.automotivelinux.apps.Navigation