aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorNero <zrxu.zhang@fibocom.com>2024-03-14 21:32:54 +0800
committerAleksander Morgado <aleksander@aleksander.es>2024-04-16 12:14:45 +0200
commit04d826f563a497f2af0557982cdfae7586ca8efb (patch)
tree71991768ce0084e75e668a6e0924eada43813c19 /data
parent941461a2c5c08b76319a91b1662d2b7ea63d7273 (diff)
dispatcher-modem-setup: new modem setup dispatcher
There are cases where the user wants to configure some actions to be run on a modem before ModemManager takes over full control. The new "modem setup" dispatcher scripts allow running operations in the modem after the port probing has happened and we know which ports are usable in the device. The scripts may e.g. change device configuration, enable modem logging infrastructure, or any other process that would otherwise conflict with MM's own modem management operations.
Diffstat (limited to 'data')
-rw-r--r--data/dispatcher-modem-setup/0000:000025
-rw-r--r--data/dispatcher-modem-setup/meson.build26
2 files changed, 51 insertions, 0 deletions
diff --git a/data/dispatcher-modem-setup/0000:0000 b/data/dispatcher-modem-setup/0000:0000
new file mode 100644
index 00000000..6489e9b3
--- /dev/null
+++ b/data/dispatcher-modem-setup/0000:0000
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: CC0-1.0
+# 2024 Nero Sinaro <xu.zhang@fibocom.com>
+#
+# modem setup test script
+#
+# This is the test script:
+# Parameter list: vid pid device_path port_name
+# device_path: Path of the device on the sys file system, it's a string
+# port_name: Port name of the device enumeration, It's an array of strings
+#
+
+logger "[Test] ARGV:$@, ARG count:$#"
+
+count=1
+while [ $count -lt 10 ]; do
+ # will print logger to syslog
+ logger "[Test] (attempt #${i})"
+
+ sleep 0.5
+ count=$((count + 1))
+done
+
+exit $?
diff --git a/data/dispatcher-modem-setup/meson.build b/data/dispatcher-modem-setup/meson.build
new file mode 100644
index 00000000..812152a3
--- /dev/null
+++ b/data/dispatcher-modem-setup/meson.build
@@ -0,0 +1,26 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (C) 2024 Nero Sinaro <xu.zhang@fibocom.com>
+
+# Shipped but disabled Modem setup tools
+mm_modemsetupdiravailable = mm_pkgdatadir / 'modem-setup.available.d'
+
+# Directory for user-enabled tools
+mm_modemsetupdiruser = mm_pkgsysconfdir / 'modem-setup.d'
+
+# Directory for package-enabled tools
+mm_modemsetupdirpackage = mm_pkglibdir / 'modem-setup.d'
+
+# This is a test file
+examples = files(
+ '0000:0000'
+)
+
+install_data(
+ examples,
+ install_mode: 'rwx------',
+ install_dir: mm_modemsetupdiravailable,
+)
+
+mkdir_cmd = 'mkdir -p ${DESTDIR}@0@'
+meson.add_install_script('sh', '-c', mkdir_cmd.format(mm_prefix / mm_modemsetupdiruser))
+meson.add_install_script('sh', '-c', mkdir_cmd.format(mm_prefix / mm_modemsetupdirpackage))