All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 0/4] package/dhcp
@ 2016-01-18 15:42 Doug Kehn
  2016-01-18 15:42 ` [Buildroot] [PATCH v3 1/4] package/dhcp: bump version to 4.3.3-P1 Doug Kehn
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Doug Kehn @ 2016-01-18 15:42 UTC (permalink / raw)
  To: buildroot

This patch series bumps dhcp package version to 4.3.3-P1. This series needed
additional consideration due to the embedded bind tar-ball that now exists
within the dhcp package.

This series has been tested with an arm-buildroot-linus-gnueabihf toolchain and
with an external toolchain (by Ricardo Martincoski).

Patches
   0002-dhcp-bind-host-gen.patch
   0003-toolchain-ar.patch
have been submitted upstream.

Buildroot thread
   http://lists.busybox.net/pipermail/buildroot/2016-January/149079.html
has related information.

Regards,
...doug

---
Changes v2 -> v3
  - removed RFC tag
  - updated version from 4.3.3 to 4.3.3-P1 (suggested by Richardo)
  - external toolchain support (suggested by Richardo)
Changes v1 -> v2
  - removed DHCP_PRE_BUILD_HOOKS in favor of patch (suggested by Arnout)
---
Doug Kehn (4):
  package/dhcp: bump version to 4.3.3-P1
  package/dhcp: add bind configure options for cross compiling
  package/dhcp: ensure host cc is used for compiling gen
  package/dhcp: remove hard coded ar referece

 package/dhcp/0001-bind-configure.patch     | 19 ++++++++++
 package/dhcp/0002-dhcp-bind-host-gen.patch | 22 ++++++++++++
 package/dhcp/0003-toolchain-ar.patch       | 58 ++++++++++++++++++++++++++++++
 package/dhcp/dhcp.hash                     |  4 +--
 package/dhcp/dhcp.mk                       | 17 ++++++++-
 5 files changed, 117 insertions(+), 3 deletions(-)
 create mode 100644 package/dhcp/0001-bind-configure.patch
 create mode 100644 package/dhcp/0002-dhcp-bind-host-gen.patch
 create mode 100644 package/dhcp/0003-toolchain-ar.patch

-- 
2.7.0

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

* [Buildroot] [PATCH v3 1/4] package/dhcp: bump version to 4.3.3-P1
  2016-01-18 15:42 [Buildroot] [PATCH v3 0/4] package/dhcp Doug Kehn
@ 2016-01-18 15:42 ` Doug Kehn
  2016-01-18 17:53   ` Arnout Vandecappelle
  2016-01-18 15:42 ` [Buildroot] [PATCH v3 2/4] package/dhcp: add bind configure options for cross compiling Doug Kehn
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Doug Kehn @ 2016-01-18 15:42 UTC (permalink / raw)
  To: buildroot

Parallel builds are not supported because the bind libraries must be
built first.

The embedded bind configure is called as part of dhcp make instead of
dhcp configure. dhcp make environment is expanded to ensure bind
configure has the proper information.

The embedded bind tar-ball is extracted after the source so patches can
be applied to dhcp and bind before the package is built.

Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
---
Changes v2 -> v3
  - removed RFC tag
  - updated version from 4.3.3 to 4.3.3-P1 (suggested by Richardo)
  - external toolchain support (suggested by Richardo)
Changes v1 -> v2
  - removed DHCP_PRE_BUILD_HOOKS in favor of patch (suggested by Arnout)
---
 package/dhcp/dhcp.hash |  4 ++--
 package/dhcp/dhcp.mk   | 17 ++++++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/package/dhcp/dhcp.hash b/package/dhcp/dhcp.hash
index 84e3c63..e2bb6d9 100644
--- a/package/dhcp/dhcp.hash
+++ b/package/dhcp/dhcp.hash
@@ -1,2 +1,2 @@
-# Verified from ftp://ftp.isc.org/isc/dhcp/4.1-ESV-R12/dhcp-4.1-ESV-R12.tar.gz.sha256.asc
-sha256	53265d1bf5e2073379df03c73a1a34d38a904307609c0f9cb77223912e753e5f	dhcp-4.1-ESV-R12.tar.gz
+# Verified from ftp://ftp.isc.org/isc/dhcp/4.3-3-P1/dhcp-4.3.3-P1.tar.gz.sha256.asc
+sha256 c11e896dffa1bfbc49462965d3f6dec45534e34068603546d9a236f2aa669921 dhcp-4.3.3-P1.tar.gz
diff --git a/package/dhcp/dhcp.mk b/package/dhcp/dhcp.mk
index c05e694..1bc088e 100644
--- a/package/dhcp/dhcp.mk
+++ b/package/dhcp/dhcp.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-DHCP_VERSION = 4.1-ESV-R12
+DHCP_VERSION = 4.3.3-P1
 DHCP_SITE = http://ftp.isc.org/isc/dhcp/$(DHCP_VERSION)
 DHCP_INSTALL_STAGING = YES
 DHCP_LICENSE = ISC
@@ -25,6 +25,21 @@ DHCP_CONF_OPTS = \
 	--with-relay-pid-file=/var/run/dhcrelay.pid \
 	--with-relay6-pid-file=/var/run/dhcrelay6.pid
 
+DHCP_MAKE=$(MAKE1)
+
+# Embedded bind configure is called as part of dhcp make instead of dhcp
+# configure. Pass configure env to make so bind configure has what it needs.
+DHCP_MAKE_ENV = \
+	$(TARGET_CONFIGURE_OPTS) \
+	GNU_TARGET_NAME=$(GNU_TARGET_NAME) \
+	GNU_HOST_NAME=$(GNU_HOST_NAME) \
+	BUILD_CC="$(HOSTCC)"
+
+define DHCP_EXTRACT_BIND
+	cd $(@D)/bind; tar -xvf bind.tar.gz
+endef
+DHCP_POST_EXTRACT_HOOKS += DHCP_EXTRACT_BIND
+
 ifeq ($(BR2_PACKAGE_DHCP_SERVER_DELAYED_ACK),y)
 DHCP_CONF_OPTS += --enable-delayed-ack
 endif
-- 
2.7.0

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

* [Buildroot] [PATCH v3 2/4] package/dhcp: add bind configure options for cross compiling
  2016-01-18 15:42 [Buildroot] [PATCH v3 0/4] package/dhcp Doug Kehn
  2016-01-18 15:42 ` [Buildroot] [PATCH v3 1/4] package/dhcp: bump version to 4.3.3-P1 Doug Kehn
@ 2016-01-18 15:42 ` Doug Kehn
  2016-01-18 17:56   ` Arnout Vandecappelle
  2016-01-18 15:42 ` [Buildroot] [PATCH v3 3/4] package/dhcp: ensure host cc is used for compiling gen Doug Kehn
  2016-01-18 15:42 ` [Buildroot] [PATCH v3 4/4] package/dhcp: remove hard coded ar referece Doug Kehn
  3 siblings, 1 reply; 9+ messages in thread
From: Doug Kehn @ 2016-01-18 15:42 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
---
Changes v2 -> v3
  - removed RFC tag
Changes v1 -> v2
  - no changes
---
 package/dhcp/0001-bind-configure.patch | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 package/dhcp/0001-bind-configure.patch

diff --git a/package/dhcp/0001-bind-configure.patch b/package/dhcp/0001-bind-configure.patch
new file mode 100644
index 0000000..9a38f45
--- /dev/null
+++ b/package/dhcp/0001-bind-configure.patch
@@ -0,0 +1,19 @@
+add bind configure options for cross compiling
+
+Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
+
+Index: dhcp-4.3.3-P1/bind/Makefile.in
+===================================================================
+--- dhcp-4.3.3-P1.orig/bind/Makefile.in
++++ dhcp-4.3.3-P1/bind/Makefile.in
+@@ -30,7 +30,9 @@ bindconfig = --disable-kqueue --disable-
+ 	--without-openssl --without-libxml2 --enable-exportlib \
+ 	--with-gssapi=no --enable-threads=no @BINDCONFIG@ \
+ 	--with-export-includedir=${binddir}/include \
+-	--with-export-libdir=${binddir}/lib
++	--with-export-libdir=${binddir}/lib \
++	--target=$(GNU_TARGET_NAME) --host=$(GNU_TARGET_NAME) \
++	--build=$(GNU_HOST_NAME) --with-randomdev=/dev/urandom
+ 
+ @BIND_ATF_FALSE at cleandirs = ./lib ./include
+ @BIND_ATF_TRUE at cleandirs = ./lib ./include ./atf
-- 
2.7.0

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

* [Buildroot] [PATCH v3 3/4] package/dhcp: ensure host cc is used for compiling gen
  2016-01-18 15:42 [Buildroot] [PATCH v3 0/4] package/dhcp Doug Kehn
  2016-01-18 15:42 ` [Buildroot] [PATCH v3 1/4] package/dhcp: bump version to 4.3.3-P1 Doug Kehn
  2016-01-18 15:42 ` [Buildroot] [PATCH v3 2/4] package/dhcp: add bind configure options for cross compiling Doug Kehn
@ 2016-01-18 15:42 ` Doug Kehn
  2016-01-18 15:42 ` [Buildroot] [PATCH v3 4/4] package/dhcp: remove hard coded ar referece Doug Kehn
  3 siblings, 0 replies; 9+ messages in thread
From: Doug Kehn @ 2016-01-18 15:42 UTC (permalink / raw)
  To: buildroot

This patch has been submitted upstream.

Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
---
Changes v2 -> v3
  - removed RFC tag
Changes v1 -> v2
  - no changes
---
 package/dhcp/0002-dhcp-bind-host-gen.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 package/dhcp/0002-dhcp-bind-host-gen.patch

diff --git a/package/dhcp/0002-dhcp-bind-host-gen.patch b/package/dhcp/0002-dhcp-bind-host-gen.patch
new file mode 100644
index 0000000..9db8a06
--- /dev/null
+++ b/package/dhcp/0002-dhcp-bind-host-gen.patch
@@ -0,0 +1,22 @@
+ensure host cc is used for compiling gen
+
+This patch is derived from:
+http://wiki.beyondlogic.org/patches/dhcp-4.3.0b1.bind_arm-linux-gnueabi.patch
+
+Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
+
+Index: dhcp-4.3.3-P1/bind/bind-9.9.7-P3/lib/export/dns/Makefile.in
+===================================================================
+--- dhcp-4.3.3-P1.orig/bind/bind-9.9.7-P3/lib/export/dns/Makefile.in
++++ dhcp-4.3.3-P1/bind/bind-9.9.7-P3/lib/export/dns/Makefile.in
+@@ -168,7 +168,9 @@ code.h:	gen
+ 	./gen -s ${srcdir} > code.h
+ 
+ gen: ${srcdir}/gen.c
+-	${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS}
++	${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc/include \
++		${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c \
++		${BUILD_LIBS}
+ 
+ #We don't need rbtdb64 for this library
+ #rbtdb64. at O@: rbtdb.c
-- 
2.7.0

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

* [Buildroot] [PATCH v3 4/4] package/dhcp: remove hard coded ar referece
  2016-01-18 15:42 [Buildroot] [PATCH v3 0/4] package/dhcp Doug Kehn
                   ` (2 preceding siblings ...)
  2016-01-18 15:42 ` [Buildroot] [PATCH v3 3/4] package/dhcp: ensure host cc is used for compiling gen Doug Kehn
@ 2016-01-18 15:42 ` Doug Kehn
  3 siblings, 0 replies; 9+ messages in thread
From: Doug Kehn @ 2016-01-18 15:42 UTC (permalink / raw)
  To: buildroot

Allow AR to be substituted so toolchain ar will be referenced when cross
compiling.

This patch has been submitted upstream.

Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
---
Changes v2 -> v3:
  - removed RFC tag
Changes v1 -> v2:
  - new for v2 (suggested by Arnout)
---
 package/dhcp/0003-toolchain-ar.patch | 58 ++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 package/dhcp/0003-toolchain-ar.patch

diff --git a/package/dhcp/0003-toolchain-ar.patch b/package/dhcp/0003-toolchain-ar.patch
new file mode 100644
index 0000000..17ad9c3
--- /dev/null
+++ b/package/dhcp/0003-toolchain-ar.patch
@@ -0,0 +1,58 @@
+remove hard coded ar reference
+
+Allow AR to be substituted so toolchain ar can be referenced when cross
+compiling.
+
+Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
+
+Index: dhcp-4.3.3-P1/common/Makefile.in
+===================================================================
+--- dhcp-4.3.3-P1.orig/common/Makefile.in
++++ dhcp-4.3.3-P1/common/Makefile.in
+@@ -99,7 +99,7 @@ CONFIG_HEADER = $(top_builddir)/includes
+ CONFIG_CLEAN_FILES =
+ CONFIG_CLEAN_VPATH_FILES =
+ LIBRARIES = $(noinst_LIBRARIES)
+-AR = ar
++AR = @AR@
+ ARFLAGS = cru
+ AM_V_AR = $(am__v_AR_ at AM_V@)
+ am__v_AR_ = $(am__v_AR_ at AM_DEFAULT_V@)
+Index: dhcp-4.3.3-P1/configure
+===================================================================
+--- dhcp-4.3.3-P1.orig/configure
++++ dhcp-4.3.3-P1/configure
+@@ -658,6 +658,7 @@ CPPFLAGS
+ LDFLAGS
+ CFLAGS
+ CC
++AR
+ host_os
+ host_vendor
+ host_cpu
+Index: dhcp-4.3.3-P1/dhcpctl/Makefile.in
+===================================================================
+--- dhcp-4.3.3-P1.orig/dhcpctl/Makefile.in
++++ dhcp-4.3.3-P1/dhcpctl/Makefile.in
+@@ -131,7 +131,7 @@ am__uninstall_files_from_dir = { \
+ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
+ 	"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)"
+ LIBRARIES = $(lib_LIBRARIES)
+-AR = ar
++AR = @AR@
+ ARFLAGS = cru
+ AM_V_AR = $(am__v_AR_ at AM_V@)
+ am__v_AR_ = $(am__v_AR_ at AM_DEFAULT_V@)
+Index: dhcp-4.3.3-P1/omapip/Makefile.in
+===================================================================
+--- dhcp-4.3.3-P1.orig/omapip/Makefile.in
++++ dhcp-4.3.3-P1/omapip/Makefile.in
+@@ -129,7 +129,7 @@ am__uninstall_files_from_dir = { \
+   }
+ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)"
+ LIBRARIES = $(lib_LIBRARIES)
+-AR = ar
++AR = @AR@
+ ARFLAGS = cru
+ AM_V_AR = $(am__v_AR_ at AM_V@)
+ am__v_AR_ = $(am__v_AR_ at AM_DEFAULT_V@)
-- 
2.7.0

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

* [Buildroot] [PATCH v3 1/4] package/dhcp: bump version to 4.3.3-P1
  2016-01-18 15:42 ` [Buildroot] [PATCH v3 1/4] package/dhcp: bump version to 4.3.3-P1 Doug Kehn
@ 2016-01-18 17:53   ` Arnout Vandecappelle
  2016-01-19 15:52     ` rdkehn at yahoo.com
  0 siblings, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle @ 2016-01-18 17:53 UTC (permalink / raw)
  To: buildroot

 Hi Doug,

Generic feedback on this series: it should be a single patch. The package will
not build for some configurations that currently work if you apply just patch 1,
so we would end up with a non-bisectable situation. We want patches to be split
up into single-function pieces, but at the same time we want to maintain
"correctness" after each individual patch.


On 18-01-16 16:42, Doug Kehn wrote:
> Parallel builds are not supported because the bind libraries must be
> built first.

 That could maybe be worked around by building the bind libraries explicitly in
a PRE_BUILD_HOOK. But that's something that can be done in a follow-up patch.

> 
> The embedded bind configure is called as part of dhcp make instead of
> dhcp configure. dhcp make environment is expanded to ensure bind
> configure has the proper information.

 You wrote earlier that it also worked if we explicitly configure in a
POST_CONFIGURE_HOOK, didn't you? That would be better because then we can
control the bind configure as well, see my comments in 0001-bind-configure.patch


> 
> The embedded bind tar-ball is extracted after the source so patches can
> be applied to dhcp and bind before the package is built.
> 
> Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
> Cc: Arnout Vandecappelle <arnout@mind.be>
> Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
> ---
> Changes v2 -> v3
>   - removed RFC tag
>   - updated version from 4.3.3 to 4.3.3-P1 (suggested by Richardo)
>   - external toolchain support (suggested by Richardo)
> Changes v1 -> v2
>   - removed DHCP_PRE_BUILD_HOOKS in favor of patch (suggested by Arnout)
> ---
>  package/dhcp/dhcp.hash |  4 ++--
>  package/dhcp/dhcp.mk   | 17 ++++++++++++++++-
>  2 files changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/package/dhcp/dhcp.hash b/package/dhcp/dhcp.hash
> index 84e3c63..e2bb6d9 100644
> --- a/package/dhcp/dhcp.hash
> +++ b/package/dhcp/dhcp.hash
> @@ -1,2 +1,2 @@
> -# Verified from ftp://ftp.isc.org/isc/dhcp/4.1-ESV-R12/dhcp-4.1-ESV-R12.tar.gz.sha256.asc
> -sha256	53265d1bf5e2073379df03c73a1a34d38a904307609c0f9cb77223912e753e5f	dhcp-4.1-ESV-R12.tar.gz
> +# Verified from ftp://ftp.isc.org/isc/dhcp/4.3-3-P1/dhcp-4.3.3-P1.tar.gz.sha256.asc
> +sha256 c11e896dffa1bfbc49462965d3f6dec45534e34068603546d9a236f2aa669921 dhcp-4.3.3-P1.tar.gz
> diff --git a/package/dhcp/dhcp.mk b/package/dhcp/dhcp.mk
> index c05e694..1bc088e 100644
> --- a/package/dhcp/dhcp.mk
> +++ b/package/dhcp/dhcp.mk
> @@ -4,7 +4,7 @@
>  #
>  ################################################################################
>  
> -DHCP_VERSION = 4.1-ESV-R12
> +DHCP_VERSION = 4.3.3-P1
>  DHCP_SITE = http://ftp.isc.org/isc/dhcp/$(DHCP_VERSION)
>  DHCP_INSTALL_STAGING = YES
>  DHCP_LICENSE = ISC
> @@ -25,6 +25,21 @@ DHCP_CONF_OPTS = \
>  	--with-relay-pid-file=/var/run/dhcrelay.pid \
>  	--with-relay6-pid-file=/var/run/dhcrelay6.pid
>  
> +DHCP_MAKE=$(MAKE1)
> +
> +# Embedded bind configure is called as part of dhcp make instead of dhcp
> +# configure. Pass configure env to make so bind configure has what it needs.

 So this wouldn't be needed with a POST_CONFIGURE_HOOK, right?


 Regards,
 Arnout

> +DHCP_MAKE_ENV = \
> +	$(TARGET_CONFIGURE_OPTS) \
> +	GNU_TARGET_NAME=$(GNU_TARGET_NAME) \
> +	GNU_HOST_NAME=$(GNU_HOST_NAME) \
> +	BUILD_CC="$(HOSTCC)"
> +
> +define DHCP_EXTRACT_BIND
> +	cd $(@D)/bind; tar -xvf bind.tar.gz
> +endef
> +DHCP_POST_EXTRACT_HOOKS += DHCP_EXTRACT_BIND
> +
>  ifeq ($(BR2_PACKAGE_DHCP_SERVER_DELAYED_ACK),y)
>  DHCP_CONF_OPTS += --enable-delayed-ack
>  endif
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v3 2/4] package/dhcp: add bind configure options for cross compiling
  2016-01-18 15:42 ` [Buildroot] [PATCH v3 2/4] package/dhcp: add bind configure options for cross compiling Doug Kehn
@ 2016-01-18 17:56   ` Arnout Vandecappelle
  2016-01-19 14:53     ` rdkehn at yahoo.com
  0 siblings, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle @ 2016-01-18 17:56 UTC (permalink / raw)
  To: buildroot

On 18-01-16 16:42, Doug Kehn wrote:
> Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
> ---
> Changes v2 -> v3
>   - removed RFC tag
> Changes v1 -> v2
>   - no changes
> ---
>  package/dhcp/0001-bind-configure.patch | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>  create mode 100644 package/dhcp/0001-bind-configure.patch
> 
> diff --git a/package/dhcp/0001-bind-configure.patch b/package/dhcp/0001-bind-configure.patch
> new file mode 100644
> index 0000000..9a38f45
> --- /dev/null
> +++ b/package/dhcp/0001-bind-configure.patch
> @@ -0,0 +1,19 @@
> +add bind configure options for cross compiling
> +
> +Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
> +
> +Index: dhcp-4.3.3-P1/bind/Makefile.in
> +===================================================================
> +--- dhcp-4.3.3-P1.orig/bind/Makefile.in
> ++++ dhcp-4.3.3-P1/bind/Makefile.in
> +@@ -30,7 +30,9 @@ bindconfig = --disable-kqueue --disable-
> + 	--without-openssl --without-libxml2 --enable-exportlib \
> + 	--with-gssapi=no --enable-threads=no @BINDCONFIG@ \
> + 	--with-export-includedir=${binddir}/include \
> +-	--with-export-libdir=${binddir}/lib
> ++	--with-export-libdir=${binddir}/lib \
> ++	--target=$(GNU_TARGET_NAME) --host=$(GNU_TARGET_NAME) \
> ++	--build=$(GNU_HOST_NAME) --with-randomdev=/dev/urandom

 I think the --target, --host and --build parts are upstreamable.

 However, the --with-randomdev certainly is not upstreamable in its current
form. It should probably use ac_cv_file__dev_random to decide.

 BTW we have a bit of an inconsistency here: in dhcp, we choose /dev/random but
in bind we choose /dev/urandom.

 Note that if we call configure explicitly in a POST_CONFIGURE_HOOK, then this
patch is not needed (although the --target, --host, --build stuff is of course
still interesting to improve its cross-compilation support).

 Regards,
 Arnout

> + 
> + @BIND_ATF_FALSE at cleandirs = ./lib ./include
> + @BIND_ATF_TRUE at cleandirs = ./lib ./include ./atf
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v3 2/4] package/dhcp: add bind configure options for cross compiling
  2016-01-18 17:56   ` Arnout Vandecappelle
@ 2016-01-19 14:53     ` rdkehn at yahoo.com
  0 siblings, 0 replies; 9+ messages in thread
From: rdkehn at yahoo.com @ 2016-01-19 14:53 UTC (permalink / raw)
  To: buildroot

Hi Arnout,

On Mon, Jan 18, 2016 at 06:56:56PM +0100, Arnout Vandecappelle wrote:
> On 18-01-16 16:42, Doug Kehn wrote:
> > Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
> > ---
> > Changes v2 -> v3
> >   - removed RFC tag
> > Changes v1 -> v2
> >   - no changes
> > ---
> >  package/dhcp/0001-bind-configure.patch | 19 +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> >  create mode 100644 package/dhcp/0001-bind-configure.patch
> > 
> > diff --git a/package/dhcp/0001-bind-configure.patch b/package/dhcp/0001-bind-configure.patch
> > new file mode 100644
> > index 0000000..9a38f45
> > --- /dev/null
> > +++ b/package/dhcp/0001-bind-configure.patch
> > @@ -0,0 +1,19 @@
> > +add bind configure options for cross compiling
> > +
> > +Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
> > +
> > +Index: dhcp-4.3.3-P1/bind/Makefile.in
> > +===================================================================
> > +--- dhcp-4.3.3-P1.orig/bind/Makefile.in
> > ++++ dhcp-4.3.3-P1/bind/Makefile.in
> > +@@ -30,7 +30,9 @@ bindconfig = --disable-kqueue --disable-
> > + 	--without-openssl --without-libxml2 --enable-exportlib \
> > + 	--with-gssapi=no --enable-threads=no @BINDCONFIG@ \
> > + 	--with-export-includedir=${binddir}/include \
> > +-	--with-export-libdir=${binddir}/lib
> > ++	--with-export-libdir=${binddir}/lib \
> > ++	--target=$(GNU_TARGET_NAME) --host=$(GNU_TARGET_NAME) \
> > ++	--build=$(GNU_HOST_NAME) --with-randomdev=/dev/urandom
> 
>  I think the --target, --host and --build parts are upstreamable.

Agree. I figured out that changing this to '--target=@target_alias@
--host=@host_alias@ --build=@build_alias@' is much cleaner. I will
clean this patch up.

> 
>  However, the --with-randomdev certainly is not upstreamable in its current
> form. It should probably use ac_cv_file__dev_random to decide.

Agree. dhcp configure has a BINDCONFIG environment variable that can
be used to set this (e.g. BINDCONFIG='--with-randomdev=/dev/random).
However, dhcp configure has BINDCONFIG hardcoded. An upstreamable
patch to dhcp configure resolves this.

> 
>  BTW we have a bit of an inconsistency here: in dhcp, we choose /dev/random but
> in bind we choose /dev/urandom.

Thanks.

> 
>  Note that if we call configure explicitly in a POST_CONFIGURE_HOOK, then this
> patch is not needed (although the --target, --host, --build stuff is of course
> still interesting to improve its cross-compilation support).

I don't think it is a good idea to call bind configure directly
since bind Makefile, which calls bind configure, has bind specific
configure parameters. Do you agree?

Regards,
...doug

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

* [Buildroot] [PATCH v3 1/4] package/dhcp: bump version to 4.3.3-P1
  2016-01-18 17:53   ` Arnout Vandecappelle
@ 2016-01-19 15:52     ` rdkehn at yahoo.com
  0 siblings, 0 replies; 9+ messages in thread
From: rdkehn at yahoo.com @ 2016-01-19 15:52 UTC (permalink / raw)
  To: buildroot

Hi Arnout,

On Mon, Jan 18, 2016 at 06:53:49PM +0100, Arnout Vandecappelle wrote:
>  Hi Doug,
> 
> Generic feedback on this series: it should be a single patch. The package will
> not build for some configurations that currently work if you apply just patch 1,
> so we would end up with a non-bisectable situation. We want patches to be split
> up into single-function pieces, but at the same time we want to maintain
> "correctness" after each individual patch.

Okay, I wasn't sure which would be better. I will resubmit as single patch.
> 
> 
> On 18-01-16 16:42, Doug Kehn wrote:
> > Parallel builds are not supported because the bind libraries must be
> > built first.
> 
>  That could maybe be worked around by building the bind libraries explicitly in
> a PRE_BUILD_HOOK. But that's something that can be done in a follow-up patch.
> 

Digging further, it's bind that needs -j1. A PRE_BUILD_HOOK can be
added for bind that uses $(MAKE1). If a PRE_BUILD_HOOK is added,
then bind potentially ends up with a POST_CONFIGURE_HOOK (see below)
and a PRE_BUILD_HOOK.

Since I'm resubmitting the patch, it's not that big of a deal to add
a PRE_BUILD_HOOK to prevent all of dhcp being built with -j1. Which
do you prefer?

> > 
> > The embedded bind configure is called as part of dhcp make instead of
> > dhcp configure. dhcp make environment is expanded to ensure bind
> > configure has the proper information.
> 
>  You wrote earlier that it also worked if we explicitly configure in a
> POST_CONFIGURE_HOOK, didn't you? That would be better because then we can
> control the bind configure as well, see my comments in 0001-bind-configure.patch

It's not an explicit call to bind's configure. dhcp configure
creates a bind Makefile. This Makefile is called from dhcp make to
un-tar, configure, and make the embedded bind source. The bind
Makefile created by dhcp configure contains configure options for
bind's configure. For a POST_CONFIGURE_HOOK, it would be better to
call:
   $(DHCP_BIND_CONF_ENV) $(DHCP_MAKE) -C $(@D)/bind bind1
as suggested by Ricardo. The bind1 target is responsible for
configuring bind.

As mentioned in response to 0001-bind-configure.patch, bind
configure options can be controlled with dhcp configure BINDCONFIG
variable.

I'll resubmit the patch with POST_CONFIGURE_HOOK.

> > 
> > The embedded bind tar-ball is extracted after the source so patches can
> > be applied to dhcp and bind before the package is built.
> > 
> > Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
> > Cc: Arnout Vandecappelle <arnout@mind.be>
> > Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
> > ---
> > Changes v2 -> v3
> >   - removed RFC tag
> >   - updated version from 4.3.3 to 4.3.3-P1 (suggested by Richardo)
> >   - external toolchain support (suggested by Richardo)
> > Changes v1 -> v2
> >   - removed DHCP_PRE_BUILD_HOOKS in favor of patch (suggested by Arnout)
> > ---
> >  package/dhcp/dhcp.hash |  4 ++--
> >  package/dhcp/dhcp.mk   | 17 ++++++++++++++++-
> >  2 files changed, 18 insertions(+), 3 deletions(-)
> > 
> > diff --git a/package/dhcp/dhcp.hash b/package/dhcp/dhcp.hash
> > index 84e3c63..e2bb6d9 100644
> > --- a/package/dhcp/dhcp.hash
> > +++ b/package/dhcp/dhcp.hash
> > @@ -1,2 +1,2 @@
> > -# Verified from ftp://ftp.isc.org/isc/dhcp/4.1-ESV-R12/dhcp-4.1-ESV-R12.tar.gz.sha256.asc
> > -sha256	53265d1bf5e2073379df03c73a1a34d38a904307609c0f9cb77223912e753e5f	dhcp-4.1-ESV-R12.tar.gz
> > +# Verified from ftp://ftp.isc.org/isc/dhcp/4.3-3-P1/dhcp-4.3.3-P1.tar.gz.sha256.asc
> > +sha256 c11e896dffa1bfbc49462965d3f6dec45534e34068603546d9a236f2aa669921 dhcp-4.3.3-P1.tar.gz
> > diff --git a/package/dhcp/dhcp.mk b/package/dhcp/dhcp.mk
> > index c05e694..1bc088e 100644
> > --- a/package/dhcp/dhcp.mk
> > +++ b/package/dhcp/dhcp.mk
> > @@ -4,7 +4,7 @@
> >  #
> >  ################################################################################
> >  
> > -DHCP_VERSION = 4.1-ESV-R12
> > +DHCP_VERSION = 4.3.3-P1
> >  DHCP_SITE = http://ftp.isc.org/isc/dhcp/$(DHCP_VERSION)
> >  DHCP_INSTALL_STAGING = YES
> >  DHCP_LICENSE = ISC
> > @@ -25,6 +25,21 @@ DHCP_CONF_OPTS = \
> >  	--with-relay-pid-file=/var/run/dhcrelay.pid \
> >  	--with-relay6-pid-file=/var/run/dhcrelay6.pid
> >  
> > +DHCP_MAKE=$(MAKE1)
> > +
> > +# Embedded bind configure is called as part of dhcp make instead of dhcp
> > +# configure. Pass configure env to make so bind configure has what it needs.
> 
>  So this wouldn't be needed with a POST_CONFIGURE_HOOK, right?

Yes, it is still needed. However, it would change from DHCP_MAKE_ENV
to DHCP_BIND_CONF_ENV.

I've attached an example dhcp.mk based on the discussion here.
Hopefully, it will help add clarity to the discussion.

Thanks,
...doug
-------------- next part --------------
################################################################################
#
# dhcp
#
################################################################################

DHCP_VERSION = 4.3.3-P1
DHCP_SITE = http://ftp.isc.org/isc/dhcp/$(DHCP_VERSION)
DHCP_INSTALL_STAGING = YES
DHCP_LICENSE = ISC
DHCP_LICENSE_FILES = LICENSE
DHCP_CONF_ENV = \
	CPPFLAGS='-D_PATH_DHCPD_CONF=\"/etc/dhcp/dhcpd.conf\" \
		-D_PATH_DHCLIENT_CONF=\"/etc/dhcp/dhclient.conf\"' \
	ac_cv_file__dev_random=yes \
	BINDCONFIG='--with-randomdev=/dev/random'
DHCP_CONF_OPTS = \
	--with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \
	--with-srv6-lease-file=/var/lib/dhcp/dhcpd6.leases \
	--with-cli-lease-file=/var/lib/dhcp/dhclient.leases \
	--with-cli6-lease-file=/var/lib/dhcp/dhclient6.leases \
	--with-srv-pid-file=/var/run/dhcpd.pid \
	--with-srv6-pid-file=/var/run/dhcpd6.pid \
	--with-cli-pid-file=/var/run/dhclient.pid \
	--with-cli6-pid-file=/var/run/dhclient6.pid \
	--with-relay-pid-file=/var/run/dhcrelay.pid \
	--with-relay6-pid-file=/var/run/dhcrelay6.pid

define DHCP_EXTRACT_BIND
	cd $(@D)/bind; tar -xvf bind.tar.gz
endef
DHCP_POST_EXTRACT_HOOKS += DHCP_EXTRACT_BIND

DHCP_BIND_CONF_ENV = \
	$(TARGET_CONFIGURE_OPTS) \
	BUILD_CC="$(HOSTCC)"

define DHCP_BIND_CONFIGURE
	$(DHCP_BIND_CONF_ENV) $(MAKE1) -C $(@D)/bind bind1
endef
DHCP_POST_CONFIGURE_HOOKS += DHCP_BIND_CONFIGURE

define DHCP_BIND_MAKE
	$(DHCP_MAKE_ENV) $(MAKE1) -C $(@D)/bind
endef
DHCP_PRE_BUILD_HOOKS += DHCP_BIND_MAKE

ifeq ($(BR2_PACKAGE_DHCP_SERVER_DELAYED_ACK),y)
DHCP_CONF_OPTS += --enable-delayed-ack
endif

ifeq ($(BR2_PACKAGE_DHCP_SERVER),y)
define DHCP_INSTALL_SERVER
	mkdir -p $(TARGET_DIR)/var/lib
	(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
	$(INSTALL) -m 0755 -D $(@D)/server/dhcpd $(TARGET_DIR)/usr/sbin/dhcpd
	$(INSTALL) -m 0644 -D package/dhcp/dhcpd.conf \
		$(TARGET_DIR)/etc/dhcp/dhcpd.conf
endef
endif

ifeq ($(BR2_PACKAGE_DHCP_RELAY),y)
define DHCP_INSTALL_RELAY
	mkdir -p $(TARGET_DIR)/var/lib
	(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
	$(INSTALL) -m 0755 -D $(DHCP_DIR)/relay/dhcrelay \
		$(TARGET_DIR)/usr/sbin/dhcrelay
endef
endif

ifeq ($(BR2_PACKAGE_DHCP_CLIENT),y)
define DHCP_INSTALL_CLIENT
	mkdir -p $(TARGET_DIR)/var/lib
	(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
	$(INSTALL) -m 0755 -D $(DHCP_DIR)/client/dhclient \
		$(TARGET_DIR)/sbin/dhclient
	$(INSTALL) -m 0644 -D package/dhcp/dhclient.conf \
		$(TARGET_DIR)/etc/dhcp/dhclient.conf
	$(INSTALL) -m 0755 -D package/dhcp/dhclient-script \
		$(TARGET_DIR)/sbin/dhclient-script
endef
endif

# Options don't matter, scripts won't start if binaries aren't there
define DHCP_INSTALL_INIT_SYSV
	$(INSTALL) -m 0755 -D package/dhcp/S80dhcp-server \
		$(TARGET_DIR)/etc/init.d/S80dhcp-server
	$(INSTALL) -m 0755 -D package/dhcp/S80dhcp-relay \
		$(TARGET_DIR)/etc/init.d/S80dhcp-relay
endef

ifeq ($(BR2_PACKAGE_DHCP_SERVER),y)
define DHCP_INSTALL_INIT_SYSTEMD
	$(INSTALL) -D -m 644 package/dhcp/dhcpd.service \
		$(TARGET_DIR)/usr/lib/systemd/system/dhcpd.service

	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants

	ln -sf ../../../../usr/lib/systemd/system/dhcpd.service \
		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dhcpd.service

	echo "d /var/lib/dhcp 0755 - - - -" > \
		$(TARGET_DIR)/usr/lib/tmpfiles.d/dhcpd.conf
	echo "f /var/lib/dhcp/dhcpd.leases - - - - -" >> \
		$(TARGET_DIR)/usr/lib/tmpfiles.d/dhcpd.conf
endef
endif

define DHCP_INSTALL_TARGET_CMDS
	$(DHCP_INSTALL_RELAY)
	$(DHCP_INSTALL_SERVER)
	$(DHCP_INSTALL_CLIENT)
endef

$(eval $(autotools-package))

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

end of thread, other threads:[~2016-01-19 15:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-18 15:42 [Buildroot] [PATCH v3 0/4] package/dhcp Doug Kehn
2016-01-18 15:42 ` [Buildroot] [PATCH v3 1/4] package/dhcp: bump version to 4.3.3-P1 Doug Kehn
2016-01-18 17:53   ` Arnout Vandecappelle
2016-01-19 15:52     ` rdkehn at yahoo.com
2016-01-18 15:42 ` [Buildroot] [PATCH v3 2/4] package/dhcp: add bind configure options for cross compiling Doug Kehn
2016-01-18 17:56   ` Arnout Vandecappelle
2016-01-19 14:53     ` rdkehn at yahoo.com
2016-01-18 15:42 ` [Buildroot] [PATCH v3 3/4] package/dhcp: ensure host cc is used for compiling gen Doug Kehn
2016-01-18 15:42 ` [Buildroot] [PATCH v3 4/4] package/dhcp: remove hard coded ar referece Doug Kehn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.