Firmware packages: download blobs after installation
Created by: ollieparanoid
When we package firmware blobs, instead of simply mounting the partitions, we get several benefits.
However, we also face the problem, that we probably can't redistribute the firmware files in Alpine's package format. I propose, that we work around this like it is done in several Linux distributions (I have at least seen Ubuntu doing it at some point) by not packaging the firmware files directly, but package code that will download the firmware files as soon as the package is installed.
Just in case you're wondering how you would download WiFi firmware without functional WiFi on the phone, remember that we're building the entire device chroot in a host system, which has internet access. Then you have your initial firmware files, and can do future upgrades with this mechanism directly on the phone.
Here's my proposal:
-
blob-packager
package- depend on
abuild
- post-install hook: add system user
blob-packager
(home folder/var/lib/blob-packager
) -
trigger on
/usr/share/blob-packager/
:- build all aports from that folder (with the
blob-packager
user) (abuild skips already built packages AFAIK) - install all of blob-packager's built packages (or update them) with
apk
- build all aports from that folder (with the
- depend on
-
firmware-asdf
(example firmware package)- depends on
blob-packager
- the
APKBUILD
just installs aAPKBUILD.blob
to/var/lib/blob-packager/$pkgname-blob/APKBUILD
- it adds
pkgname
,pkgver
,pkgrel
,pkgdesc
inAPKBUILD.blob
based on what is inAPKBUILD
(-> less maintenance)
- depends on
-
firmware-asdf-blob
- works just like the firmware packages work today: download the firmware files, put them in
/lib/firmware/postmarketos
- works just like the firmware packages work today: download the firmware files, put them in