modemmanager: new recipe to build from git repository
The XBee cellular support is at the moment only in modemmanager's git repository (master branch). Also remove one Telit patch from the bbappend because it's already included in the git repo. https://jira.digi.com/browse/DEL-3841 Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
parent
ad122d2605
commit
a774da80be
|
|
@ -0,0 +1,25 @@
|
|||
From: Javier Viguera <javier.viguera@digi.com>
|
||||
Date: Thu, 6 Apr 2017 11:17:46 +0200
|
||||
Subject: [PATCH] configure.ac: add foreign automake option
|
||||
|
||||
Needed to build the repository directly in Yocto, so the missing
|
||||
autotools files are generated.
|
||||
|
||||
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index c8a35d1b1a3f..24ed761d8e42 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -26,7 +26,7 @@ dnl-----------------------------------------------------------------------------
|
||||
dnl autoconf, automake, libtool initialization
|
||||
dnl
|
||||
AC_INIT([ModemManager],[mm_version],[modemmanager-devel@lists.freedesktop.org],[ModemManager])
|
||||
-AM_INIT_AUTOMAKE([1.11.2 subdir-objects tar-ustar no-dist-gzip dist-xz -Wno-portability])
|
||||
+AM_INIT_AUTOMAKE([1.11.2 foreign subdir-objects tar-ustar no-dist-gzip dist-xz -Wno-portability])
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
AM_MAINTAINER_MODE([enable])
|
||||
|
|
@ -1,144 +0,0 @@
|
|||
From: Aleksander Morgado <aleksander@aleksander.es>
|
||||
Date: Wed, 15 Mar 2017 00:03:35 +0100
|
||||
Subject: [PATCH] telit: lock/unlock CSIM operations by default
|
||||
|
||||
Wrap the AT+CSIM=XX commands between lock (CSIM=1) and
|
||||
unlock (CSIM=0) operations.
|
||||
|
||||
This seems to avoid the TTY lockup seen in several different Telit
|
||||
modules.
|
||||
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=100205
|
||||
|
||||
Reported-by: Penalva, Salvador <Salvador.Penalva@digi.com>
|
||||
(cherry picked from commit 9384817a14c8706909f619e773a76edd65a0fdef)
|
||||
---
|
||||
plugins/telit/mm-broadband-modem-telit.c | 69 +++++++++++++++++++++++++++++++-
|
||||
1 file changed, 68 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plugins/telit/mm-broadband-modem-telit.c b/plugins/telit/mm-broadband-modem-telit.c
|
||||
index 8baf2cf..264dd58 100644
|
||||
--- a/plugins/telit/mm-broadband-modem-telit.c
|
||||
+++ b/plugins/telit/mm-broadband-modem-telit.c
|
||||
@@ -278,8 +278,17 @@ modem_load_supported_bands (MMIfaceModem *self,
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
-/* Load unlock retries (Modem interface) */
|
||||
+/* Load unlock retries (Modem interface)
|
||||
+ *
|
||||
+ * NOTE: the logic must make sure that LOAD_UNLOCK_RETRIES_STEP_UNLOCK is always
|
||||
+ * run if LOAD_UNLOCK_RETRIES_STEP_LOCK has been run. Currently, the logic just
|
||||
+ * runs all intermediate steps ignoring errors (i.e. not completing the
|
||||
+ * operation if something fails), so the LOAD_UNLOCK_RETRIES_STEP_UNLOCK is
|
||||
+ * always run.
|
||||
+ */
|
||||
|
||||
+#define CSIM_LOCK_STR "+CSIM=1"
|
||||
+#define CSIM_UNLOCK_STR "+CSIM=0"
|
||||
#define CSIM_QUERY_PIN_RETRIES_STR "+CSIM=10,0020000100"
|
||||
#define CSIM_QUERY_PUK_RETRIES_STR "+CSIM=10,002C000100"
|
||||
#define CSIM_QUERY_PIN2_RETRIES_STR "+CSIM=10,0020008100"
|
||||
@@ -288,10 +297,12 @@ modem_load_supported_bands (MMIfaceModem *self,
|
||||
|
||||
typedef enum {
|
||||
LOAD_UNLOCK_RETRIES_STEP_FIRST,
|
||||
+ LOAD_UNLOCK_RETRIES_STEP_LOCK,
|
||||
LOAD_UNLOCK_RETRIES_STEP_PIN,
|
||||
LOAD_UNLOCK_RETRIES_STEP_PUK,
|
||||
LOAD_UNLOCK_RETRIES_STEP_PIN2,
|
||||
LOAD_UNLOCK_RETRIES_STEP_PUK2,
|
||||
+ LOAD_UNLOCK_RETRIES_STEP_UNLOCK,
|
||||
LOAD_UNLOCK_RETRIES_STEP_LAST
|
||||
} LoadUnlockRetriesStep;
|
||||
|
||||
@@ -328,6 +339,25 @@ modem_load_unlock_retries_finish (MMIfaceModem *self,
|
||||
}
|
||||
|
||||
static void
|
||||
+csim_unlock_ready (MMBaseModem *self,
|
||||
+ GAsyncResult *res,
|
||||
+ LoadUnlockRetriesContext *ctx)
|
||||
+{
|
||||
+ const gchar *response;
|
||||
+ GError *error = NULL;
|
||||
+
|
||||
+ /* Ignore errors */
|
||||
+ response = mm_base_modem_at_command_finish (self, res, &error);
|
||||
+ if (!response) {
|
||||
+ mm_warn ("Couldn't unlock SIM card: %s", error->message);
|
||||
+ g_error_free (error);
|
||||
+ }
|
||||
+
|
||||
+ ctx->step++;
|
||||
+ load_unlock_retries_step (ctx);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
csim_query_ready (MMBaseModem *self,
|
||||
GAsyncResult *res,
|
||||
LoadUnlockRetriesContext *ctx)
|
||||
@@ -370,6 +400,7 @@ csim_query_ready (MMBaseModem *self,
|
||||
mm_unlock_retries_set (ctx->retries, MM_MODEM_LOCK_SIM_PUK2, unlock_retries);
|
||||
break;
|
||||
default:
|
||||
+ g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -379,12 +410,40 @@ next_step:
|
||||
}
|
||||
|
||||
static void
|
||||
+csim_lock_ready (MMBaseModem *self,
|
||||
+ GAsyncResult *res,
|
||||
+ LoadUnlockRetriesContext *ctx)
|
||||
+{
|
||||
+ const gchar *response;
|
||||
+ GError *error = NULL;
|
||||
+
|
||||
+ response = mm_base_modem_at_command_finish (self, res, &error);
|
||||
+ if (!response) {
|
||||
+ g_prefix_error (&error, "Couldn't lock SIM card: ");
|
||||
+ g_simple_async_result_take_error (ctx->result, error);
|
||||
+ load_unlock_retries_context_complete_and_free (ctx);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ ctx->step++;
|
||||
+ load_unlock_retries_step (ctx);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
load_unlock_retries_step (LoadUnlockRetriesContext *ctx)
|
||||
{
|
||||
switch (ctx->step) {
|
||||
case LOAD_UNLOCK_RETRIES_STEP_FIRST:
|
||||
/* Fall back on next step */
|
||||
ctx->step++;
|
||||
+ case LOAD_UNLOCK_RETRIES_STEP_LOCK:
|
||||
+ mm_base_modem_at_command (MM_BASE_MODEM (ctx->self),
|
||||
+ CSIM_LOCK_STR,
|
||||
+ CSIM_QUERY_TIMEOUT,
|
||||
+ FALSE,
|
||||
+ (GAsyncReadyCallback) csim_lock_ready,
|
||||
+ ctx);
|
||||
+ break;
|
||||
case LOAD_UNLOCK_RETRIES_STEP_PIN:
|
||||
mm_base_modem_at_command (MM_BASE_MODEM (ctx->self),
|
||||
CSIM_QUERY_PIN_RETRIES_STR,
|
||||
@@ -417,6 +476,14 @@ load_unlock_retries_step (LoadUnlockRetriesContext *ctx)
|
||||
(GAsyncReadyCallback) csim_query_ready,
|
||||
ctx);
|
||||
break;
|
||||
+ case LOAD_UNLOCK_RETRIES_STEP_UNLOCK:
|
||||
+ mm_base_modem_at_command (MM_BASE_MODEM (ctx->self),
|
||||
+ CSIM_UNLOCK_STR,
|
||||
+ CSIM_QUERY_TIMEOUT,
|
||||
+ FALSE,
|
||||
+ (GAsyncReadyCallback) csim_unlock_ready,
|
||||
+ ctx);
|
||||
+ break;
|
||||
case LOAD_UNLOCK_RETRIES_STEP_LAST:
|
||||
if (ctx->succeded_requests == 0) {
|
||||
g_simple_async_result_set_error (ctx->result,
|
||||
|
|
@ -4,7 +4,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
|
|||
|
||||
SRC_URI += " \
|
||||
file://cellularifupdown \
|
||||
file://0001-telit-lock-unlock-CSIM-operations-by-default.patch \
|
||||
"
|
||||
|
||||
# 'polkit' depends on 'consolekit', and this requires 'x11' distro feature. So
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
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 \
|
||||
"
|
||||
|
||||
DEPENDS = "dbus-glib glib-2.0 intltool-native libgudev"
|
||||
|
||||
PV = "1.7.0+git${SRCPV}"
|
||||
|
||||
SRC_URI = " \
|
||||
git://anongit.freedesktop.org/git/ModemManager/ModemManager.git;protocol=https \
|
||||
file://0001-configure.ac-add-foreign-automake-option.patch \
|
||||
"
|
||||
SRCREV = "34443289d97da5c95270c6071d140f4567047624"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
PACKAGECONFIG ??= "mbim qmi polkit \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
|
||||
"
|
||||
PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,,"
|
||||
PACKAGECONFIG[polkit] = "--with-polkit=yes,--with-polkit=no,polkit"
|
||||
PACKAGECONFIG[mbim] = "--with-mbim,--enable-mbim=no,libmbim"
|
||||
PACKAGECONFIG[qmi] = "--with-qmi,--without-qmi,libqmi"
|
||||
|
||||
inherit autotools bash-completion gettext gobject-introspection gtk-doc pkgconfig systemd vala
|
||||
|
||||
FILES_${PN} += " \
|
||||
${datadir}/icons \
|
||||
${datadir}/polkit-1 \
|
||||
${datadir}/dbus-1 \
|
||||
${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"
|
||||
Loading…
Reference in New Issue