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.
This commit is contained in:
Nero
2024-04-16 12:14:45 +02:00
committed by Aleksander Morgado
parent 941461a2c5
commit 04d826f563
8 changed files with 359 additions and 27 deletions
+25
View File
@@ -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 $?
+26
View File
@@ -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))