modem/msm-modem{,-wwan-port}: remove

Moved them to a seperate repository with meson as buildsystem. That
makes it much more maintainable in a single repository, suitable for
upstreaming in Alpine, allows other distros to use it, and cleans up
A LOT of tech dept.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7677>
This commit is contained in:
Achill Gilgenast
2026-02-20 15:30:05 +01:00
parent 33062abaca
commit 55eb68b586
17 changed files with 0 additions and 398 deletions
-42
View File
@@ -1,42 +0,0 @@
maintainer="Barnabas Czeman <barnabas.czeman@postmarketos.org>"
pkgname=msm-modem-wwan-port
pkgver=2
pkgrel=0
pkgdesc="Open wwan port for older Qualcomm SoCs."
url="https://postmarketos.org/"
arch="armhf armv7 aarch64"
license="GPL-3.0-or-later"
depends="rmtfs"
subpackages="
$pkgname-openrc
$pkgname-systemd
"
source="
msm-modem-wwan-port
msm-modem-wwan-port.initd
msm-modem-wwan-port.service
"
options="!check"
package() {
install -Dm755 "$srcdir"/msm-modem-wwan-port \
-t "$pkgdir"/usr/libexec/
install -Dm644 "$srcdir"/msm-modem-wwan-port.service \
-t "$pkgdir"/usr/lib/systemd/system/
}
openrc() {
install_if="$pkgname=$pkgver-r$pkgrel openrc"
depends="openrc rmtfs-openrc"
install="$subpkgname.post-install"
install -Dm755 "$srcdir/$pkgname.initd" \
"$subpkgdir/etc/init.d/$pkgname"
}
sha512sums="
14b91d616d796d89c3b7497b85ddd998f6108546118aee44531eb26183d3d09b0f6bb3f6a47840afbfc7bed115c4d6ac31369046b7281cfb3dc8a54f0fc8c58e msm-modem-wwan-port
133a18b2fb5a1753a9a1b7ff37faf69642f90be451484ba85235bba60394d66b875574bcc6461c0dffbf2bb80f37b9e95f280858f8893c7b79070bb7261305b3 msm-modem-wwan-port.initd
f380d0a4760f0d19ea65b5fea7ca5e1eee28eb162fd15efec318bddb3ea1735f2c891d9d129227e959a2ac479b49f2c438170fe1fdd2c91abf564f7b111a97c3 msm-modem-wwan-port.service
"
@@ -1,39 +0,0 @@
#!/bin/sh
set -eu
QMICLI_MODEM=
if command -v systemd-notify > /dev/null; then
trap '[ $? -eq 0 ] && systemd-notify --ready' EXIT
fi
# libqmi must be present to use this script.
if ! [ -x "$(command -v qmicli)" ]
then
echo 'qmicli is not installed.'
exit 1
fi
# Prepare a qmicli command with desired modem path.
# The modem may appear after some delay, wait for it.
count=0
while [ -z "$QMICLI_MODEM" ] && [ "$count" -lt "45" ]
do
# Check if QRTR is available
if qmicli --silent -pd qrtr://0 --uim-noop > /dev/null
then
QMICLI_MODEM="qmicli --silent -pd qrtr://0"
echo "Using qrtr://0"
fi
sleep 1
count=$((count+1))
done
echo "Waited $count seconds for modem device to appear"
if [ -z "$QMICLI_MODEM" ]
then
echo 'No modem available.'
exit 2
fi
$QMICLI_MODEM --dpm-open-port=hw-data-ep-type=bam-dmux,hw-data-ep-iface-number=1,hw-data-rx-id=1,hw-data-tx-id=1 > /dev/null
exit $?
@@ -1,2 +0,0 @@
#!/bin/sh
rc-update add msm-modem-wwan-port default
@@ -1,19 +0,0 @@
#!/sbin/openrc-run
# Based on msm-modem-uim-selection.initd
name="Modem WWAN port"
description="Activate the WWAN port on the embedded QMI modem"
depend() {
need rmtfs
before ofono
before modemmanager
}
# All of the logic is placed in the service start method as we want to block
# other services while the modem isn't ready yet.
start() {
/usr/libexec/msm-modem-uim-selection
eend $?
}
@@ -1,13 +0,0 @@
[Unit]
Description=MSM Modem WWAN Port
Before=ModemManager.service
After=rmtfs.service
Requires=rmtfs.service
[Service]
Type=notify
ExecStart=/usr/libexec/msm-modem-wwan-port
[Install]
WantedBy=multi-user.target
RequiredBy=ModemManager.service
-100
View File
@@ -1,100 +0,0 @@
maintainer=""
pkgname=msm-modem
pkgver=12
pkgrel=0
pkgdesc="Common support for Qualcomm MSM modems"
url="https://postmarketos.org/"
arch="armhf armv7 aarch64"
license="GPL-3.0-or-later"
depends="rmtfs"
subpackages="
$pkgname-downstream
$pkgname-downstream-openrc:downstream_openrc
$pkgname-openrc
$pkgname-systemd
$pkgname-uim-selection:uim_selection
$pkgname-uim-selection-openrc:uim_selection_openrc
"
source="
keepfileopen.c
msm-modem-downstream.initd
msm-modem-uim-selection
msm-modem-uim-selection.confd
msm-modem-uim-selection.initd
msm-modem-uim-selection.service
rmtfs.service.d.override.conf
udev-downstream.rules
"
options="!check"
build() {
gcc -o keepfileopen "$srcdir"/keepfileopen.c
}
package() {
install -Dm755 "$srcdir"/msm-modem-uim-selection \
-t "$pkgdir"/usr/libexec/
install -Dm755 keepfileopen \
-t "$pkgdir"/usr/bin/
install -Dm644 "$srcdir"/msm-modem-uim-selection.service \
-t "$pkgdir"/usr/lib/systemd/system/
install -Dm644 "$srcdir"/rmtfs.service.d.override.conf \
"$pkgdir"/usr/lib/systemd/system/rmtfs.service.d/override.conf
}
uim_selection() {
pkgdesc="$pkgdesc (UIM selection)"
depends="$pkgname libqmi qmi-utils"
mkdir -p "$subpkgdir"
}
uim_selection_openrc() {
install_if="$pkgname-uim-selection=$pkgver-r$pkgrel openrc"
install="$subpkgname.post-install"
depends="openrc"
install -Dm644 "$srcdir/$pkgname-uim-selection.confd" \
"$subpkgdir/etc/conf.d/$pkgname-uim-selection"
install -Dm755 "$srcdir/$pkgname-uim-selection.initd" \
"$subpkgdir/etc/init.d/$pkgname-uim-selection"
}
downstream() {
pkgdesc="$pkgdesc (downstream)"
depends="$pkgname libqipcrtr4msmipc libsmdpkt_wrapper"
amove usr/bin/keepfileopen
install -Dm644 "$srcdir/udev-downstream.rules" "$subpkgdir/usr/lib/udev/rules.d/55-$pkgname.rules"
}
downstream_openrc() {
install_if="$pkgname-downstream=$pkgver-r$pkgrel openrc"
install="$subpkgname.post-install"
depends="openrc"
install -Dm755 "$srcdir/$pkgname-downstream.initd" \
"$subpkgdir/etc/init.d/$pkgname-downstream"
}
openrc() {
install_if="$pkgname=$pkgver-r$pkgrel openrc"
depends="openrc rmtfs-openrc"
install="$subpkgname.post-install"
mkdir -p "$subpkgdir"
}
sha512sums="
ac9ed0f6ec07ef813ce3a539919acbe8a5a70d5765a5fff267674a3fb239cdb1dba58a14d72a64f990bdcb87c6476d30ef7add21f152df7cb48e36932ef14dbb keepfileopen.c
3172f8c409f552f13d1da29f14ab6c79072cd6da4acab151a1a0ea1858a416974456852609f14fe29cf97a6a45e60b99d0a57ddcde751da243ee5ac6fa8b672c msm-modem-downstream.initd
5ad3484065c8b782cee725fcbc86a09c6b59df5555d88dc84637126f48513da543d08b8c930cc5d3c8580575c0625b3684d71704ee7e182ed1ed80ae4453cef3 msm-modem-uim-selection
abc985c76170601a22a1d5ab0c68bdf63fa2be2796593048ea3ba0d7e5cd26b2fcee2043703e46c2910c53b01e9e8092b7a8e715d57baf243a5f4612dd595443 msm-modem-uim-selection.confd
076d6de36527ac853674c2fc94120e711c1f77c4936977cf353a319f73beed21b9b0b81728572c8894e7dface3ecb5686535f0967de19a6bc5356d44e9ea8756 msm-modem-uim-selection.initd
a12d8d6994ae6e46b0d131c9f5c475ccc70ab7aaf5839b19c1917410fb3c90a208bc0c6e07c90cf251ea6e445741af83a9f77bf9fcb30490bb0fbfc07aa8cbb9 msm-modem-uim-selection.service
c2eeca53016bcc01a0822cd3799574d4404eac8d87e7aa4928f95a2fd7080e3b388294d0e98eee5595d82a842a832a6f29663bdcf6c493d54dc00a196d5700d3 rmtfs.service.d.override.conf
2a511c2e249d0ec5a52f04ffe1ef3d29cf3c4813143b103e54879ff89176ea45b1a5ffe21cb7dc2f1cdd84c3102ba45ef9926ed37e00b1ae12a36d01de35ea5a udev-downstream.rules
"
-19
View File
@@ -1,19 +0,0 @@
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
if (argc != 2) {
fprintf(stderr, "Usage: keepfileopen <file>\n");
return EXIT_FAILURE;
}
if (open(argv[1], O_RDONLY) < 0) {
perror("Failed to open file");
return EXIT_FAILURE;
}
pause();
return EXIT_SUCCESS;
}
@@ -1,2 +0,0 @@
#!/bin/sh
rc-update add msm-modem-downstream
@@ -1,21 +0,0 @@
#!/sbin/openrc-run
supervisor=supervise-daemon
name="Modem Subsystem"
description="Qualcomm MSM modem subsystem service"
_subsys="/dev/subsys_modem"
command="/usr/bin/keepfileopen"
command_args="$_subsys"
respawn_delay=1
respawn_max=3
depend() {
need rmtfs
}
start() {
# Subsystem misc file is only available on some downstream kernels
[ ! -c "$_subsys" ] || default_start
}
@@ -1,2 +0,0 @@
#!/bin/sh
rc-update add rmtfs boot
-94
View File
@@ -1,94 +0,0 @@
#!/bin/sh
set -eu
SIM_WAIT_TIME="${SIM_WAIT_TIME:-4}"
QMICLI_MODEM=
if command -v systemd-notify > /dev/null; then
trap '[ $? -eq 0 ] && systemd-notify --ready' EXIT
fi
case "$(cat /sys/devices/soc0/machine)" in
APQ*)
echo 'Skipping SIM configuration on APQ SoC.'
exit 0
esac
# libqmi must be present to use this script.
if ! [ -x "$(command -v qmicli)" ]
then
echo 'qmicli is not installed.'
exit 1
fi
# Prepare a qmicli command with desired modem path.
# The modem may appear after some delay, wait for it.
count=0
while [ -z "$QMICLI_MODEM" ] && [ "$count" -lt "45" ]
do
# Check if legacy rpmsg exported device exists.
if [ -e "/dev/modem" ]
then
QMICLI_MODEM="qmicli --silent -d /dev/modem"
echo "Using /dev/modem"
# Check if the qmi device from wwan driver exists.
elif [ -e "/dev/wwan0qmi0" ]
then
# Using --device-open-qmi flag as we may have libqmi
# version that can't automatically detect the type yet.
QMICLI_MODEM="qmicli --silent -d /dev/wwan0qmi0 --device-open-qmi"
echo "Using /dev/wwan0qmi0"
# Check if QRTR is available for new devices.
elif qmicli --silent -pd qrtr://0 --uim-noop > /dev/null
then
QMICLI_MODEM="qmicli --silent -pd qrtr://0"
echo "Using qrtr://0"
fi
sleep 1
count=$((count+1))
done
echo "Waited $count seconds for modem device to appear"
if [ -z "$QMICLI_MODEM" ]
then
echo 'No modem available.'
exit 2
fi
QMI_CARDS=$($QMICLI_MODEM --uim-get-card-status)
# Fail if all slots are empty but wait a bit for the sim to appear.
count=0
while ! printf "%s" "$QMI_CARDS" | grep -Fq "Card state: 'present'"
do
if [ "$count" -ge "$SIM_WAIT_TIME" ]
then
echo "No sim detected after $SIM_WAIT_TIME seconds."
exit 0
fi
sleep 1
count=$((count+1))
QMI_CARDS=$($QMICLI_MODEM --uim-get-card-status)
done
echo "Waited $count seconds for modem to come up"
# Clear the selected application in case the modem is in a bugged state
if ! printf "%s" "$QMI_CARDS" | grep -Fq "Primary GW: session doesn't exist"
then
echo 'Application was already selected.'
$QMICLI_MODEM --uim-change-provisioning-session='activate=no,session-type=primary-gw-provisioning' > /dev/null
fi
# Extract first available slot number and AID for usim application
# on it. This should select proper slot out of two if only one UIM is
# present or select the first one if both slots have UIM's in them.
FIRST_PRESENT_SLOT=$(printf "%s" "$QMI_CARDS" | grep "Card state: 'present'" -m1 -B1 | head -n1 | cut -c7-7)
FIRST_PRESENT_AID=$(printf "%s" "$QMI_CARDS" | grep "usim (2)" -m1 -A3 | tail -n1 | awk '{print $1}')
echo "Selecting $FIRST_PRESENT_AID on slot $FIRST_PRESENT_SLOT"
# Finally send the new configuration to the modem.
$QMICLI_MODEM --uim-change-provisioning-session="slot=$FIRST_PRESENT_SLOT,activate=yes,session-type=primary-gw-provisioning,aid=$FIRST_PRESENT_AID" > /dev/null
exit $?
@@ -1,2 +0,0 @@
#!/bin/sh
rc-update add msm-modem-uim-selection default
@@ -1,6 +0,0 @@
# Maximum time to wait for SIM card to appear after starting the modem.
# Some SIM cards or modem firmwares might take longer to initialize. :(
# To avoid blocking boot without a SIM card for too long this is fairly short
# by default (4 seconds), but you can increase it to e.g. 30 seconds if necessary.
# Set to 0 to disable waiting entirely.
sim_wait_time=4
@@ -1,20 +0,0 @@
#!/sbin/openrc-run
# This script tries to automatically configure UIM application for Qualcomm QMI
# modems with more than one sim slot.
name="UIM Slot selection"
description="Select UIM slot and application on the embedded QMI nodem."
depend() {
need rmtfs
before ofono
before modemmanager
}
# Use the service start method instead of command= because we want to block
# other services while the modem isn't ready yet.
start() {
SIM_WAIT_TIME="$sim_wait_time" /usr/libexec/msm-modem-uim-selection
eend $?
}
@@ -1,13 +0,0 @@
[Unit]
Description=MSM Modem UIM Slot Selection
Before=ModemManager.service
After=rmtfs.service
Requires=rmtfs.service
[Service]
Type=notify
ExecStart=/usr/libexec/msm-modem-uim-selection
[Install]
WantedBy=multi-user.target
RequiredBy=ModemManager.service
@@ -1,2 +0,0 @@
[Unit]
Before=msm-modem-uim-selection.service
-2
View File
@@ -1,2 +0,0 @@
KERNEL=="smdcntl0", SYMLINK+="modem"
KERNEL=="smd8", SYMLINK+="modem-at"