Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/5] package/gpsd: condition python stuff to the proper kconfig option
  2024-07-09 14:23 [Buildroot] [PATCH 0/5] package/gpsd: make the package more modular yann.morin
@ 2024-07-09 14:23 ` yann.morin
  2024-07-14 21:52   ` Jan Havran
  2024-09-03 18:02   ` Peter Korsgaard
  2024-07-09 14:23 ` [Buildroot] [PATCH 2/5] package/gpsd: fix comment about wchar requirement yann.morin
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 11+ messages in thread
From: yann.morin @ 2024-07-09 14:23 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, yann.morin

From: "Yann E. MORIN" <yann.morin@orange.com>

Currently, we have a Kconfig symbol to enable the python support in
gpsd, but the condition at configure time is based on whether the python
package is enabled. So, if a user does not enable python support in
gpsd, they still get it.

Switch to using the proper symbol.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Bernd Kuhls <bernd@kuhls.net>
---
 package/gpsd/gpsd.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk
index 1d4013d122..c57fad83c3 100644
--- a/package/gpsd/gpsd.mk
+++ b/package/gpsd/gpsd.mk
@@ -178,7 +178,7 @@ ifeq ($(BR2_PACKAGE_GPSD_MAX_DEV),y)
 GPSD_SCONS_OPTS += max_devices=$(BR2_PACKAGE_GPSD_MAX_DEV_VALUE)
 endif
 
-ifeq ($(BR2_PACKAGE_PYTHON3),y)
+ifeq ($(BR2_PACKAGE_GPSD_PYTHON),y)
 GPSD_SCONS_OPTS += \
 	python=yes \
 	python_libdir="/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages"
-- 
2.34.1

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 0/5] package/gpsd: make the package more modular
@ 2024-07-09 14:23 yann.morin
  2024-07-09 14:23 ` [Buildroot] [PATCH 1/5] package/gpsd: condition python stuff to the proper kconfig option yann.morin
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: yann.morin @ 2024-07-09 14:23 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, Yann E . MORIN

From: "Yann E. MORIN" <yann.morin@orange.com>

Hello All!

There are use-cases where a gpsd daemon is not needed, and just the
"native" tools and the python helpers are used. There are also cases
where tonly the python scripts are needed (e.g. one is useful to
configure the u-blox devices).

This series makes the package a little bit more modular to cover those
cases.


Regards,
Yann E. MORIN.


The following changes since commit 3ebc7c69d56430c34eba4c869d1d4fe4d1e8de55

  support/testing: new rt-tests runtime test (2024-07-03 23:50:24 +0200)


are available as patches in this mail series,

for you to apply patches up to e6e9df5fad92d96444cebc9ebc8c137b83f929a6

  package/gpsd: add option to enable/disable the daemon (2024-07-09 16:23:08 +0200)


----------------------------------------------------------------
Yann E. MORIN (5):
      package/gpsd: condition python stuff to the proper kconfig option
      package/gpsd: fix comment about wchar requirement
      package/gpsd: move python option later
      package/gpsd: add option to enable clients
      package/gpsd: add option to enable/disable the daemon

 package/gpsd/Config.in | 46 +++++++++++++++++++++++++--------
 package/gpsd/gpsd.mk   | 70 +++++++++++++++++++++++++++++++-------------------
 2 files changed, 78 insertions(+), 38 deletions(-)

-- 
                                        ____________
.-----------------.--------------------:       _    :------------------.
|  Yann E. MORIN  | Real-Time Embedded |    __/ )   | /"\ ASCII RIBBON |
|                 | Software  Designer |  _/ - /'   | \ / CAMPAIGN     |
| +33 638.411.245 '--------------------: (_    `--, |  X  AGAINST      |
| yann.morin (at) orange.com           |_="    ,--' | / \ HTML MAIL    |
'--------------------------------------:______/_____:------------------'

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 2/5] package/gpsd: fix comment about wchar requirement
  2024-07-09 14:23 [Buildroot] [PATCH 0/5] package/gpsd: make the package more modular yann.morin
  2024-07-09 14:23 ` [Buildroot] [PATCH 1/5] package/gpsd: condition python stuff to the proper kconfig option yann.morin
@ 2024-07-09 14:23 ` yann.morin
  2024-09-03 18:02   ` Peter Korsgaard
  2024-07-09 14:23 ` [Buildroot] [PATCH 3/5] package/gpsd: move python option later yann.morin
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: yann.morin @ 2024-07-09 14:23 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, yann.morin

From: "Yann E. MORIN" <yann.morin@orange.com>

The comment does not follow the coding style, so update it appropriately.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Bernd Kuhls <bernd@kuhls.net>
---
 package/gpsd/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/gpsd/Config.in b/package/gpsd/Config.in
index 8c28c05efd..44615f4e43 100644
--- a/package/gpsd/Config.in
+++ b/package/gpsd/Config.in
@@ -84,7 +84,7 @@ config BR2_PACKAGE_GPSD_PYTHON
 	  Python libraries and tools for the gpsd service daemon
 	  including gpsfake test harness.
 
-comment "GPSD python support not available with toolchain w/o wide characters support"
+comment "python support needs a toolchain w/ wchar"
 	depends on !BR2_USE_WCHAR
 
 comment "Protocols"
-- 
2.34.1

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 3/5] package/gpsd: move python option later
  2024-07-09 14:23 [Buildroot] [PATCH 0/5] package/gpsd: make the package more modular yann.morin
  2024-07-09 14:23 ` [Buildroot] [PATCH 1/5] package/gpsd: condition python stuff to the proper kconfig option yann.morin
  2024-07-09 14:23 ` [Buildroot] [PATCH 2/5] package/gpsd: fix comment about wchar requirement yann.morin
@ 2024-07-09 14:23 ` yann.morin
  2024-07-09 14:24 ` [Buildroot] [PATCH 4/5] package/gpsd: add option to enable clients yann.morin
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: yann.morin @ 2024-07-09 14:23 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, yann.morin

From: "Yann E. MORIN" <yann.morin@orange.com>

It's in the middle of options that are specific to the daemon, while it
itslef is not specific to the daemon. We're going to add an option to
enable/disable the daemon soon, so that python option would get hidden
away.

Move it further down, out of scope of the daemon-related options.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Bernd Kuhls <bernd@kuhls.net>
---
 package/gpsd/Config.in | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/package/gpsd/Config.in b/package/gpsd/Config.in
index 44615f4e43..1b61f8c286 100644
--- a/package/gpsd/Config.in
+++ b/package/gpsd/Config.in
@@ -76,17 +76,6 @@ config BR2_PACKAGE_GPSD_MAX_DEV_VALUE
 config BR2_PACKAGE_GPSD_SQUELCH
 	bool "squelch gpsd_report and gpsd_hexdump to save cpu"
 
-config BR2_PACKAGE_GPSD_PYTHON
-	bool "build Python support and modules"
-	depends on BR2_USE_WCHAR # python3
-	select BR2_PACKAGE_PYTHON3
-	help
-	  Python libraries and tools for the gpsd service daemon
-	  including gpsfake test harness.
-
-comment "python support needs a toolchain w/ wchar"
-	depends on !BR2_USE_WCHAR
-
 comment "Protocols"
 
 config BR2_PACKAGE_GPSD_AIVDM
@@ -221,4 +210,15 @@ config BR2_PACKAGE_GPSD_UBX
 	help
 	  uBlox UBX binary support
 
+config BR2_PACKAGE_GPSD_PYTHON
+	bool "build Python support and modules"
+	depends on BR2_USE_WCHAR # python3
+	select BR2_PACKAGE_PYTHON3
+	help
+	  Python libraries and tools for the gpsd service daemon
+	  including gpsfake test harness.
+
+comment "python support needs a toolchain w/ wchar"
+	depends on !BR2_USE_WCHAR
+
 endif
-- 
2.34.1

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 4/5] package/gpsd: add option to enable clients
  2024-07-09 14:23 [Buildroot] [PATCH 0/5] package/gpsd: make the package more modular yann.morin
                   ` (2 preceding siblings ...)
  2024-07-09 14:23 ` [Buildroot] [PATCH 3/5] package/gpsd: move python option later yann.morin
@ 2024-07-09 14:24 ` yann.morin
  2024-07-09 14:24 ` [Buildroot] [PATCH 5/5] package/gpsd: add option to enable/disable the daemon yann.morin
  2024-08-02 21:35 ` [Buildroot] [PATCH 0/5] package/gpsd: make the package more modular Thomas Petazzoni via buildroot
  5 siblings, 0 replies; 11+ messages in thread
From: yann.morin @ 2024-07-09 14:24 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, yann.morin

From: "Yann E. MORIN" <yann.morin@orange.com>

In some cases, the clients are useless on the target, e.g. when there is
no need to adjust the gpsd daemon at runtime.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Bernd Kuhls <bernd@kuhls.net>
---
 package/gpsd/Config.in | 11 +++++++++++
 package/gpsd/gpsd.mk   |  6 ++++++
 2 files changed, 17 insertions(+)

diff --git a/package/gpsd/Config.in b/package/gpsd/Config.in
index 1b61f8c286..cbdcdb5725 100644
--- a/package/gpsd/Config.in
+++ b/package/gpsd/Config.in
@@ -210,6 +210,17 @@ config BR2_PACKAGE_GPSD_UBX
 	help
 	  uBlox UBX binary support
 
+config BR2_PACKAGE_GPSD_CLIENTS
+	bool "gpsd clients"
+	default y # legacy
+	help
+	  Build and install gspd client programs, like:
+	    - gpsctl
+	    - gpsdctl
+	    - gpsdecode
+	    - gpspipe
+	    - ...
+
 config BR2_PACKAGE_GPSD_PYTHON
 	bool "build Python support and modules"
 	depends on BR2_USE_WCHAR # python3
diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk
index c57fad83c3..77c6f6c562 100644
--- a/package/gpsd/gpsd.mk
+++ b/package/gpsd/gpsd.mk
@@ -178,6 +178,12 @@ ifeq ($(BR2_PACKAGE_GPSD_MAX_DEV),y)
 GPSD_SCONS_OPTS += max_devices=$(BR2_PACKAGE_GPSD_MAX_DEV_VALUE)
 endif
 
+ifeq ($(BR2_PACKAGE_GPSD_CLIENTS),y)
+GPSD_SCONS_OPTS += gpsdclients=yes
+else
+GPSD_SCONS_OPTS += gpsdclients=no
+endif
+
 ifeq ($(BR2_PACKAGE_GPSD_PYTHON),y)
 GPSD_SCONS_OPTS += \
 	python=yes \
-- 
2.34.1

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 5/5] package/gpsd: add option to enable/disable the daemon
  2024-07-09 14:23 [Buildroot] [PATCH 0/5] package/gpsd: make the package more modular yann.morin
                   ` (3 preceding siblings ...)
  2024-07-09 14:24 ` [Buildroot] [PATCH 4/5] package/gpsd: add option to enable clients yann.morin
@ 2024-07-09 14:24 ` yann.morin
  2024-07-14 21:42   ` Jan Havran
  2024-08-02 21:35 ` [Buildroot] [PATCH 0/5] package/gpsd: make the package more modular Thomas Petazzoni via buildroot
  5 siblings, 1 reply; 11+ messages in thread
From: yann.morin @ 2024-07-09 14:24 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, yann.morin

From: "Yann E. MORIN" <yann.morin@orange.com>

Some scenarii, like building an RTK base, does not require a gpsd
daemon, but just a few python based tools (e.g. the python scripts
to configure a GNSS device).

Add an option to enable or disable building and instaling the daemon.
We make it enabled by default, for legacy purposes.

When the daemon is installed, it also installs a few ancillary helpers,
which need some of the clients (e.g. the udev rule will use gpsdctl), so
ensure they are enabled with the daemon.

Speaking of the udev rule: without the daemon, it does not need to be
installed, so only try to fix its mode when the daemomn is installed.

Similarly for systemd, no need to install the drop-in when the daemon is
not installed. And for sysv init, no need for a startup script without
the daemon either.

Now that everything is optional, daemon, clients, and python stuff, we
need to ensure that at least something is installed. The obvious
solution would be to ensure that the daemon is installed, but that
causes conflicts in the Kconfig depencies (elided for readability):

    config BR2_PACAKGE_GPSD
        bool "gpsd:
        select BR2_PACKAGE_GPSD_DAEMON if ! BR2_PACKAGE_GPSD_CLIENTS \
                                       && ! BR2_PACKAGE_GPSD_PYTHON

    config BR2_PACKAGE_GPSD_DAEMON
        bool "daemon"
        select BR2_PACKAGE_GPSD_CLIENTS

would cause errors like:

    package/gpsd/Config.in:27:error: recursive dependency detected!
    package/gpsd/Config.in:27:      symbol BR2_PACKAGE_GPSD_DAEMON is selected by BR2_PACKAGE_GPSD_CLIENTS
    package/gpsd/Config.in:226:     symbol BR2_PACKAGE_GPSD_CLIENTS is selected by BR2_PACKAGE_GPSD_DAEMON

So we chose the next best option: ensure that the clients get built, if
nothing else does.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Bernd Kuhls <bernd@kuhls.net>
---
 package/gpsd/Config.in | 13 +++++++++
 package/gpsd/gpsd.mk   | 62 ++++++++++++++++++++++++------------------
 2 files changed, 49 insertions(+), 26 deletions(-)

diff --git a/package/gpsd/Config.in b/package/gpsd/Config.in
index cbdcdb5725..92a124b8ac 100644
--- a/package/gpsd/Config.in
+++ b/package/gpsd/Config.in
@@ -9,6 +9,8 @@ menuconfig BR2_PACKAGE_GPSD
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	# Always tries to build a shared library
 	depends on !BR2_STATIC_LIBS
+	select BR2_PACKAGE_GPSD_CLIENTS if !BR2_PACKAGE_GPSD_DAEMON \
+				       && !BR2_PACKAGE_GPSD_PYTHON
 	help
 	  gpsd is a service daemon that monitors one or more GPSes or
 	  AIS receivers attached to a host computer through serial or
@@ -22,6 +24,15 @@ menuconfig BR2_PACKAGE_GPSD
 
 if BR2_PACKAGE_GPSD
 
+config BR2_PACKAGE_GPSD_DAEMON
+	bool "gpsd daemon"
+	default y # legacy
+	select BR2_PACKAGE_GPSD_CLIENTS
+	help
+	  Build and install the gpsd daemon itself
+
+if BR2_PACKAGE_GPSD_DAEMON
+
 config BR2_PACKAGE_GPSD_DEVICES
 	string "Where to look for GPSes"
 	default "/dev/ttyS1"
@@ -210,6 +221,8 @@ config BR2_PACKAGE_GPSD_UBX
 	help
 	  uBlox UBX binary support
 
+endif  # GPSD_DAEMON
+
 config BR2_PACKAGE_GPSD_CLIENTS
 	bool "gpsd clients"
 	default y # legacy
diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk
index 77c6f6c562..8f87766dcc 100644
--- a/package/gpsd/gpsd.mk
+++ b/package/gpsd/gpsd.mk
@@ -26,8 +26,7 @@ GPSD_SCONS_OPTS = \
 	prefix=/usr \
 	sysroot=$(STAGING_DIR) \
 	strip=no \
-	qt=no \
-	systemd=$(if $(BR2_INIT_SYSTEMD),yes,no)
+	qt=no
 
 ifeq ($(BR2_PACKAGE_NCURSES),y)
 GPSD_DEPENDENCIES += ncurses
@@ -178,6 +177,40 @@ ifeq ($(BR2_PACKAGE_GPSD_MAX_DEV),y)
 GPSD_SCONS_OPTS += max_devices=$(BR2_PACKAGE_GPSD_MAX_DEV_VALUE)
 endif
 
+ifeq ($(BR2_PACKAGE_GPSD_DAEMON),y)
+GPSD_SCONS_OPTS += \
+	gpsd=yes \
+	systemd=$(if $(BR2_INIT_SYSTEMD),yes,no)
+
+GPSD_INSTALL_RULE = $(if $(BR2_PACKAGE_HAS_UDEV),udev-install,install)
+
+# When using chrony, wait for after Buildroot's chrony.service
+ifeq ($(BR2_PACKAGE_CHRONY),y)
+define GPSD_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0644 $(GPSD_PKGDIR)/br-chrony.conf \
+		$(TARGET_DIR)/usr/lib/systemd/system/gpsd.service.d/br-chrony.conf
+endef
+endif
+
+define GPSD_INSTALL_INIT_SYSV
+	$(INSTALL) -m 0755 -D package/gpsd/S50gpsd $(TARGET_DIR)/etc/init.d/S50gpsd
+	$(SED) 's,^DEVICES=.*,DEVICES=$(BR2_PACKAGE_GPSD_DEVICES),' $(TARGET_DIR)/etc/init.d/S50gpsd
+endef
+
+# After the udev rule is installed, make it writable so that this
+# package can be re-built/re-installed.
+ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
+define GPSD_INSTALL_UDEV_RULES
+	chmod u+w $(TARGET_DIR)/lib/udev/rules.d/25-gpsd.rules
+endef
+GPSD_POST_INSTALL_TARGET_HOOKS += GPSD_INSTALL_UDEV_RULES
+endif
+
+else # GPSD_DAEMON
+GPSD_SCONS_OPTS += gpsd=no systemd=no
+GPSD_INSTALL_RULE = install
+endif
+
 ifeq ($(BR2_PACKAGE_GPSD_CLIENTS),y)
 GPSD_SCONS_OPTS += gpsdclients=yes
 else
@@ -211,22 +244,9 @@ define GPSD_INSTALL_TARGET_CMDS
 		DESTDIR=$(TARGET_DIR) \
 		$(SCONS) \
 		$(GPSD_SCONS_OPTS) \
-		$(if $(BR2_PACKAGE_HAS_UDEV),udev-install,install))
+		$(GPSD_INSTALL_RULE))
 endef
 
-define GPSD_INSTALL_INIT_SYSV
-	$(INSTALL) -m 0755 -D package/gpsd/S50gpsd $(TARGET_DIR)/etc/init.d/S50gpsd
-	$(SED) 's,^DEVICES=.*,DEVICES=$(BR2_PACKAGE_GPSD_DEVICES),' $(TARGET_DIR)/etc/init.d/S50gpsd
-endef
-
-# When using chrony, wait for after Buildroot's chrony.service
-ifeq ($(BR2_PACKAGE_CHRONY),y)
-define GPSD_INSTALL_INIT_SYSTEMD
-	$(INSTALL) -D -m 0644 $(GPSD_PKGDIR)/br-chrony.conf \
-		$(TARGET_DIR)/usr/lib/systemd/system/gpsd.service.d/br-chrony.conf
-endef
-endif
-
 define GPSD_INSTALL_STAGING_CMDS
 	(cd $(@D); \
 		$(GPSD_SCONS_ENV) \
@@ -236,14 +256,4 @@ define GPSD_INSTALL_STAGING_CMDS
 		install)
 endef
 
-# After the udev rule is installed, make it writable so that this
-# package can be re-built/re-installed.
-ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
-define GPSD_INSTALL_UDEV_RULES
-	chmod u+w $(TARGET_DIR)/lib/udev/rules.d/25-gpsd.rules
-endef
-
-GPSD_POST_INSTALL_TARGET_HOOKS += GPSD_INSTALL_UDEV_RULES
-endif
-
 $(eval $(generic-package))
-- 
2.34.1

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH 5/5] package/gpsd: add option to enable/disable the daemon
  2024-07-09 14:24 ` [Buildroot] [PATCH 5/5] package/gpsd: add option to enable/disable the daemon yann.morin
@ 2024-07-14 21:42   ` Jan Havran
  0 siblings, 0 replies; 11+ messages in thread
From: Jan Havran @ 2024-07-14 21:42 UTC (permalink / raw)
  To: yann.morin; +Cc: Bernd Kuhls, buildroot

Hi,

V Tue, Jul 09, 2024 at 04:24:01PM +0200, yann.morin@orange.com napsal(a):
> From: "Yann E. MORIN" <yann.morin@orange.com>
> 
> Some scenarii, like building an RTK base, does not require a gpsd
> daemon, but just a few python based tools (e.g. the python scripts
> to configure a GNSS device).
> 
> Add an option to enable or disable building and instaling the daemon.
> We make it enabled by default, for legacy purposes.
> 
> When the daemon is installed, it also installs a few ancillary helpers,
> which need some of the clients (e.g. the udev rule will use gpsdctl), so
> ensure they are enabled with the daemon.
> 
> Speaking of the udev rule: without the daemon, it does not need to be
> installed, so only try to fix its mode when the daemomn is installed.
> 
> Similarly for systemd, no need to install the drop-in when the daemon is
> not installed. And for sysv init, no need for a startup script without
> the daemon either.
> 
> Now that everything is optional, daemon, clients, and python stuff, we
> need to ensure that at least something is installed. The obvious
> solution would be to ensure that the daemon is installed, but that
> causes conflicts in the Kconfig depencies (elided for readability):
> 
>     config BR2_PACAKGE_GPSD
>         bool "gpsd:
>         select BR2_PACKAGE_GPSD_DAEMON if ! BR2_PACKAGE_GPSD_CLIENTS \
>                                        && ! BR2_PACKAGE_GPSD_PYTHON
> 
>     config BR2_PACKAGE_GPSD_DAEMON
>         bool "daemon"
>         select BR2_PACKAGE_GPSD_CLIENTS
> 
> would cause errors like:
> 
>     package/gpsd/Config.in:27:error: recursive dependency detected!
>     package/gpsd/Config.in:27:      symbol BR2_PACKAGE_GPSD_DAEMON is selected by BR2_PACKAGE_GPSD_CLIENTS
>     package/gpsd/Config.in:226:     symbol BR2_PACKAGE_GPSD_CLIENTS is selected by BR2_PACKAGE_GPSD_DAEMON
> 
> So we chose the next best option: ensure that the clients get built, if
> nothing else does.
> 
> Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
> Cc: Bernd Kuhls <bernd@kuhls.net>

Tested this with Raspberry Pi 0w with U-Blox module. First time I enabled
Python tools only (tested ubxtool), then the daemon with clients.

Looks good to me.

Reviewed-by: Jan Havran <havran.jan@email.cz>
Tested-by: Jan Havran <havran.jan@email.cz>

> ---
>  package/gpsd/Config.in | 13 +++++++++
>  package/gpsd/gpsd.mk   | 62 ++++++++++++++++++++++++------------------
>  2 files changed, 49 insertions(+), 26 deletions(-)
> 
> diff --git a/package/gpsd/Config.in b/package/gpsd/Config.in
> index cbdcdb5725..92a124b8ac 100644
> --- a/package/gpsd/Config.in
> +++ b/package/gpsd/Config.in
> @@ -9,6 +9,8 @@ menuconfig BR2_PACKAGE_GPSD
>  	depends on BR2_TOOLCHAIN_HAS_THREADS
>  	# Always tries to build a shared library
>  	depends on !BR2_STATIC_LIBS
> +	select BR2_PACKAGE_GPSD_CLIENTS if !BR2_PACKAGE_GPSD_DAEMON \
> +				       && !BR2_PACKAGE_GPSD_PYTHON
>  	help
>  	  gpsd is a service daemon that monitors one or more GPSes or
>  	  AIS receivers attached to a host computer through serial or
> @@ -22,6 +24,15 @@ menuconfig BR2_PACKAGE_GPSD
>  
>  if BR2_PACKAGE_GPSD
>  
> +config BR2_PACKAGE_GPSD_DAEMON
> +	bool "gpsd daemon"
> +	default y # legacy
> +	select BR2_PACKAGE_GPSD_CLIENTS
> +	help
> +	  Build and install the gpsd daemon itself
> +
> +if BR2_PACKAGE_GPSD_DAEMON
> +
>  config BR2_PACKAGE_GPSD_DEVICES
>  	string "Where to look for GPSes"
>  	default "/dev/ttyS1"
> @@ -210,6 +221,8 @@ config BR2_PACKAGE_GPSD_UBX
>  	help
>  	  uBlox UBX binary support
>  
> +endif  # GPSD_DAEMON
> +
>  config BR2_PACKAGE_GPSD_CLIENTS
>  	bool "gpsd clients"
>  	default y # legacy
> diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk
> index 77c6f6c562..8f87766dcc 100644
> --- a/package/gpsd/gpsd.mk
> +++ b/package/gpsd/gpsd.mk
> @@ -26,8 +26,7 @@ GPSD_SCONS_OPTS = \
>  	prefix=/usr \
>  	sysroot=$(STAGING_DIR) \
>  	strip=no \
> -	qt=no \
> -	systemd=$(if $(BR2_INIT_SYSTEMD),yes,no)
> +	qt=no
>  
>  ifeq ($(BR2_PACKAGE_NCURSES),y)
>  GPSD_DEPENDENCIES += ncurses
> @@ -178,6 +177,40 @@ ifeq ($(BR2_PACKAGE_GPSD_MAX_DEV),y)
>  GPSD_SCONS_OPTS += max_devices=$(BR2_PACKAGE_GPSD_MAX_DEV_VALUE)
>  endif
>  
> +ifeq ($(BR2_PACKAGE_GPSD_DAEMON),y)
> +GPSD_SCONS_OPTS += \
> +	gpsd=yes \
> +	systemd=$(if $(BR2_INIT_SYSTEMD),yes,no)
> +
> +GPSD_INSTALL_RULE = $(if $(BR2_PACKAGE_HAS_UDEV),udev-install,install)
> +
> +# When using chrony, wait for after Buildroot's chrony.service
> +ifeq ($(BR2_PACKAGE_CHRONY),y)
> +define GPSD_INSTALL_INIT_SYSTEMD
> +	$(INSTALL) -D -m 0644 $(GPSD_PKGDIR)/br-chrony.conf \
> +		$(TARGET_DIR)/usr/lib/systemd/system/gpsd.service.d/br-chrony.conf
> +endef
> +endif
> +
> +define GPSD_INSTALL_INIT_SYSV
> +	$(INSTALL) -m 0755 -D package/gpsd/S50gpsd $(TARGET_DIR)/etc/init.d/S50gpsd
> +	$(SED) 's,^DEVICES=.*,DEVICES=$(BR2_PACKAGE_GPSD_DEVICES),' $(TARGET_DIR)/etc/init.d/S50gpsd
> +endef
> +
> +# After the udev rule is installed, make it writable so that this
> +# package can be re-built/re-installed.
> +ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
> +define GPSD_INSTALL_UDEV_RULES
> +	chmod u+w $(TARGET_DIR)/lib/udev/rules.d/25-gpsd.rules
> +endef
> +GPSD_POST_INSTALL_TARGET_HOOKS += GPSD_INSTALL_UDEV_RULES
> +endif
> +
> +else # GPSD_DAEMON
> +GPSD_SCONS_OPTS += gpsd=no systemd=no
> +GPSD_INSTALL_RULE = install
> +endif
> +
>  ifeq ($(BR2_PACKAGE_GPSD_CLIENTS),y)
>  GPSD_SCONS_OPTS += gpsdclients=yes
>  else
> @@ -211,22 +244,9 @@ define GPSD_INSTALL_TARGET_CMDS
>  		DESTDIR=$(TARGET_DIR) \
>  		$(SCONS) \
>  		$(GPSD_SCONS_OPTS) \
> -		$(if $(BR2_PACKAGE_HAS_UDEV),udev-install,install))
> +		$(GPSD_INSTALL_RULE))
>  endef
>  
> -define GPSD_INSTALL_INIT_SYSV
> -	$(INSTALL) -m 0755 -D package/gpsd/S50gpsd $(TARGET_DIR)/etc/init.d/S50gpsd
> -	$(SED) 's,^DEVICES=.*,DEVICES=$(BR2_PACKAGE_GPSD_DEVICES),' $(TARGET_DIR)/etc/init.d/S50gpsd
> -endef
> -
> -# When using chrony, wait for after Buildroot's chrony.service
> -ifeq ($(BR2_PACKAGE_CHRONY),y)
> -define GPSD_INSTALL_INIT_SYSTEMD
> -	$(INSTALL) -D -m 0644 $(GPSD_PKGDIR)/br-chrony.conf \
> -		$(TARGET_DIR)/usr/lib/systemd/system/gpsd.service.d/br-chrony.conf
> -endef
> -endif
> -
>  define GPSD_INSTALL_STAGING_CMDS
>  	(cd $(@D); \
>  		$(GPSD_SCONS_ENV) \
> @@ -236,14 +256,4 @@ define GPSD_INSTALL_STAGING_CMDS
>  		install)
>  endef
>  
> -# After the udev rule is installed, make it writable so that this
> -# package can be re-built/re-installed.
> -ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
> -define GPSD_INSTALL_UDEV_RULES
> -	chmod u+w $(TARGET_DIR)/lib/udev/rules.d/25-gpsd.rules
> -endef
> -
> -GPSD_POST_INSTALL_TARGET_HOOKS += GPSD_INSTALL_UDEV_RULES
> -endif
> -
>  $(eval $(generic-package))
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH 1/5] package/gpsd: condition python stuff to the proper kconfig option
  2024-07-09 14:23 ` [Buildroot] [PATCH 1/5] package/gpsd: condition python stuff to the proper kconfig option yann.morin
@ 2024-07-14 21:52   ` Jan Havran
  2024-09-03 18:02   ` Peter Korsgaard
  1 sibling, 0 replies; 11+ messages in thread
From: Jan Havran @ 2024-07-14 21:52 UTC (permalink / raw)
  To: yann.morin; +Cc: Bernd Kuhls, buildroot

Hi,

V Tue, Jul 09, 2024 at 04:23:57PM +0200, yann.morin@orange.com napsal(a):
> From: "Yann E. MORIN" <yann.morin@orange.com>
> 
> Currently, we have a Kconfig symbol to enable the python support in
> gpsd, but the condition at configure time is based on whether the python
> package is enabled. So, if a user does not enable python support in
> gpsd, they still get it.
> 
> Switch to using the proper symbol.
> 
> Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
> Cc: Bernd Kuhls <bernd@kuhls.net>

Reviewed-by: Jan Havran <havran.jan@email.cz>

> ---
>  package/gpsd/gpsd.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk
> index 1d4013d122..c57fad83c3 100644
> --- a/package/gpsd/gpsd.mk
> +++ b/package/gpsd/gpsd.mk
> @@ -178,7 +178,7 @@ ifeq ($(BR2_PACKAGE_GPSD_MAX_DEV),y)
>  GPSD_SCONS_OPTS += max_devices=$(BR2_PACKAGE_GPSD_MAX_DEV_VALUE)
>  endif
>  
> -ifeq ($(BR2_PACKAGE_PYTHON3),y)
> +ifeq ($(BR2_PACKAGE_GPSD_PYTHON),y)
>  GPSD_SCONS_OPTS += \
>  	python=yes \
>  	python_libdir="/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages"
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH 0/5] package/gpsd: make the package more modular
  2024-07-09 14:23 [Buildroot] [PATCH 0/5] package/gpsd: make the package more modular yann.morin
                   ` (4 preceding siblings ...)
  2024-07-09 14:24 ` [Buildroot] [PATCH 5/5] package/gpsd: add option to enable/disable the daemon yann.morin
@ 2024-08-02 21:35 ` Thomas Petazzoni via buildroot
  5 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-02 21:35 UTC (permalink / raw)
  To: yann.morin; +Cc: Bernd Kuhls, buildroot

Hello,

On Tue, 9 Jul 2024 16:23:58 +0200
<yann.morin@orange.com> wrote:

> Yann E. MORIN (5):
>       package/gpsd: condition python stuff to the proper kconfig option
>       package/gpsd: fix comment about wchar requirement
>       package/gpsd: move python option later
>       package/gpsd: add option to enable clients
>       package/gpsd: add option to enable/disable the daemon

Thanks a lot! Series applied.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH 1/5] package/gpsd: condition python stuff to the proper kconfig option
  2024-07-09 14:23 ` [Buildroot] [PATCH 1/5] package/gpsd: condition python stuff to the proper kconfig option yann.morin
  2024-07-14 21:52   ` Jan Havran
@ 2024-09-03 18:02   ` Peter Korsgaard
  1 sibling, 0 replies; 11+ messages in thread
From: Peter Korsgaard @ 2024-09-03 18:02 UTC (permalink / raw)
  To: yann.morin; +Cc: Bernd Kuhls, buildroot

>>>>>   <yann.morin@orange.com> writes:

 > From: "Yann E. MORIN" <yann.morin@orange.com>
 > Currently, we have a Kconfig symbol to enable the python support in
 > gpsd, but the condition at configure time is based on whether the python
 > package is enabled. So, if a user does not enable python support in
 > gpsd, they still get it.

 > Switch to using the proper symbol.

 > Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
 > Cc: Bernd Kuhls <bernd@kuhls.net>

Committed to 2024.02.x and 2024.05.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Buildroot] [PATCH 2/5] package/gpsd: fix comment about wchar requirement
  2024-07-09 14:23 ` [Buildroot] [PATCH 2/5] package/gpsd: fix comment about wchar requirement yann.morin
@ 2024-09-03 18:02   ` Peter Korsgaard
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Korsgaard @ 2024-09-03 18:02 UTC (permalink / raw)
  To: yann.morin; +Cc: Bernd Kuhls, buildroot

>>>>>   <yann.morin@orange.com> writes:

 > From: "Yann E. MORIN" <yann.morin@orange.com>
 > The comment does not follow the coding style, so update it appropriately.

 > Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
 > Cc: Bernd Kuhls <bernd@kuhls.net>

Committed to 2024.02.x and 2024.05.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-09-03 18:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-09 14:23 [Buildroot] [PATCH 0/5] package/gpsd: make the package more modular yann.morin
2024-07-09 14:23 ` [Buildroot] [PATCH 1/5] package/gpsd: condition python stuff to the proper kconfig option yann.morin
2024-07-14 21:52   ` Jan Havran
2024-09-03 18:02   ` Peter Korsgaard
2024-07-09 14:23 ` [Buildroot] [PATCH 2/5] package/gpsd: fix comment about wchar requirement yann.morin
2024-09-03 18:02   ` Peter Korsgaard
2024-07-09 14:23 ` [Buildroot] [PATCH 3/5] package/gpsd: move python option later yann.morin
2024-07-09 14:24 ` [Buildroot] [PATCH 4/5] package/gpsd: add option to enable clients yann.morin
2024-07-09 14:24 ` [Buildroot] [PATCH 5/5] package/gpsd: add option to enable/disable the daemon yann.morin
2024-07-14 21:42   ` Jan Havran
2024-08-02 21:35 ` [Buildroot] [PATCH 0/5] package/gpsd: make the package more modular Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox