From: Oliver Sedlbauer Date: Mon, 16 Oct 2023 12:21:21 +0000 (+0200) Subject: modemmanager: remove sysfscache after dbus ready X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=9ae43c14e85e621350372e7e1a3faf06cfc1c9b3;p=feed%2Fpackages.git modemmanager: remove sysfscache after dbus ready The mm_report_events_from_cache method is called during the startup and informs the ModemManager of kernel events. Additionally, hotplug scripts inform the ModemManager of kernel events. Processed events are stored in the sysfs cache. It is possible for a hotplug script to write to the sysfs cache while the mm_report_events_from_cache method is still waiting for the ModemManager to be available on the bus during startup. This could lead to a misbehavior where modems are not recognized. To ensure a clean state on startup, the sysfs cache is cleared after the ModemManager is available, ensuring reliable processing of kernel events. Signed-off-by: Oliver Sedlbauer --- diff --git a/net/modemmanager/Makefile b/net/modemmanager/Makefile index fa6f1ea60f..bdbdd236ea 100644 --- a/net/modemmanager/Makefile +++ b/net/modemmanager/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=modemmanager PKG_SOURCE_VERSION:=1.22.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git diff --git a/net/modemmanager/files/modemmanager.common b/net/modemmanager/files/modemmanager.common index d46ee72430..2a604c9b68 100644 --- a/net/modemmanager/files/modemmanager.common +++ b/net/modemmanager/files/modemmanager.common @@ -319,9 +319,6 @@ mm_report_event_from_cache_line() { } mm_report_events_from_cache() { - # Remove the sysfs cache - rm -f "${MODEMMANAGER_SYSFS_CACHE}" - local n=60 local step=1 local mmrunning=0 @@ -346,6 +343,9 @@ mm_report_events_from_cache() { return } + # Remove the sysfs cache + rm -f "${MODEMMANAGER_SYSFS_CACHE}" + # Report cached kernel events while IFS= read -r event_line; do mm_report_event_from_cache_line "${event_line}"