One of the things I tried doing is build my own modem manager snap from here:
What this lets me do, I think (haven’t fully tested it) is launch modem manager how I like.
So, right now the normal snap ways runs modem manager with the filter-policy=strict. I can now use a different filter policy. For example I can change the launch script in the snap and build a new snap. Here is an example:
will@will-desktop-home:~/modem-manager-snap-1.20.0-2_snap-22/bin$ cat modemmanager
#!/bin/sh
set -ex
# Until we've reworked the patch which adds snappy support to
# ModemManager we keep this as a rework to make the plugin
# loader happy and find the plugins at the right location
export SNAP_APP_PATH=$SNAP
LOG_LEVEL="INFO"
DEBUG=""
if [ -f "$SNAP_DATA"/.debug_enabled ]; then
LOG_LEVEL="DEBUG"
DEBUG="--debug"
fi
TEST_NO_SUSPEND_RESUME=""
if [ "$(snapctl get test.no-suspend-resume)" = "true" ]; then
TEST_NO_SUSPEND_RESUME="--test-no-suspend-resume"
fi
TEST_QUICK_SUSPEND_RESUME=""
if [ "$(snapctl get test.quick-suspend-resume)" = "true" ]; then
TEST_QUICK_SUSPEND_RESUME="--test-quick-suspend-resume"
fi
LOG_LEVEL="DEBUG"
DEBUG="--debug"
# MM_FILTER_RULE_PLUGIN_WHITELIST=1
MM_FILTER_RULE_NET=1
MM_FILTER_RULE_CDC_WDM=1
MM_FILTER_RULE_PLUGIN_ALLOWLIST=1
MM_FILTER_RULE_WWAN=1
MM_FILTER_RULE_TTY=1
MM_FILTER_RULE_TTY_DRIVER=1
FILTER_RULE_TTY_ACM_INTERFACE=1
MM_FILTER_RULE_TTY_WITH_NET=1
exec "$SNAP"/usr/sbin/ModemManager --filter-policy=allowlist-only\
$DEBUG --log-level="$LOG_LEVEL" \
$TEST_NO_SUSPEND_RESUME \
$TEST_QUICK_SUSPEND_RESUME \
"$@"
There are a ton of env variables to choose from. So far, I have not been able to get this to recognize my modem…
But…
Is this a potential solution and if so what arguments and env variables would you recommend I launch modem manager with?