Files
pmaports-rtwo/device/community/wl1251-cal/calibrate-wl1251
T
Sicelo A. Mhlongo 52f23a780c wl1251-cal: extract nvs to /run
Running the service for wl1251-cal before udev is partly responsible for very
slow boot observed on the N900 when using systemd. This is likely because of
the dependency on /lib/firmware.

Provide the NVS in /run instead, an idea borrowed from msm-firmware-loader. It
is safe to permanently overwrite the user-defined firmware search path since
the N900 does not need firmware that would be expected to be in
/lib/firmware/postmarketos.

Signed-off-By: Sicelo A. Mhlongo <absicsz@gmail.com>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7234>
2025-10-28 09:32:20 +00:00

18 lines
566 B
Bash

#!/bin/sh -e
if [ -e /in-pmbootstrap ]; then
echo "Skipping update of wl1251 calibration data (running in pmbootstrap)"
exit 0
fi
# Use /run since this must be run before udev and mounts are up
BASEDIR="/run/wl1251-cal"
mkdir -p "$BASEDIR/ti-connectivity"
touch "$BASEDIR/ti-connectivity/wl1251-nvs.bin"
# Extract NVS from CAL and save in /run
wl1251-cal --nvs-loading=/dev/null --nvs-push-data="$BASEDIR/ti-connectivity/wl1251-nvs.bin"
# Inform kernel about the location of the NVS/firmware
printf "%s" "$BASEDIR" > /sys/module/firmware_class/parameters/path