Skip to contentSkip to conversation

gpsd: correct explicit nmea 0183 support flag

PATCH New James Knight 2 participants 7 messages Nov 5, 2015 – Nov 6, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 gpsd: correct explicit nmea 0183 support flag

The following handles the GPSd SCons change for the explicit configuration of the NMEA 0183 protocol. The protocol configuration change was introduced in 3.12. Developer's who transitioned to Buildroot's GPSd 3.15 had NMEA 0183 implicitly enabled by default. This change allows NMEA 0183 to be explicitly disabled again.

See:
http://git.savannah.gnu.org/cgit/gpsd.git/commit/SConstruct?id=8f20d7b2d1ece8f3205ca038726c77daa5234c0c

---
Changes v1 -> v2:
- None.

---
 package/gpsd/gpsd.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/gpsd/gpsd.mk +1 -1
index 2199e31..577b43c 100644
@@ -102,7 +102,7 @@ ifneq ($(BR2_PACKAGE_GPSD_MTK3301),y)
 GPSD_SCONS_OPTS += mtk3301=no
 endif
 ifneq ($(BR2_PACKAGE_GPSD_NMEA),y)
-GPSD_SCONS_OPTS += nmea=no
+GPSD_SCONS_OPTS += nmea0183=no
 endif
 ifneq ($(BR2_PACKAGE_GPSD_NTRIP),y)
 GPSD_SCONS_OPTS += ntrip=no
Signature · 1 line
1.9.5.msysgit.1
#1 lore raw

PATCH v2 2/3 gpsd: cleanup udev rule permissions

Adjust a generated udev rule file (25-gpsd.rules) to have user write permissions. This is to prevent rebuild issues when the gpsd package fails to re-install on a target (since the cp of the rule file will fail due to permissions).

---
Changes v1 -> v2:
- Package change introduced in change set 2.

---
 package/gpsd/gpsd.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/gpsd/gpsd.mk +4 -0
index 577b43c..5a369b0 100644
@@ -217,6 +217,8 @@ define GPSD_INSTALL_STAGING_CMDS
 		install)
 endef
 
+# When adding udev rules, ensure rules are writable to prevent rebuild
+# issues.
 ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
 define GPSD_INSTALL_UDEV_RULES
 	(cd $(@D); \
@@ -225,6 +227,8 @@ define GPSD_INSTALL_UDEV_RULES
 		$(SCONS) \
 		$(GPSD_SCONS_OPTS) \
 		udev-install)
+
+	chmod u+w $(TARGET_DIR)/lib/udev/rules.d/25-gpsd.rules
 endef
 
 GPSD_POST_INSTALL_TARGET_HOOKS += GPSD_INSTALL_UDEV_RULES
Signature · 1 line
1.9.5.msysgit.1
#2 lore raw

PATCH v2 2/3 gpsd: cleanup udev rule permissions

Dear James Knight,

Quoted 5 lines · James Knight

Adjust a generated udev rule file (25-gpsd.rules) to have user write permissions. This is to prevent rebuild issues when the gpsd package fails to re-install on a target (since the cp of the rule file will fail due to permissions).

Quoted 7 lines

---
Changes v1 -> v2:
- Package change introduced in change set 2.

---
 package/gpsd/gpsd.mk | 4 ++++
 1 file changed, 4 insertions(+)

Applied after doing some minor tweaks to the commit title and the comment in the code.

Could you report this issue to upstream gpsd? It is not normal IMO that a projects doesn't support "make install; make install".

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH v2 3/3 gpsd: disable attempt to reload systemd

In reply to James Knight

The following disables the attempt to reload the host system's systemd (systemctl daemon-reload; if any) when installing the gpsd package. In previous attempts, the command would invoke and fail (either by being non-existent or a system policy kit would timeout) falling back to a true invoke.

---
Changes v1 -> v2:
- Package change introduced in change set 2.

---
 package/gpsd/gpsd.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/gpsd/gpsd.mk +8 -0
index 5a369b0..40b95f7 100644
@@ -234,4 +234,12 @@ endef
 GPSD_POST_INSTALL_TARGET_HOOKS += GPSD_INSTALL_UDEV_RULES
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+define GPSD_DISABLE_SYSTEMD_DAEMON_RELOAD
+	$(SED) 's/systemctl daemon-reload || //g' $(@D)/SConstruct
+endef
+
+GPSD_POST_PATCH_HOOKS += GPSD_DISABLE_SYSTEMD_DAEMON_RELOAD
+endif
+
 $(eval $(generic-package))
Signature · 1 line
1.9.5.msysgit.1
#4 lore raw

PATCH v2 3/3 gpsd: disable attempt to reload systemd

Dear James Knight,

Quoted 19 lines · James Knight

The following disables the attempt to reload the host system's systemd (systemctl daemon-reload; if any) when installing the gpsd package. In previous attempts, the command would invoke and fail (either by being non-existent or a system policy kit would timeout) falling back to a true invoke.

---
Changes v1 -> v2:
- Package change introduced in change set 2.

---
 package/gpsd/gpsd.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/gpsd/gpsd.mk +0 -0
index 5a369b0..40b95f7 100644

package/gpsd/gpsd.mk endef · line 243

Quoted 10 lines
package/gpsd/gpsd.mk +7 -0
@@ -234,4 +234,12 @@ endef
 GPSD_POST_INSTALL_TARGET_HOOKS += GPSD_INSTALL_UDEV_RULES
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+define GPSD_DISABLE_SYSTEMD_DAEMON_RELOAD
+	$(SED) 's/systemctl daemon-reload || //g' $(@D)/SConstruct
+endef
+
+GPSD_POST_PATCH_HOOKS += GPSD_DISABLE_SYSTEMD_DAEMON_RELOAD
+endif

I see the problem, but rather than this $(SED) expression, could you create a proper patch against the gpsd sources ? The risk with the $(SED) expression is that we might forget about it when updating gpsd in the future.

Also, can you raise the issue with the upstream gpsd developers? Maybe they could introduce some SConstruct command line option to explicitly disable restarting the systemd service. Or maybe the SConstruct already has a way of knowing that it is cross-compiling, in which case doing this systemctl call is silly.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH v2 3/3 gpsd: disable attempt to reload systemd

Thomas,

Quoted 2 lines · Thomas Petazzoni

rather than this $(SED) expression, could you
create a proper patch against the gpsd sources ?

Gah! I was going to make a patch but figured the SED option would be preferred. Oops.

I take at look trying to get these changes (this and the other patch related to gpsd udev) upstream.

As always, thanks for the commits/comments.

#6 lore raw

PATCH v2 1/3 gpsd: correct explicit nmea 0183 support flag

In reply to James Knight

Dear James Knight,

Quoted 9 lines · James Knight

The following handles the GPSd SCons change for the explicit configuration of the NMEA 0183 protocol. The protocol configuration change was introduced in 3.12. Developer's who transitioned to Buildroot's GPSd 3.15 had NMEA 0183 implicitly enabled by default. This change allows NMEA 0183 to be explicitly disabled again.

See:
http://git.savannah.gnu.org/cgit/gpsd.git/commit/SConstruct?id=8f20d7b2d1ece8f3205ca038726c77daa5234c0c

Quoted 7 lines

---
Changes v1 -> v2:
- None.

---
 package/gpsd/gpsd.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com