* [Buildroot] [PATCH v2 1/1] package/iputils: enable systemd services
@ 2019-11-01 6:18 James Hilliard
2019-11-01 10:34 ` Peter Korsgaard
0 siblings, 1 reply; 3+ messages in thread
From: James Hilliard @ 2019-11-01 6:18 UTC (permalink / raw)
To: buildroot
These are normally enabled by systemctl preset-all.
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
---
Changes v1 -> v2:
- simplify IPUTILS_CONF_OPTS
---
package/iputils/iputils.mk | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/package/iputils/iputils.mk b/package/iputils/iputils.mk
index 4a06581790..7a5357270a 100644
--- a/package/iputils/iputils.mk
+++ b/package/iputils/iputils.mk
@@ -46,12 +46,21 @@ IPUTILS_DEPENDENCIES += linux-headers
else
IPUTILS_CONF_OPTS += -DUSE_CRYPTO=none
# BUILD_NINFOD=true and USE_CRYPTO=none cannot be combined
-IPUTILS_CONF_OPTS += -DBUILD_NINFOD=false
+IPUTILS_NO_NINFOD = y
endif
# ninfod requires <pthread.h>
ifneq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
+IPUTILS_NO_NINFOD = y
+endif
+
+ifneq ($(IPUTILS_NO_NINFOD),y)
IPUTILS_CONF_OPTS += -DBUILD_NINFOD=false
+define IPUTILS_INSTALL_SERVICE_NINFOD
+ mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+ ln -sf ../../../../lib/systemd/system/ninfod.service \
+ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ninfod.service
+endef
endif
ifeq ($(BR2_SYSTEM_ENABLE_NLS),y)
@@ -103,4 +112,15 @@ define IPUTILS_PERMISSIONS
endef
endif
+define IPUTILS_INSTALL_SERVICE_RDISC
+ mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+ ln -sf ../../../../lib/systemd/system/rdisc.service \
+ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/rdisc.service
+endef
+
+define IPUTILS_INSTALL_INIT_SYSTEMD
+ $(IPUTILS_INSTALL_SERVICE_NINFOD)
+ $(IPUTILS_INSTALL_SERVICE_RDISC)
+endef
+
$(eval $(meson-package))
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH v2 1/1] package/iputils: enable systemd services
2019-11-01 6:18 [Buildroot] [PATCH v2 1/1] package/iputils: enable systemd services James Hilliard
@ 2019-11-01 10:34 ` Peter Korsgaard
2019-11-02 6:00 ` Petr Vorel
0 siblings, 1 reply; 3+ messages in thread
From: Peter Korsgaard @ 2019-11-01 10:34 UTC (permalink / raw)
To: buildroot
>>>>> "James" == James Hilliard <james.hilliard1@gmail.com> writes:
> These are normally enabled by systemctl preset-all.
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
> ---
> Changes v1 -> v2:
> - simplify IPUTILS_CONF_OPTS
> ---
> package/iputils/iputils.mk | 22 +++++++++++++++++++++-
> 1 file changed, 21 insertions(+), 1 deletion(-)
> diff --git a/package/iputils/iputils.mk b/package/iputils/iputils.mk
> index 4a06581790..7a5357270a 100644
> --- a/package/iputils/iputils.mk
> +++ b/package/iputils/iputils.mk
> @@ -46,12 +46,21 @@ IPUTILS_DEPENDENCIES += linux-headers
> else
> IPUTILS_CONF_OPTS += -DUSE_CRYPTO=none
> # BUILD_NINFOD=true and USE_CRYPTO=none cannot be combined
> -IPUTILS_CONF_OPTS += -DBUILD_NINFOD=false
> +IPUTILS_NO_NINFOD = y
> endif
> # ninfod requires <pthread.h>
> ifneq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
> +IPUTILS_NO_NINFOD = y
> +endif
> +
> +ifneq ($(IPUTILS_NO_NINFOD),y)
> IPUTILS_CONF_OPTS += -DBUILD_NINFOD=false
> +define IPUTILS_INSTALL_SERVICE_NINFOD
> + mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> + ln -sf ../../../../lib/systemd/system/ninfod.service \
> + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ninfod.service
> +endef
As mentioned, it doesn't make sense to disable infod and install the
service file under the same conditional.
The problem is really that negative logic is confusing, so I've changed
it to use positive logic (IPUTILS_NINFOD=y) and committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH v2 1/1] package/iputils: enable systemd services
2019-11-01 10:34 ` Peter Korsgaard
@ 2019-11-02 6:00 ` Petr Vorel
0 siblings, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2019-11-02 6:00 UTC (permalink / raw)
To: buildroot
Hi Peter,
> As mentioned, it doesn't make sense to disable infod and install the
> service file under the same conditional.
Sorry, for missing obvious error.
> The problem is really that negative logic is confusing, so I've changed
> it to use positive logic (IPUTILS_NINFOD=y) and committed, thanks.
+1. IPUTILS_NINFOD = n you did in the end is more readable.
Kind regards,
Petr
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-02 6:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-01 6:18 [Buildroot] [PATCH v2 1/1] package/iputils: enable systemd services James Hilliard
2019-11-01 10:34 ` Peter Korsgaard
2019-11-02 6:00 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox