Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,36 @@
From 22b52db4842611ac31a356f023fc09595384e2ad Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 23 May 2019 18:11:22 -0700
Subject: [PATCH] mbim: add an optional TEMP_FAILURE_RETRY macro copy
Fixes build on musl which does not provide this macro
Upstream-Status: Submitted [https://lists.ofono.org/pipermail/ofono/2019-May/019370.html]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
drivers/mbimmodem/mbim-private.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/mbimmodem/mbim-private.h b/drivers/mbimmodem/mbim-private.h
index e159235..51693ea 100644
--- a/drivers/mbimmodem/mbim-private.h
+++ b/drivers/mbimmodem/mbim-private.h
@@ -21,6 +21,15 @@
#define align_len(len, boundary) (((len)+(boundary)-1) & ~((boundary)-1))
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) ({ \
+ __typeof(expression) __result; \
+ do { \
+ __result = (expression); \
+ } while (__result == -1 && errno == EINTR); \
+ __result; })
+#endif
+
enum mbim_control_message {
MBIM_OPEN_MSG = 0x1,
MBIM_CLOSE_MSG = 0x2,
--
2.21.0
@@ -0,0 +1,28 @@
From 76e4054801350ebd4a44057379431a33d460ad0f Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Wed, 21 Apr 2021 11:01:34 +0000
Subject: [PATCH] mbim: Fix build with ell-0.39 by restoring unlikely macro
from ell/util.h
Upstream-Status: Pending
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
drivers/mbimmodem/mbim-private.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/mbimmodem/mbim-private.h b/drivers/mbimmodem/mbim-private.h
index 51693eae..d917312c 100644
--- a/drivers/mbimmodem/mbim-private.h
+++ b/drivers/mbimmodem/mbim-private.h
@@ -30,6 +30,10 @@
__result; })
#endif
+/* used to be part of ell/util.h before 0.39:
+ https://git.kernel.org/pub/scm/libs/ell/ell.git/commit/?id=2a682421b06e41c45098217a686157f576847021 */
+#define unlikely(x) __builtin_expect(!!(x), 0)
+
enum mbim_control_message {
MBIM_OPEN_MSG = 0x1,
MBIM_CLOSE_MSG = 0x2,
@@ -0,0 +1,42 @@
#!/bin/sh
DAEMON=/usr/sbin/ofonod
PIDFILE=/var/run/ofonod.pid
DESC="Telephony daemon"
if [ -f /etc/default/ofono ] ; then
. /etc/default/ofono
fi
set -e
do_start() {
$DAEMON
}
do_stop() {
start-stop-daemon --stop --name ofonod --quiet
}
case "$1" in
start)
echo "Starting $DESC"
do_start
;;
stop)
echo "Stopping $DESC"
do_stop
;;
restart|force-reload)
echo "Restarting $DESC"
do_stop
sleep 1
do_start
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
@@ -0,0 +1,55 @@
SUMMARY = "open source telephony"
DESCRIPTION = "oFono is a stack for mobile telephony devices on Linux. oFono supports speaking to telephony devices through specific drivers, or with generic AT commands."
HOMEPAGE = "http://www.ofono.org"
BUGTRACKER = "https://01.org/jira/browse/OF"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
file://src/ofono.h;beginline=1;endline=20;md5=3ce17d5978ef3445def265b98899c2ee"
DEPENDS = "dbus glib-2.0 udev mobile-broadband-provider-info ell"
SRC_URI = "\
${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
file://ofono \
file://0001-mbim-add-an-optional-TEMP_FAILURE_RETRY-macro-copy.patch \
file://0002-mbim-Fix-build-with-ell-0.39-by-restoring-unlikely-m.patch \
"
SRC_URI[sha256sum] = "92913dcce9a15cac2174daca249457716a0ec036878d22035e83af0e19e79c52"
inherit autotools pkgconfig update-rc.d systemd gobject-introspection-data
INITSCRIPT_NAME = "ofono"
INITSCRIPT_PARAMS = "defaults 22"
SYSTEMD_SERVICE:${PN} = "ofono.service"
PACKAGECONFIG ??= "\
${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
"
PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_system_unitdir}/,--with-systemdunitdir="
PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, bluez5"
EXTRA_OECONF += "--enable-test --enable-external-ell"
do_configure:prepend() {
bbnote "Removing bundled ell from ${S}/ell to prevent including it"
rm -rf ${S}/ell
}
do_install:append() {
install -d ${D}${sysconfdir}/init.d/
install -m 0755 ${WORKDIR}/ofono ${D}${sysconfdir}/init.d/ofono
}
PACKAGES =+ "${PN}-tests"
FILES:${PN} += "${systemd_unitdir}"
FILES:${PN}-tests = "${libdir}/${BPN}/test"
RDEPENDS:${PN} += "dbus"
RDEPENDS:${PN}-tests = "\
python3-core \
python3-dbus \
${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'python3-pygobject', '', d)} \
"
RRECOMMENDS:${PN} += "kernel-module-tun mobile-broadband-provider-info"