gpsd should probably not be preinstalled since it seems to have no access control by design (at least from what I've heard). It's however preinstalled, running by default, and seems to be unremovable without also removing vital base packages.
What's the expected behaviour?
gpsd not preinstalled and can be removed
What's the current behaviour?
gpsd preinstalled and unremovable
How to reproduce your issue?
ps aux, check for gpsd. Also, try sudo apk del gpsd
What device are you using?
PinePhone Allwinner 3GB memory variant
On what postmarketOS version did you encounter the issue?
edge (master branch)
v23.06
v22.12 (Supported until 2023-07-06)
I confirm that the issue still is present after running sudo apk upgrade -a
On what environment did you encounter the issue?
Environments
GNOME Shell on Mobile
Phosh
Plasma Mobile
Sxmo (Wayland/Sway) Please post the output of sxmo_version.sh
We definitely do want GPS to work by default without any manual setup. However, I can understand why you would want to remove support for it. I'm not sure how we could go about doing that in a good way though given apk's limitations. We could probably do something using providers.
Someone else said that with geoclue and NetworkManager, gps might work through other means. I wouldn't know myself.
If you leave gpsd installed by default, you should definitely lock it down. It seems to be reachable through among other things a TCP socket which seems to bypass all of flatpak, user permissions, and everything.
Oh but that's not needed anymore. GeoClue handles this easily by asking ModemManager to turn ON/OFF the GPS. ModemManager knows which command it must use for any supported chipset. !494 (merged) only handles the PP/PPP
ya gpsd was used a loooong time ago and has been effectively replaced. we shouldn't be installing/configuring it anymore for the PP (and possibly other devices too?)
I'm working on a wifi-only device (milletwifi), that ModemManager doesn't seem to support. I've been trying to figure out what the long-term support looks like for this platform for its GPS, as I've been told to use https://gitlab.com/gpsd/gpsd/-/merge_requests/139 as the best option to test it right now.
Is ModemManager the path forward for wifi-only devices as well?
Looking at the source, modemmanager can't do the basics regarding GNSS, maybe I have overlooked something?
I found no hints that it looks for /dev/gnssX, the standard device name used for GNSS/GPS devices in the kernel. And why we should attach GNSS to a random daemon?
Well, for the pinephone it makes sense if there is at least some cooperation between that daemon and gpsd.
I think overall there should be a difference between coarse and fine location services.
Do we need gpsd for something?
How do we attach to external bluetooth gnss devices (in case we want something with better reception than the internal one) without gpsd?
Looking at navit (my main working horse for navigation), I found this drivers:
This issue was about not installing it by default, which was a problem because you can't remove it if you don't need it. I bet that most people using these devices (and pmOS) don't need it because they are not using dedicated external GPS devices when their device has a working GPS module. For folks who do, just install gpsd and configure it however you want.
Ok, looking a bit around and to understand your reasoning: So you consider going from /dev/gnssX to gnss-share to geoclue to app the standard route for doing things? And therefore infer that people usually do not need gpsd, so it should not be installed per default?
gnss-share was a bit a missing piece in my head. And it could be extended to accept other gnss sources.
Addendum: and going through modemmanger if the gnss is part of a broadband modem like in the PP.
regarding software: I am looking around a bit more, I see both software requiring geoclue and
gpsd. But then the logic is better that the software package should suck in the required gps interface tool and not the device, removing the dependency is right.
gnss device --> modemmanager OR gnss-share --> geoclue --> apps that want location data
gnss-share is really only useful for devices that have a serial GNSS module that requires setup before applications can get anything useful from it. It was made primarily for the Librem 5, because this is the exact situation for this device. MM is unable to see/manage the gnss device on the L5 since it's a separate chip. This is useful because it's not possible to access this device at the same time from multiple apps, so gnss-share is basically a multiplexer too.
Devices that have a modem providing GNSS service should just use modemmanager, it can handle multiple clients connected to it (if they can't use geoclue for some reason) and presumably does any required setup on init (I'm speculating, the fact that gps work through MM for many things leads me to believe this isn't an issue here at least ). geoclue also works well with ModemManager.
In theory, gpsd could be used in place of the "MM OR gnss-share", but it's less featureful and has other issues (like doesn't allow doing the init required by the L5's GNSS module)
Devices that have a modem providing GNSS service should just use modemmanager, it can handle multiple clients connected to it
While this is technically true, MM does not really have a multi-user location API. Anything (e.g. mmcli) can turn the location sources off (and on) at any time with user permissions and other processes will then quietly stop receiving locations. This can be prevented by actively checking if the location source is on, but this is really bad API design.
Devices that have a modem providing GNSS service should just use modemmanager, it can handle multiple clients connected to it
While this is technically true, MM does not really have a multi-user location API. Anything (e.g. mmcli) can turn the location sources off (and on) at any time with user permissions and other processes will then quietly stop receiving locations. This can be prevented by actively checking if the location source is on, but this is really bad API design.