Skip to content
Snippets Groups Projects
Verified Commit b99b9192 authored by sicelo's avatar sicelo :speech_balloon: Committed by Clayton Craft
Browse files

wl1251-cal: modernize and improve reliability (MR 6202)

Alpine now ships compressed firmware, so the old firmware file name is no
longer available, causing wl1251-cal to fail. Fix by manually creating the
expected uncompressed file.

Additionally, wl1251-cal has not been running early enough in most cases,
causing the kernel to use default nvs. Fix by blacklisting the driver and
probing it after the correct nvs has been extracted and saved.
[ci:skip-build]: already built successfully in CI
parent 359b2d84
No related branches found
No related tags found
No related merge requests found
# Maintainer: Dang Huynh <danct12@disroot.org>
pkgname=wl1251-cal
pkgver=1.2
pkgrel=2
pkgrel=3
pkgdesc="Retrieve wl1251 calibration data from a CAL partition and feed it to the driver"
url="https://github.com/maemo-leste/wl1251-cal"
arch="armv7"
......@@ -11,6 +11,7 @@ subpackages="$pkgname-openrc"
triggers="$pkgname.trigger=/lib/firmware/ti-connectivity"
source="$pkgname-$pkgver.tar.gz::https://github.com/maemo-leste/wl1251-cal/archive/refs/tags/$pkgver.tar.gz
wl1251-cal.initd
wl1251-blacklist
calibrate-wl1251"
options="!check" # No tests
......@@ -21,6 +22,7 @@ build() {
package() {
make install DESTDIR="$pkgdir"
install -Dm755 "$srcdir/calibrate-wl1251" "$pkgdir/usr/bin/calibrate-wl1251"
install -Dm644 "$srcdir/wl1251-blacklist" "$pkgdir/etc/modprobe.d/wl1251.conf"
}
openrc() {
......@@ -31,6 +33,7 @@ openrc() {
sha512sums="
1a402553fc98fa8f2d81d34a548f96be91d13bdcb77ec8e9d8373732b27a6e908895f6044aef8e88dbcd9fa6fa04f0a3d62bed877be91ba6207f68440c3ce758 wl1251-cal-1.2.tar.gz
1793a4d09ce3c4f2af7b7b4e171ed04e4d5e70d3e40f365ef169879d2431bd1f7abe8702a422efb4d86449a2800b53c531af7353d4e4c2563985c97030cbd99b wl1251-cal.initd
0d843727da4d2f3e2fe76ff80c68e67b85fa1e4797ba822d323f3b005df853ec5206c812a9e0caed96aff2bf5f353df79b20f1970c6382d90e02dc664411d0b4 calibrate-wl1251
39fec86cb13d34a605ad1a76eb3a6ae6e242a01427f477008a3ff066e0b59fb804f0d8379909f81d015aa053ccf9850505dbe3124062ed707a663ae5e2ccd9f1 wl1251-cal.initd
d14fd2816a8d55592907f1cf1f702d86095c8d2581b336460eb7d5bfc6ab8cece37a53c0a181b9f75ef5050bc612ce7443992158d36fc03939b39010cd33de4c wl1251-blacklist
11341461c487b3d797728e5bd0883e659b8440a486d2f0bce008403da517582ba706f6ac89ee4a44217078a5e2d71c3a0b3d79c1189f83a431edc4069eddac10 calibrate-wl1251
"
......@@ -5,6 +5,10 @@ if [ -e /in-pmbootstrap ]; then
exit 0
fi
echo "Updating wl1251 calibration data.."
# Alpine now ships compressed versions of the firmware. In order for wl1251-cal
# to find the uncompressed file name, create it manually
touch /lib/firmware/ti-connectivity/wl1251-nvs.bin
echo "Extracting and writing wl1251 calibration data.."
wl1251-cal --nvs-loading=/dev/null --nvs-push-data=/lib/firmware/ti-connectivity/wl1251-nvs.bin
echo "Done"
# Ensure wl1251 does not load until wl1251-cal has finished running
blacklist wl1251_spi
blacklist wl1251
#!/bin/sh
rc-update add wl1251-cal boot
rc-update add wl1251-cal sysinit
......@@ -3,12 +3,13 @@ description="Update wl1251 calibration data"
depend()
{
before modules
after localmount
need localmount
}
start()
{
calibrate-wl1251
# Probe wl1251 once the nvs is ready
modprobe wl1251_spi
eend $?
}
#!/bin/sh
[ -f /lib/firmware/ti-connectivity/wl1251-nvs.bin ] && calibrate-wl1251
[ -d /lib/firmware/ti-connectivity ] && calibrate-wl1251
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment