Friday, 2021-07-23

T42<edp_17> @elros34 : I've updated both broadcom-bluetooth and bluetooth-rfkill-event modules in mw and after rebuild/install of packages, bt still works on device. I'll create a new image to see whether these are included in there. (I expect that.)11:13
T42<edp_17> I have a question regarding the GPS though.11:14
T42<edp_17> I added default user into the system group.11:14
T42<edp_17> However the GPS only works if I do a "chmod a+rw /data/system/gps/.gps.interface.pipe.to_jni"11:15
T42<edp_17> With this, the problem is that this file doesn't exist after reboot so I cannot create a service to set its permission.11:16
T42<edp_17> The file is not created when I toggle the Location on, so I either cannot add an event that set the correct permission.11:17
T42<edp_17> Do you have idea how I can workaround this?11:17
T42<edp_17> @elros34 ^^11:17
malwhat permission does the file have?11:28
T42<edp_17> mal: https://paste.ubuntu.com/p/gJ3ZNBwjtH/11:53
T42<edp_17> This file is created when I start testing the GPS in CSD tool.11:53
T42<elros34> why did you add user to system group? Did it fix something else? Does it still have root:defaultuser permissions even if you disable gps,remove file, reboot and then enable gps and csd/gpsinfo usually without some debugging command for geoclue or anything?12:10
T42<edp_17> Adding user t system group was coming from my notes back in October 2020. There was an error in the log "/data/system/gps/.gps.interface.pipe.to_jni for write, errno = 13 (Permission denied)" and we thought adding user to the group would solve it.12:32
T42<edp_17> Then, it has turned out that adding the user was not enough. Hence the permission change.12:32
T42<edp_17> Yes, that is the root:defaultuser permission after disable gps, reboot, enable gps and do csd/gpsinfo. (Not necessary to remove the because after the reboot the file doesn't exist. I've rebooted and it is not there.)12:37
malso next time it complains about the file?12:38
T42<edp_17> mal: That's what I expected. My notes says that I should see that error in logcat but I have not found it: https://paste.ubuntu.com/p/VgMQTFM6Bz/13:13
T42<elros34> is gpsd started? any signs of failure in journal13:14
T42<edp_17> Yes, GPS started. Here is the log when it works (after I set permission of that file): https://paste.ubuntu.com/p/mpw8QQsjmQ/13:16
T42<edp_17> I'll check journal too. Need to reboot.13:16
T42<elros34> gpsd (process) not GPS and do not change permissions now, first figure out what is wrong13:17
T42<edp_17> I have replicated the error and here is the journal: https://paste.ubuntu.com/p/fn5FRCdzHG/13:34
T42<edp_17> looks like gpsd exited with status 113:34
malshow logcat13:36
T42<edp_17> I already rebooted, so created new logs.13:41
T42<edp_17> logcat: https://paste.ubuntu.com/p/w2Vwk9vzzz/13:41
T42<edp_17> journal: https://paste.ubuntu.com/p/XMvfm3Tyrx/13:42
T42<edp_17> mal: ^^13:42
malmaybe you could check permissions of things under /dev/ and also one option could be to strace the gpsd process13:47
T42<elros34> about stracing gpsd, make sure to start it with correct user (not sure how): https://github.com/edp17/android_device_samsung_trelte-common/blob/cm-14.1/ramdisk/init.universal5433.rc#L74213:48
mal@elros34 probably attaching to already running process is better way13:50
T42<elros34> sure but gpsd crash immediately13:51
mal@elros34 so gpsd is not running until geoclue starts?13:52
T42<elros34> according to latest logs (without chmod a+rw hack), it doesn't event start: https://paste.ubuntu.com/p/XMvfm3Tyrx/13:53
T42<elros34> just for 1 sec13:54
mal@elros34 is that without system group? wondering if some permission is wrong somewhere?13:55
T42<elros34> no idea, @edp_17 ^13:55
malif gpsd seems to fail then starting it as correct user with strace could tell something13:56
T42<elros34> @edp_17 is /data/system/gps owned by system:system?13:56
T42<edp_17> The user has already added to system group. I have not reverted that. Only didn't set the permission of that file.13:56
malI really think we should not have system group for nemo/defaultuser13:57
T42<edp_17> /data/system/gps is owned by system:system13:57
maland instead fix the permissions where needed13:57
T42<edp_17> https://paste.ubuntu.com/p/5QVpWcv8Wp/13:58
T42<edp_17> Should I remove system group from user then try again?13:59
malwhich android base is that using?14:04
T42<edp_17> LOS14.114:04
T42<edp_17> I have removed system from defaultuser14:12
T42<edp_17> I can confirm that the user doesn't need to be in system group. However, it still required to set the permission of that file.14:17
T42<edp_17> At least we don't need to worry about the user being in that group.14:18
T42<edp_17> Hmm, wait. The user still has that group. I have removed, so how?14:19
T42<elros34> you didn't logout (reboot device) but what is the difference? If you chmod a+rw so you will not know whether is needed or not14:20
T42<edp_17> This is what I've done: https://paste.ubuntu.com/p/mQZqnHwFQm/14:20
T42<edp_17> Now I reboot to see what happens.14:20
T42<edp_17> After the reboot, the system group is added to the user.14:24
T42<edp_17> Okay, what I can do now is, remove the system from user then try the GPS.14:26
T42<elros34> sure you can but I can hardly see how it can help for anything except security (default user should not have access to everything which has system:system permission)14:28
T42<edp_17> If user is not in system group GPS works if permission of that file is set.14:29
T42<elros34> if you set a+rw then anybody can read/write that file so user in system or user not in system group14:30
T42<edp_17> Yeah. 😊14:31
T42<elros34> I would focus on real issue: why gpsd fail and try to strace it properly14:31
T42<edp_17> How can I strace gpsd? (I haven't found any gps or gpsd service to stop.)14:41
T42<edp_17> okay, I got it.14:49
T42<edp_17> Here is the log of strace gpsd: https://paste.ubuntu.com/p/hRDX3Jk6qJ/14:50
T42<elros34> Am I right that  if you remove file now, gpsd will recreate it with gps:system permissions?14:55
T42<edp_17> Nope, the file was recreated with root:defaultuser14:59
T42<edp_17> And gpsd strace ended with the same error.14:59
T42<elros34> gpsd restarted itself or you did it somehow14:59
T42<edp_17> When the strace crashed it restarted. I think. Because secind time it has a different PID and I haven't restart it.15:00
T42<edp_17> Now, as it is also crashed second time, it has a different PID again.15:00
T42<elros34> how about you stop gpsd, remove file, then something like that as root: runuser -u defaultuser -g system -G inet -G net_raw -- strace -f /system/bin/gpsd -c /system/etc/gps.xml. NOt sure if that will work15:02
T42<elros34> make sure gpsd is really stopped15:03
T42<elros34> sorry user should be gps not defaultuser15:03
T42<edp_17> How can I stop gpsd? If I kill it, restarts immediately.15:05
T42<elros34> /system/bin/stop gpsd15:05
T42<edp_17> The file was not created but got this: https://paste.ubuntu.com/p/7jQ6NqSzMx/15:13
T42<elros34> sudo use -- so no idea how this command was really executed please run it as root like I said15:15
malthat strace shows CANNOT LINK EXECUTABLE "/system/bin/gpsd": cannot locate symbol "_ZNK7android13SensorManager13getSensorListEPPKPKNS_6SensorE" referenced by "/system/bin/gpsd"15:16
T42<elros34> maybe you need also export LD_SHIM_LIBS /system/lib/hw/gps.universal5433.so|libshim_gpsd.so:/system/bin/gpsd|libshim_gpsd.so15:21
T42<edp_17> Running as root (not with sudo): https://paste.ubuntu.com/p/Jnj3vtcX7Q/15:26
T42<edp_17> The export gave me: https://paste.ubuntu.com/p/vhfnRRK2DV/15:27
T42<elros34> try: runuser -u gps -g system -G inet -G net_raw -- strace -E LD_SHIM_LIBS='/system/lib/hw/gps.universal5433.so|libshim_gpsd.so:/system/bin/gpsd|libshim_gpsd.so' -f /system/bin/gpsd -c /system/etc/gps.xml15:28
T42<edp_17> It works and didn't exit.15:29
T42<edp_17> Spoke too soon, just the output was slow.15:29
T42<edp_17> https://paste.ubuntu.com/p/cVR6P7pKJx/15:30
T42<edp_17> And the file was generated with root:defaultuser15:30
T42<elros34> fif you remove it first?15:31
T42<elros34> did*15:31
T42<edp_17> Yes I did.15:31
T42<edp_17> Apologies, I have to go now. Thank you for your help so far! I will be back and continue later.15:31
T42<elros34> so something else creates it with wrong permission before gpsd try to15:35
T42<elros34> I guess /lib/hw/gps.universal5433.so via gecluehybris15:37
mal@elros34 yes, geoclue somehow causes it to be created16:30
T42<elros34> mal: as workaround maybe mknod and chown that file after this line https://github.com/edp17/android_device_samsung_trelte-common/blob/cm-14.1/ramdisk/init.universal5433.rc#L417 should be enough if gps.universal5433.so  doesn't change owner. The point gps stopped working after one sfos release (can't remember which version). What changed then if gps worked before?16:34
malhmm16:47
malany idea which release16:48
T42<elros34> I think something close to 3.4.0 but @edp_17 will know better16:56
deathmistmal: as per my local testing and @elros34's suggestion from a few days ago to add --recurse-submodules to the git reset command, I've rebased and updated https://github.com/mer-hybris/droid-hal-device/pull/288 and would like feedback :)16:59
maldeathmist: should the git pull have something like that also17:31
deathmistmal: it appears yes, I'll updated the PR to also fix that. should I make it a separate commit?17:42
deathmists/updated/update/17:44
malI think separate commit would be good17:56
T42<edp_17> Yes, gps worked fine before 3.4. Then, when asked help here, we started experiment with adding user to system group and setting permisson of that file. As that solution worked until the next reboot and I didn't really used gps on that device, I ticked gps problem off the list. (re @elros34: I think something cl...)19:35
T42<edp_17> Then, time to time I came back to it later when new releases issued and realised it wasn't working. As the 'workaround' (system group and file permission) always worked, I thought this issue was permanently solved. Until I started to experiment with gps on the device after reboots.19:40
T42<edp_17> It would be good if we can find a permanent solution and I appreciate your help in this.19:41
T42<elros34> I do not know how to figure out it further but workaround could be: 'exec -- /system/xbin/mknod -m 0660 /data/system/gps/.gps.interface.pipe.to_jni p' and 'chown gps system /data/system/gps/.gps.interface.pipe.to_jni' somewhere after line 423 in init.universal5433.rc might be enough19:44
T42<edp_17> I'll try it on device. Thanks! 👍20:07

Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!