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