Skip to contentSkip to conversation

package/dhcpcd: fix build without fork

PATCH New Fabrice Fontaine 2 participants 2 messages Jul 13, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/dhcpcd: fix build without fork

- Add a patch to fix build without fork in src/dhcpcd.c
- Disable privsep as it unconditionally uses fork (privsep has been enabled by default since version 9.0.0 and
https://github.com/rsmarples/dhcpcd/commit/3a4c2e5604d72151b06ed365aa71493740a3ad75)

Fixes:
- http://autobuild.buildroot.org/results/9fcc88abedcb8a02946f37837dcf4fff02f66c23

---
 ...-src-dhcpcd.c-fix-build-without-fork.patch | 36 +++++++++++++++++++
 package/dhcpcd/dhcpcd.mk                      |  2 +-
 2 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 package/dhcpcd/0001-src-dhcpcd.c-fix-build-without-fork.patch
package/dhcpcd/0001-src-dhcpcd.c-fix-build-without-fork.patch new file +36 -0
new file mode 100644
index 0000000000..07e6d642a7
@@ -0,0 +1,36 @@
+From 13e475d9847bf7d6a6af62397f67eb269e27613e Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Mon, 13 Jul 2020 10:43:51 +0200
+Subject: [PATCH] src/dhcpcd.c: fix build without fork
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Upstream status: https://github.com/rsmarples/dhcpcd/pull/17]
+---
+ src/dhcpcd.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/dhcpcd.c b/src/dhcpcd.c
+index ee585aa4..b597a5c0 100644
+--- a/src/dhcpcd.c
++++ b/src/dhcpcd.c
+@@ -336,7 +336,7 @@ dhcpcd_daemonise(struct dhcpcd_ctx *ctx)
+ #ifdef THERE_IS_NO_FORK
+ 	eloop_timeout_delete(ctx->eloop, handle_exit_timeout, ctx);
+ 	errno = ENOSYS;
+-	return 0;
++	return;
+ #else
+ 	int i;
+ 	unsigned int logopts = loggetopts();
+@@ -2211,7 +2211,7 @@ printpidfile:
+ 	ps_init(&ctx);
+ #endif
+ 
+-#ifdef USE_SIGNALS
++#if defined(USE_SIGNALS) && !defined(THERE_IS_NO_FORK)
+ 	if (pipe(sigpipe) == -1) {
+ 		logerr("pipe");
+ 		goto exit_failure;
+-- 
+2.27.0
+
package/dhcpcd/dhcpcd.mk +1 -1
index a40696924c..0dcd36f369 100644
@@ -16,7 +16,7 @@ DHCPCD_CONFIG_OPTS += --enable-static
 endif
 
 ifeq ($(BR2_USE_MMU),)
-DHCPCD_CONFIG_OPTS += --disable-fork
+DHCPCD_CONFIG_OPTS += --disable-fork --disable-privsep
 endif
 
 define DHCPCD_CONFIGURE_CMDS
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/1 package/dhcpcd: fix build without fork

Hello Fabrice,

Quoted 9 lines · On Mon, 13 Jul 2020 11:01:40 +0200 Fabrice Fontaine…

- Add a patch to fix build without fork in src/dhcpcd.
- Disable privsep as it unconditionally uses fork (privsep has been enabled by default since version 9.0.0 and
https://github.com/rsmarples/dhcpcd/commit/3a4c2e5604d72151b06ed365aa71493740a3ad75)

Fixes:
- http://autobuild.buildroot.org/results/9fcc88abedcb8a02946f37837dcf4fff02f66c23

I have applied, but your explanations are still too short, and they require additional effort from the maintainers to do research and have a proper commit log.

Indeed, where there is a build failure like this, just "fixing" it is not enough. We need to understand since when it is happening, and why, so that we can understand if the fix should be backported to a LTS or stable release.

So, I've done that research here, and extended the commit log as follows:

package/dhcpcd: fix build without fork

- Add a patch to fix build without fork in src/dhcpcd.c. This regression was introduced in upstream commit 3063ebb6c8ac7c96196fa923cdd5f7c0384de23b, which was merged in dhcpcd 9.0.0. Therefore, Buildroot is affected since we bumped from 8.0.3 to 9.1.4 in commit 809f548e79c6c099f1fa3e3728d90842be7059a7, which was applied after 2020.05

- Disable privsep as it unconditionally uses fork (privsep has been enabled by default since version 9.0.0 and
https://github.com/rsmarples/dhcpcd/commit/3a4c2e5604d72151b06ed365aa71493740a3ad75)

Fixes:

- http://autobuild.buildroot.org/results/9fcc88abedcb8a02946f37837dcf4fff02f66c23

Could you try to do that research in the future, and extend the commit log as appropriate ? This would really help reducing the effort on the maintainer shoulders.

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com