firmware-motorola-ocean: Initial modem support (MR 2295)

On top of the firmware we already have, we also need device-specific
modem firmware. Use script from firmware-motorola-potter(credit goes to
Sireesh Kodali). Also imitate the logic in firmware-motorola-potter.
This commit is contained in:
Ultracoolguy 2021-06-30 15:16:58 -04:00 committed by Clayton Craft
parent 6d2ce32d3f
commit a60ef9725d
No known key found for this signature in database
GPG key ID: 7A3461CA187CEA54
4 changed files with 123 additions and 20 deletions

View file

@ -1,5 +1,5 @@
pkgname=firmware-motorola-ocean
pkgver=2
pkgver=3
pkgrel=0
pkgdesc="Firmware for Motorola Moto G7 Power"
url="https://gitlab.com/Ultracoolguy/firmware-motorola-ocean"
@ -7,30 +7,33 @@ arch="aarch64"
license="proprietary"
options="!check !strip !archcheck"
depends="linux-firmware-qcom"
_commit="2374787dcd3c6494b1e7bbdbc8807635aac3ddfc"
source="https://gitlab.com/Ultracoolguy/firmware-motorola-ocean/-/archive/$_commit/firmware-motorola-ocean-$_commit.tar.gz"
_commit="6552364e63e5a15224c6f0d79e63f69bd6a59fc5"
source="https://gitlab.com/Ultracoolguy/firmware-motorola-ocean/-/archive/$_commit/firmware-motorola-ocean-$_commit.tar.gz
moto-modem-rfs-setup.initd
firmware.files
$pkgname-openrc.post-install"
subpackages="$pkgname-openrc"
builddir="$srcdir/$pkgname-$_commit"
_fwdir="/lib/firmware/postmarketos"
package() {
install -Dm644 "$builddir"/a506_zap.* -t \
"$pkgdir/$_fwdir"
install -Dm644 "$builddir"/adsp.* -t \
"$pkgdir/$_fwdir"
install -Dm644 "$builddir"/mba.mbn -t \
"$pkgdir/$_fwdir"
install -Dm644 "$builddir"/modem.* -t \
"$pkgdir/$_fwdir"
install -Dm644 "$builddir"/venus.* -t \
"$pkgdir/$_fwdir"
install -Dm644 "$builddir"/wcnss.* -t \
"$pkgdir/$_fwdir"
install -Dm644 "$builddir"/wlan/prima/WCNSS_* -t \
"$pkgdir/$_fwdir"/wlan/prima
install -Dm755 $srcdir/moto-modem-rfs-setup.initd "$pkgdir"/etc/init.d/moto-modem-rfs-setup
while IFS="" read -r _i || [ -n "$_i" ]; do
[ ! -d $(dirname $_i) ] && mkdir -p $(dirname $_i)
echo $_i
install -Dm644 $_i "$pkgdir/$_i"
done < "$srcdir/firmware.files"
}
openrc() {
install="$subpkgname.post-install"
default_openrc
}
sha512sums="
b8f6b7665f26855f7a454d7a03ef235be6cbbcd23d70ef1522aa983a7e2a1692093fb83e48f0df4191be9f363a6a9a2fdcd1171316c2625a20489d6c1376401d firmware-motorola-ocean-2374787dcd3c6494b1e7bbdbc8807635aac3ddfc.tar.gz
d3bad428a89fb449d1e976783748defc62178105973e5f82c63b6d0947604065f152f24ae5a43ec413738878eafea15351f59c4a0da3a62f4635096a290bd459 firmware-motorola-ocean-6552364e63e5a15224c6f0d79e63f69bd6a59fc5.tar.gz
d4fd0f3406c9f004e9cae7bc500c5713aab75f102f8e3ea1af820865f01eb03def01cd9ed3e8a184c7dfc22ab419628fad17957a3782885d96eb36e94461e842 moto-modem-rfs-setup.initd
495c0044f0d730247c164d3cf66f3a8d6773e533c804609b999ef3ef4dd63519ed5b96ddfc58e3fef7ef903beb072c73a2ab5baf1d4830561bc0a561db6aafe3 firmware.files
784ac120a2231cfbee153fb8b2634af4ab5091eaa8fe207e66b47641d7531591ee3849e610bb66c7177822c86556f78d51c17ba8e4f3da2f946c4b8c5eaaf310 firmware-motorola-ocean-openrc.post-install
"

View file

@ -0,0 +1,2 @@
#!/bin/sh
rc-update add moto-modem-rfs-setup boot

View file

@ -0,0 +1,58 @@
./lib/firmware/postmarketos/a506_zap.b00
./lib/firmware/postmarketos/a506_zap.b01
./lib/firmware/postmarketos/a506_zap.b02
./lib/firmware/postmarketos/a506_zap.mdt
./lib/firmware/postmarketos/adsp.b00
./lib/firmware/postmarketos/adsp.b01
./lib/firmware/postmarketos/adsp.b02
./lib/firmware/postmarketos/adsp.b03
./lib/firmware/postmarketos/adsp.b04
./lib/firmware/postmarketos/adsp.b05
./lib/firmware/postmarketos/adsp.b06
./lib/firmware/postmarketos/adsp.b07
./lib/firmware/postmarketos/adsp.b08
./lib/firmware/postmarketos/adsp.b09
./lib/firmware/postmarketos/adsp.b10
./lib/firmware/postmarketos/adsp.b11
./lib/firmware/postmarketos/adsp.b12
./lib/firmware/postmarketos/adsp.b13
./lib/firmware/postmarketos/adsp.b14
./lib/firmware/postmarketos/adsp.mdt
./lib/firmware/postmarketos/mba.mbn
./lib/firmware/postmarketos/modem.b00
./lib/firmware/postmarketos/modem.b01
./lib/firmware/postmarketos/modem.b02
./lib/firmware/postmarketos/modem.b04
./lib/firmware/postmarketos/modem.b05
./lib/firmware/postmarketos/modem.b06
./lib/firmware/postmarketos/modem.b07
./lib/firmware/postmarketos/modem.b08
./lib/firmware/postmarketos/modem.b09
./lib/firmware/postmarketos/modem.b10
./lib/firmware/postmarketos/modem.b11
./lib/firmware/postmarketos/modem.b12
./lib/firmware/postmarketos/modem.b13
./lib/firmware/postmarketos/modem.b16
./lib/firmware/postmarketos/modem.b17
./lib/firmware/postmarketos/modem.b18
./lib/firmware/postmarketos/modem.b19
./lib/firmware/postmarketos/modem.b20
./lib/firmware/postmarketos/modem.mdt
./lib/firmware/postmarketos/wcnss.b00
./lib/firmware/postmarketos/wcnss.b01
./lib/firmware/postmarketos/wcnss.b02
./lib/firmware/postmarketos/wcnss.b04
./lib/firmware/postmarketos/wcnss.b06
./lib/firmware/postmarketos/wcnss.b09
./lib/firmware/postmarketos/wcnss.b10
./lib/firmware/postmarketos/wcnss.b11
./lib/firmware/postmarketos/wcnss.b12
./lib/firmware/postmarketos/wcnss.mdt
./lib/firmware/postmarketos/wlan/prima/WCNSS_qcom_cfg.ini
./lib/firmware/postmarketos/wlan/prima/WCNSS_qcom_wlan_nv.bin
./lib/firmware/postmarketos/venus.b00
./lib/firmware/postmarketos/venus.b01
./lib/firmware/postmarketos/venus.b02
./lib/firmware/postmarketos/venus.b03
./lib/firmware/postmarketos/venus.b04
./lib/firmware/postmarketos/venus.mdt

View file

@ -0,0 +1,40 @@
#!/sbin/openrc-run
description="Setup modem firmware for tqftpserv"
depend() {
before tqftpserv
}
start()
{
MODEM_FIRMWARE_DIR="/lib/firmware/postmarketos/persist"
# The firmware present here is unique to each device
# Using the firmware of one device on another can will simply fail
# This is needed because motorola devices derive IMEI and other unique
# IDs from these files
# See also: https://forum.xda-developers.com/g5-plus/how-to/fix-persist-resolve-imei0-explanation-t3825147
if [ ! -d $MODEM_FIRMWARE_DIR ]; then
# Make a copy of the firmware if its not already made
# Use the copy instead of the original, because if due to some error
# somehow the firmware gets corrupted, the original firmware will
# still be available on the 'persist' partition
PERSIST_PATH="/tmp/persist"
PERSIST_DEV="/dev/disk/by-partlabel/persist"
mkdir -p $PERSIST_PATH
mount $PERSIST_DEV -o ro,noatime $PERSIST_PATH
mkdir $MODEM_FIRMWARE_DIR
cp -R "$PERSIST_PATH"/rfs/msm/mpss/ "$MODEM_FIRMWARE_DIR"/readwrite
umount $PERSIST_DEV
rmdir $PERSIST_PATH
fi
ln -s "$MODEM_FIRMWARE_DIR"/readwrite/ /tmp/tqftpserv
}