device-pine64-pinenote: only create stub firmware when missing

Pinenote includes waveform lookup tables that are proprietary and only
available through the `waveform` partition. Before, we packaged empty
files for the firmware so that mkinitfa does not fail. The init scripts
then extracts the waveform binaries on first boot. Unfortunately, this
has the consequence that of overriding the extracted binaries every boot.

Fixes this by only creating stub files when files are missing so
mkinitfs does not fail via pre upgrade and install script.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8639>
This commit is contained in:
Antoine Martin
2026-05-26 07:10:15 +00:00
parent 24dad0d658
commit ca932427e6
3 changed files with 10 additions and 5 deletions
@@ -197,6 +197,7 @@ firmware() {
pkgdesc="WiFi, Bluetooth and display firmware"
depends="linux-firmware-cypress linux-firmware-brcm"
replaces="firmware-pine64-pinenote"
install="$subpkgname.pre-upgrade $subpkgname.pre-install"
# waveform firmware is provided locally via /dev/disk/by-label/waveform
# extracted using waveform_exctract.sh, then adapted to kernel using wbf_to_custom.py
@@ -209,11 +210,6 @@ firmware() {
"$builddir"/bin/waveform_extract.sh \
-t "$subpkgdir"/usr/libexec/pinenote
# create empty waveform firmware so that initial mkinitfs doesn't fail
mkdir -p "$subpkgdir"/usr/lib/firmware/rockchip
touch "$subpkgdir"/usr/lib/firmware/rockchip/ebc.wbf
touch "$subpkgdir"/usr/lib/firmware/rockchip/custom_wf.bin
# symbolic link for wifi firmware to where drivers expects it
mkdir -p "$subpkgdir"/usr/lib/firmware/brcm
ln -s ../cypress/cyfmac43455-sdio.bin.zst "$subpkgdir"/usr/lib/firmware/brcm/brcmfmac43455-sdio.pine64,pinenote-v1.2.bin.zst
@@ -0,0 +1 @@
device-pine64-pinenote-nonfree-firmware.pre-upgrade
@@ -0,0 +1,8 @@
#!/bin/sh
# create empty waveform firmware so that initial mkinitfs doesn't fail
if [ ! -d /usr/lib/firmware/rockchip ]; then
mkdir -p /usr/lib/firmware/rockchip
fi
touch /usr/lib/firmware/rockchip/ebc.wbf
touch /usr/lib/firmware/rockchip/custom_wf.bin