Why would I love to see the #issue303¹ on a #Librem5?
Beside the modem briefly disappearing from the internal usb bus of the Librem5 the grave effect on any user is that sometimes the xhci usb bus disappears completely and doesn't re-appear by itself.
No modem, no reception, no calls, no sms, not reachable in case of emergency.
To make a workaround available I packaged what Martin and Clayton found to work to recover the bus and modem in case they'd disappear and tried to get it included into a package officially available on the Librem5 repositories.
But the solution has been hacky, loud (noticing the user in any case - even if the modem came back and the bus didn't break) and not really elegant.
I got some feedback from developers and users and decided (beside learning more about the issue and its possible causes) to follow up with a solution that moves away from a service reading the journal to one based on a udev rule.
This way the workaround wouldn't affect the system in any way if the error wouldn't trigger a udev rule.
My initial thought to trigger a systemd.service from udev turned out to be complicated and Clayton Craft from the PostmarketOS team pointed out that it wouldn't be a solution that could be re-used in pmOS, because they do not use systemd.
I ended up using atd
to let a script run when udev triggered my rule, because everything run by udev directly blocks rule processing and is eventually killed if it takes to long.
Testing time. And ... the issue didn't re-appear on my Librem5 for more than a weak and when it did my script didn't even though the udev rule triggered. This way I found out that the root account on my L5 had expired and that at jobs to not run on an expired account.
After waiting again two days for the problem to occur I found my Librem5 with the messages from the screenshot:
2020/2060/0_remove
- udev rule triggered when the modem disappeared from the usb busxhci-usb-bus
- udev rule triggered when the usb hub on the bus disappearedlibrem5-recover-xhci-usb.sh started
- script executed viaatd
Best part of it: bus and modem working.
Now I'll move on and remove debugging stuff, give it a shine and try to package it for PureOS and if I'll find out how for PostmarketOS.