cleanup
This commit is contained in:
1 parent
ecb0633d1a
commit
0af2d3d547
4 files changed
+5
-112
No files matched your search
@@ -11,6 +11,7 @@ CONFIG_MODEMMANAGER_WITH_MBIM=y
|
||||
CONFIG_MODEMMANAGER_WITH_NETIFD=y
|
||||
CONFIG_MODEMMANAGER_WITH_QMI=y
|
||||
CONFIG_MODEMMANAGER_WITH_QRTR=y
|
||||
CONFIG_PACKAGE_bash=y
|
||||
CONFIG_PACKAGE_cgi-io=y
|
||||
CONFIG_PACKAGE_coreutils=y
|
||||
CONFIG_PACKAGE_coreutils-dd=y
|
||||
@@ -52,6 +53,7 @@ CONFIG_PACKAGE_libncurses=y
|
||||
CONFIG_PACKAGE_libpcre2=y
|
||||
CONFIG_PACKAGE_libqmi=y
|
||||
CONFIG_PACKAGE_libqrtr-glib=y
|
||||
CONFIG_PACKAGE_libreadline=y
|
||||
CONFIG_PACKAGE_luci=y
|
||||
CONFIG_PACKAGE_luci-app-firewall=y
|
||||
CONFIG_PACKAGE_luci-app-package-manager=y
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
CONFIG_TARGET_msm89xx=y
|
||||
CONFIG_TARGET_msm89xx_msm8916=y
|
||||
CONFIG_TARGET_msm89xx_msm8916_DEVICE_yiming-uz801v3=y
|
||||
# CONFIG_FEED_packages is not set
|
||||
CONFIG_LIBQMI_COLLECTION_BASIC=y
|
||||
CONFIG_LIBQMI_WITH_MBIM_QMUX=y
|
||||
CONFIG_LIBQMI_WITH_QRTR_GLIB=y
|
||||
@@ -8,6 +9,7 @@ CONFIG_MODEMMANAGER_WITH_MBIM=y
|
||||
CONFIG_MODEMMANAGER_WITH_NETIFD=y
|
||||
CONFIG_MODEMMANAGER_WITH_QMI=y
|
||||
CONFIG_MODEMMANAGER_WITH_QRTR=y
|
||||
CONFIG_PACKAGE_bash=y
|
||||
CONFIG_PACKAGE_cgi-io=y
|
||||
CONFIG_PACKAGE_coreutils=y
|
||||
CONFIG_PACKAGE_coreutils-dd=y
|
||||
@@ -49,6 +51,7 @@ CONFIG_PACKAGE_libncurses=y
|
||||
CONFIG_PACKAGE_libpcre2=y
|
||||
CONFIG_PACKAGE_libqmi=y
|
||||
CONFIG_PACKAGE_libqrtr-glib=y
|
||||
CONFIG_PACKAGE_libreadline=y
|
||||
CONFIG_PACKAGE_luci=y
|
||||
CONFIG_PACKAGE_luci-app-firewall=y
|
||||
CONFIG_PACKAGE_luci-app-package-manager=y
|
||||
@@ -89,4 +92,3 @@ CONFIG_PACKAGE_wireguard-tools=y
|
||||
CONFIG_TARGET_ROOTFS_PARTSIZE=240
|
||||
# CONFIG_TARGET_ROOTFS_SQUASHFS is not set
|
||||
# CONFIG_PACKAGE_kmod-crypto-kpp is not set
|
||||
# CONFIG_PER_FEED_REPO is not set
|
||||
@@ -1,101 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
# This script tries to automatically configure UIM application for Qualcomm QMI
|
||||
# modems with more than one sim slot.
|
||||
|
||||
# Adapted from pmOS:
|
||||
# https://gitlab.com/postmarketOS/pmaports/-/blob/master/modem/msm-modem/msm-modem-uim-selection.initd
|
||||
|
||||
eend() { echo $@; }
|
||||
veinfo() { echo $@; }
|
||||
ewarn() { echo $@; }
|
||||
|
||||
# Must run after rmtfs but before ModemManager
|
||||
START=30
|
||||
|
||||
start() {
|
||||
case "$(cat /sys/devices/soc0/machine)" in
|
||||
APQ*)
|
||||
eend 0 'Skipping SIM configuration on APQ SoC.'
|
||||
return 0
|
||||
esac
|
||||
|
||||
# libqmi must be present to use this script.
|
||||
if ! [ -x "$(command -v qmicli)" ]
|
||||
then
|
||||
eend 1 'qmicli is not installed.'
|
||||
return 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"
|
||||
veinfo "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"
|
||||
veinfo "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"
|
||||
veinfo "Using qrtr://0"
|
||||
fi
|
||||
sleep 1
|
||||
count=$((count+1))
|
||||
done
|
||||
veinfo "Waited $count seconds for modem device to appear"
|
||||
|
||||
if [ -z "$QMICLI_MODEM" ]
|
||||
then
|
||||
eend 2 'No modem available.'
|
||||
return 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
|
||||
eend 4 "No sim detected after $sim_wait_time seconds."
|
||||
return 4
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
count=$((count+1))
|
||||
QMI_CARDS=$($QMICLI_MODEM --uim-get-card-status)
|
||||
done
|
||||
veinfo "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
|
||||
ewarn '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}')
|
||||
|
||||
veinfo "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
|
||||
eend $?
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "${ACTION}" = "released" ] || exit 0
|
||||
|
||||
if [ "$SEEN" -ge 3 ]
|
||||
then
|
||||
exec /sbin/poweroff
|
||||
fi
|
||||
|
||||
return 0
|
||||
Reference in new issue
Block a user