modemmanager: do not cache virtual device events
authorFlorian Eckert <fe@dev.tdt.de>
Thu, 15 Jun 2023 12:31:51 +0000 (14:31 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Wed, 21 Jun 2023 11:44:33 +0000 (13:44 +0200)
On small systems with many virtual devices, the modem manager sometimes
could not start because it took too long until all devices for the modem
were recognised. This is because all system events that are stored in
the file events.cache have to be processed. To speed up the processing,
all devices under /sys/devices/virtual are now filtered out so that they
do not have to be processed.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit e66fead6d479b5870280918ea42160c7dd0fc532)

net/modemmanager/Makefile
net/modemmanager/files/modemmanager.common

index a79f65f67777c3f21232aaa75ba366818637a71c..b6063fb85269a88049e4333e9ee2a2703f543749 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=modemmanager
 PKG_SOURCE_VERSION:=1.20.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git
index 6367eb32bb51186dd45e20a0a9f4ab75e9268e56..a931717fd7588fda57356cec254ee152d9a60008 100644 (file)
@@ -273,6 +273,14 @@ mm_report_event() {
        local subsystem="$3"
        local sysfspath="$4"
 
+       # Do not save virtual devices
+       local virtual
+       virtual="$(echo "$sysfspath" | cut -d'/' -f4)"
+       [ "$virtual" = "virtual" ] && {
+               mm_log "debug" "sysfspath is a virtual device ($sysfspath)"
+               return
+       }
+
        # Track/untrack events in cache
        case "${action}" in
                "add")