device-nokia-n900: unconditionally fetch wl1251 nvs on each boot (MR 5050)

Reading the wl1251 data on each boot can be useful when using the same SD card
on different devices, allowing each to fetch its correct calibration data.
Additionally, this opens up the possibility to simplify the packaging (in
follow-up commit)
This commit is contained in:
Sicelo A. Mhlongo 2024-04-19 19:20:03 +02:00 committed by Robert Eckelmann
parent 00f2bb6452
commit ea25bc48d7
No known key found for this signature in database
GPG key ID: 30C0D50BEF63BF54
9 changed files with 42 additions and 42 deletions

View file

@ -2,7 +2,7 @@
# Maintainer: Sicelo <absicsz@gmail.com>
# Co-Maintainer: Danct12 <danct12@disroot.org>
pkgname=device-nokia-n900
pkgver=21
pkgver=23
pkgrel=0
pkgdesc="Nokia N900"
url="https://postmarketos.org"
@ -45,7 +45,6 @@ source="
modem-load.conf
modem-opts.conf
modules.blocklist
n900-wlan-data.initd
pointercal
proxishot.sh
uboot-script.cmd
@ -181,10 +180,7 @@ upower() {
nonfree_firmware() {
pkgdesc="Wifi firmware"
depends="linux-firmware-ti-connectivity wl1251-cal"
install="$subpkgname.post-install"
triggers="$subpkgname.trigger=/lib/firmware/ti-connectivity"
install -Dm755 "$srcdir/n900-wlan-data.initd" "$subpkgdir/etc/init.d/n900-wlan-data"
mkdir "$subpkgdir"
}
sha512sums="
@ -215,7 +211,6 @@ e440ed7a3070c17e003b86b72dbe6d8194d01b577ca8dd56dd066f216b6dda32bb965c780950f178
157b27feebcfddf800a1ffd8c6e369d2b58e5db25b1a44b4443dada8d9fe74abb91d036b9f0e97769bbafbdc72020b5637313682c6932fe7b0bddb9ebebbad42 modem-load.conf
695feac7f69a0ec8c5e007cdb651adcc3492f1c6236e7fd183edec2a5e25cb957d3ace630ea5fdb87fd703e35ac368f1d097c2f881ecb52c9cfd433564db2a6c modem-opts.conf
862ebc7cd2d7a1b3d41b10701b8418308c89eb0732eb99c42ec1091d48e08db9421727f67a3272b7309549798d59afb1b8d7d2fa48d1447b208fcb2329472d4d modules.blocklist
b50e7f37ffb1fa0bb782b117a4e8bcfdb722b6127c3e5d643e90cd901a1f4e65e77a0773ed418673c8195595347482be0c8096f5a723e840315ad61ccd043b66 n900-wlan-data.initd
143c21f0b18a016d37cb44178e9daea09f128a90769b48353c03c3f245cb9b1f7e773b9ccee084973fc78ddd7a18c2642e54888a85bda7c7daecddc9a8c62eff pointercal
134f51d20decc0c63ab08010931a0b410b70d2f85bf6899f2ff137b1680f59f706a6287d01f5fbb41fa5309125df75a430d0783149bd1a6a1bca07d22f4f6a21 proxishot.sh
239a54ae5c5effb53ccf4d658652c0462da57604b16b77a63627a17caa171caf82e3d1769f9c5afea8756415acbbf3b73db9b57715fce6c70ea3f29e5c6ac84a uboot-script.cmd

View file

@ -1,3 +0,0 @@
#!/bin/sh
rc-update add n900-wlan-data boot

View file

@ -1,5 +0,0 @@
#!/bin/sh
[ -f /lib/firmware/ti-connectivity/wl1251-nvs.bin ] && n900-update-wl1251
exit 0

View file

@ -1,20 +0,0 @@
#!/sbin/openrc-run
description="Update N900 WLAN calibration data"
depend()
{
before modules
after localmount
}
start()
{
if [ ! -f /var/lib/n900_cal/done ]
then
n900-update-wl1251
mkdir -p /var/lib/n900_cal
touch /var/lib/n900_cal/done
fi
eend $?
}

View file

@ -1,14 +1,17 @@
# Maintainer: Dang Huynh <danct12@disroot.org>
pkgname=wl1251-cal
pkgver=1.2
pkgrel=0
pkgdesc="Retrieve WiFi data from CAL on the Nokia N900 and feed it to the driver"
pkgrel=1
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"
license="LGPL-2.1-only"
makedepends="linux-headers"
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
n900-update-wl1251"
wl1251-cal.initd
calibrate-wl1251"
options="!check" # No tests
build() {
@ -17,9 +20,17 @@ build() {
package() {
make install DESTDIR="$pkgdir"
install -Dm755 "$srcdir/n900-update-wl1251" "$pkgdir/usr/bin/n900-update-wl1251"
install -Dm755 "$srcdir/calibrate-wl1251" "$pkgdir/usr/bin/calibrate-wl1251"
install -Dm755 "$srcdir"/wl1251-cal.initd "$pkgdir"/etc/init.d/wl1251-cal
}
openrc() {
default_openrc
install="$subpkgname.post-install"
}
sha512sums="
1a402553fc98fa8f2d81d34a548f96be91d13bdcb77ec8e9d8373732b27a6e908895f6044aef8e88dbcd9fa6fa04f0a3d62bed877be91ba6207f68440c3ce758 wl1251-cal-1.2.tar.gz
2cb484d8ab64198c97c61691151a19d26d57f340f85c70d39293e9428b5ac790bc1a6de5894a2a9a3886487f450fd09b21513add3f5fa776ac5289985e43c63a n900-update-wl1251
1793a4d09ce3c4f2af7b7b4e171ed04e4d5e70d3e40f365ef169879d2431bd1f7abe8702a422efb4d86449a2800b53c531af7353d4e4c2563985c97030cbd99b wl1251-cal.initd
0d843727da4d2f3e2fe76ff80c68e67b85fa1e4797ba822d323f3b005df853ec5206c812a9e0caed96aff2bf5f353df79b20f1970c6382d90e02dc664411d0b4 calibrate-wl1251
"

View file

@ -1,10 +1,10 @@
#!/bin/sh -e
if [ -e /in-pmbootstrap ]; then
echo "Skipping update of N900 WLAN calibration data (running in pmbootstrap)"
echo "Skipping update of wl1251 calibration data (running in pmbootstrap)"
exit 0
fi
echo "Updating N900's WLAN calibration data.."
echo "Updating wl1251 calibration data.."
wl1251-cal --nvs-loading=/dev/null --nvs-push-data=/lib/firmware/ti-connectivity/wl1251-nvs.bin
echo "Done"

View file

@ -0,0 +1,3 @@
#!/bin/sh
rc-update add wl1251-cal boot

View file

@ -0,0 +1,14 @@
#!/sbin/openrc-run
description="Update wl1251 calibration data"
depend()
{
before modules
after localmount
}
start()
{
calibrate-wl1251
eend $?
}

View file

@ -0,0 +1,5 @@
#!/bin/sh
[ -f /lib/firmware/ti-connectivity/wl1251-nvs.bin ] && calibrate-wl1251
exit 0