diff options
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-connectivity/modemmanager')
4 files changed, 230 insertions, 53 deletions
diff --git a/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/files/0001-core-switch-bash-shell-scripts-to-use-bin-sh-for-use.patch b/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/files/0001-core-switch-bash-shell-scripts-to-use-bin-sh-for-use.patch new file mode 100644 index 0000000000..7c3e7750af --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/files/0001-core-switch-bash-shell-scripts-to-use-bin-sh-for-use.patch @@ -0,0 +1,68 @@ +From f7a3292c1c753b29384e216693f51a4213fea7d0 Mon Sep 17 00:00:00 2001 +From: "Bruce A. Johnson" <waterfordtrack@gmail.com> +Date: Wed, 22 Dec 2021 14:24:02 -0500 +Subject: [PATCH 1/2] core: switch bash shell scripts to use /bin/sh for use + w/Busybox. + +Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/483 +--- + data/fcc-unlock/105b | 2 +- + data/fcc-unlock/1199 | 2 +- + data/fcc-unlock/1eac | 2 +- + test/mmcli-test-sms | 2 +- + tools/tests/test-wrapper.sh.in | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/data/fcc-unlock/105b b/data/fcc-unlock/105b +index 21fe5329..f276050f 100644 +--- a/data/fcc-unlock/105b ++++ b/data/fcc-unlock/105b +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + # SPDX-License-Identifier: CC0-1.0 + # 2021 Aleksander Morgado <aleksander@aleksander.es> +diff --git a/data/fcc-unlock/1199 b/data/fcc-unlock/1199 +index 0109c6ab..e1d3804c 100644 +--- a/data/fcc-unlock/1199 ++++ b/data/fcc-unlock/1199 +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + # SPDX-License-Identifier: CC0-1.0 + # 2021 Aleksander Morgado <aleksander@aleksander.es> +diff --git a/data/fcc-unlock/1eac b/data/fcc-unlock/1eac +index 1068d9c2..d9342852 100644 +--- a/data/fcc-unlock/1eac ++++ b/data/fcc-unlock/1eac +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + # SPDX-License-Identifier: CC0-1.0 + # 2021 Aleksander Morgado <aleksander@aleksander.es> +diff --git a/test/mmcli-test-sms b/test/mmcli-test-sms +index 18e0a7b4..7136ee0d 100755 +--- a/test/mmcli-test-sms ++++ b/test/mmcli-test-sms +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + print_usage () { + echo "usage: $0 [MODEM INDEX] [all|ucs2|gsm7|data] [NUMBER]" +diff --git a/tools/tests/test-wrapper.sh.in b/tools/tests/test-wrapper.sh.in +index d64ea4cb..fcdb56de 100644 +--- a/tools/tests/test-wrapper.sh.in ++++ b/tools/tests/test-wrapper.sh.in +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + # For debugging behavior of test-modemmanager-service.py, you can modify + # this line to add --log-file option +-- +2.34.1 + diff --git a/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/files/0002-fcc-unlock-Make-scripts-POSIX-shell-compatible.patch b/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/files/0002-fcc-unlock-Make-scripts-POSIX-shell-compatible.patch new file mode 100644 index 0000000000..d911d54ce4 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/files/0002-fcc-unlock-Make-scripts-POSIX-shell-compatible.patch @@ -0,0 +1,100 @@ +From ddf634b92bf96b35f521db6da329628b4525c2eb Mon Sep 17 00:00:00 2001 +From: Sven Schwermer <sven.schwermer@disruptive-technologies.com> +Date: Fri, 25 Feb 2022 21:37:13 +0100 +Subject: [PATCH 2/2] fcc-unlock: Make scripts POSIX shell compatible + +This allows us to not rely on bash which may not be available on +constrained systems, e.g. Yocto-built embedded systems. The scripts now +pass shellcheck. + +Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com> +--- + data/fcc-unlock/105b | 8 ++++---- + data/fcc-unlock/1199 | 6 +++--- + data/fcc-unlock/1eac | 8 ++++---- + 3 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/data/fcc-unlock/105b b/data/fcc-unlock/105b +index f276050f..772c90f4 100644 +--- a/data/fcc-unlock/105b ++++ b/data/fcc-unlock/105b +@@ -15,20 +15,20 @@ shift + # second and next arguments are control port names + for PORT in "$@"; do + # match port type in Linux 5.14 and newer +- grep -q MBIM /sys/class/wwan/${PORT}/type 2>/dev/null && { ++ grep -q MBIM "/sys/class/wwan/$PORT/type" 2>/dev/null && { + MBIM_PORT=$PORT + break + } + # match port name in Linux 5.13 +- [[ $PORT == *"MBIM"* ]] && { ++ echo "$PORT" | grep -q MBIM && { + MBIM_PORT=$PORT + break + } + done + + # fail if no MBIM port exposed +-[ -n "${MBIM_PORT}" ] || exit 2 ++[ -n "$MBIM_PORT" ] || exit 2 + + # run qmicli operation over MBIM +-qmicli --device-open-proxy --device=/dev/${MBIM_PORT} --dms-foxconn-set-fcc-authentication=0 ++qmicli --device-open-proxy --device="/dev/$MBIM_PORT" --dms-foxconn-set-fcc-authentication=0 + exit $? +diff --git a/data/fcc-unlock/1199 b/data/fcc-unlock/1199 +index e1d3804c..6dbf8d1b 100644 +--- a/data/fcc-unlock/1199 ++++ b/data/fcc-unlock/1199 +@@ -19,15 +19,15 @@ shift + # second and next arguments are control port names + for PORT in "$@"; do + # match port name +- [[ $PORT == *"cdc-wdm"* ]] && { ++ echo "$PORT" | grep -q cdc-wdm && { + CDC_WDM_PORT=$PORT + break + } + done + + # fail if no cdc-wdm port exposed +-[ -n "${CDC_WDM_PORT}" ] || exit 2 ++[ -n "$CDC_WDM_PORT" ] || exit 2 + + # run qmicli operation +-qmicli --device-open-proxy --device=/dev/${CDC_WDM_PORT} --dms-set-fcc-authentication ++qmicli --device-open-proxy --device="/dev/$CDC_WDM_PORT" --dms-set-fcc-authentication + exit $? +diff --git a/data/fcc-unlock/1eac b/data/fcc-unlock/1eac +index d9342852..44ce46d7 100644 +--- a/data/fcc-unlock/1eac ++++ b/data/fcc-unlock/1eac +@@ -15,20 +15,20 @@ shift + # second and next arguments are control port names + for PORT in "$@"; do + # match port type in Linux 5.14 and newer +- grep -q MBIM /sys/class/wwan/${PORT}/type 2>/dev/null && { ++ grep -q MBIM "/sys/class/wwan/$PORT/type" 2>/dev/null && { + MBIM_PORT=$PORT + break + } + # match port name in Linux 5.13 +- [[ $PORT == *"MBIM"* ]] && { ++ echo "$PORT" | grep -q MBIM && { + MBIM_PORT=$PORT + break + } + done + + # fail if no MBIM port exposed +-[ -n "${MBIM_PORT}" ] || exit 2 ++[ -n "$MBIM_PORT" ] || exit 2 + + # run mbimcli operation +-mbimcli --device-open-proxy --device=/dev/${MBIM_PORT} --quectel-set-radio-state=on ++mbimcli --device-open-proxy --device="/dev/$MBIM_PORT" --quectel-set-radio-state=on + exit $? +-- +2.34.1 + diff --git a/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/modemmanager_1.16.8.bb b/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/modemmanager_1.16.8.bb deleted file mode 100644 index 5aaa55c7af..0000000000 --- a/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/modemmanager_1.16.8.bb +++ /dev/null @@ -1,53 +0,0 @@ -SUMMARY = "ModemManager is a daemon controlling broadband devices/connections" -DESCRIPTION = "ModemManager is a DBus-activated daemon which controls mobile broadband (2G/3G/4G) devices and connections" -HOMEPAGE = "http://www.freedesktop.org/wiki/Software/ModemManager/" -LICENSE = "GPL-2.0 & LGPL-2.1" -LIC_FILES_CHKSUM = " \ - file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \ -" - -inherit gnomebase gettext systemd vala gobject-introspection bash-completion - -DEPENDS = "glib-2.0 libgudev libxslt-native" - -SRC_URI = "http://www.freedesktop.org/software/ModemManager/ModemManager-${PV}.tar.xz" -SRC_URI[sha256sum] = "21fdfaf94171261ad9d99771894f5ade4bc39ef3d1ff1d421054d14713e97880" -S = "${WORKDIR}/ModemManager-${PV}" - -PACKAGECONFIG ??= "mbim qmi \ - ${@bb.utils.filter('DISTRO_FEATURES', 'systemd polkit', d)} \ -" - -PACKAGECONFIG[at] = "--with-at-command-via-dbus" -PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,," -PACKAGECONFIG[polkit] = "--with-polkit=yes,--with-polkit=no,polkit" -# Support WWAN modems and devices which speak the Mobile Interface Broadband Model (MBIM) protocol. -PACKAGECONFIG[mbim] = "--with-mbim,--without-mbim,libmbim" -# Support WWAN modems and devices which speak the Qualcomm MSM Interface (QMI) protocol. -PACKAGECONFIG[qmi] = "--with-qmi,--without-qmi,libqmi" - -EXTRA_OECONF = " \ - --with-udev-base-dir=${nonarch_base_libdir}/udev \ -" - -FILES:${PN} += " \ - ${datadir}/icons \ - ${datadir}/polkit-1 \ - ${datadir}/dbus-1 \ - ${datadir}/ModemManager \ - ${libdir}/ModemManager \ - ${systemd_unitdir}/system \ -" - -FILES:${PN}-dev += " \ - ${libdir}/ModemManager/*.la \ -" - -FILES:${PN}-staticdev += " \ - ${libdir}/ModemManager/*.a \ -" - -FILES:${PN}-dbg += "${libdir}/ModemManager/.debug" - -SYSTEMD_SERVICE:${PN} = "ModemManager.service" diff --git a/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/modemmanager_1.18.6.bb b/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/modemmanager_1.18.6.bb new file mode 100644 index 0000000000..14d9942c02 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/modemmanager_1.18.6.bb @@ -0,0 +1,62 @@ +SUMMARY = "ModemManager is a daemon controlling broadband devices/connections" +DESCRIPTION = "ModemManager is a DBus-activated daemon which controls mobile broadband (2G/3G/4G) devices and connections" +HOMEPAGE = "http://www.freedesktop.org/wiki/Software/ModemManager/" +LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later" +LIC_FILES_CHKSUM = " \ + file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \ +" + +GNOMEBASEBUILDCLASS = "meson" +inherit gnomebase gettext systemd gobject-introspection bash-completion + +DEPENDS = "glib-2.0 libgudev libxslt-native dbus" + +SRCREV ?= "a7bcf2036b34d5043dbc33fee7d98bae5859c4d3" + +# Patches 0001, 0002 will be in ModemManager > 1.18.6 +SRC_URI = " \ + git://gitlab.freedesktop.org/mobile-broadband/ModemManager.git;protocol=https;branch=mm-1-18 \ + file://0001-core-switch-bash-shell-scripts-to-use-bin-sh-for-use.patch \ + file://0002-fcc-unlock-Make-scripts-POSIX-shell-compatible.patch \ +" + +S = "${WORKDIR}/git" + +# strict, permissive +MODEMMANAGER_POLKIT_TYPE ??= "permissive" + +PACKAGECONFIG ??= "vala mbim qmi \ + ${@bb.utils.filter('DISTRO_FEATURES', 'systemd polkit', d)} \ +" + +PACKAGECONFIG[at] = "-Dat_command_via_dbus=true" +PACKAGECONFIG[systemd] = " \ + -Dsystemdsystemunitdir=${systemd_unitdir}/system/, \ + -Dsystemdsystemunitdir=no -Dsystemd_journal=false -Dsystemd_suspend_resume=false \ +" +PACKAGECONFIG[polkit] = "-Dpolkit=${MODEMMANAGER_POLKIT_TYPE},-Dpolkit=no,polkit" +# Support WWAN modems and devices which speak the Mobile Interface Broadband Model (MBIM) protocol. +PACKAGECONFIG[mbim] = "-Dmbim=true,-Dmbim=false -Dplugin_dell=disabled -Dplugin_foxconn=disabled,libmbim" +# Support WWAN modems and devices which speak the Qualcomm MSM Interface (QMI) protocol. +PACKAGECONFIG[qmi] = "-Dqmi=true,-Dqmi=false,libqmi" +PACKAGECONFIG[qrtr] = "-Dqrtr=true,-Dqrtr=false,libqrtr-glib" +PACKAGECONFIG[vala] = "-Dvapi=true,-Dvapi=false" + +inherit ${@bb.utils.contains('PACKAGECONFIG', 'vala', 'vala', '', d)} + +EXTRA_OEMESON = " \ + -Dudevdir=${nonarch_base_libdir}/udev \ + -Dqrtr=false \ +" + +FILES:${PN} += " \ + ${datadir}/icons \ + ${datadir}/polkit-1 \ + ${datadir}/dbus-1 \ + ${datadir}/ModemManager \ + ${libdir}/ModemManager \ + ${systemd_unitdir}/system \ +" + +SYSTEMD_SERVICE:${PN} = "ModemManager.service" |