* [Buildroot] adding dhcpcd
@ 2013-03-01 18:37 John Stile
2013-03-01 18:47 ` Gustavo Zacarias
0 siblings, 1 reply; 26+ messages in thread
From: John Stile @ 2013-03-01 18:37 UTC (permalink / raw)
To: buildroot
I have a need for an RFC2131 compliant DHCP client, which dhcpcd
advertises to be (specifically it needs to detect if a dhcp server
becomes available).
I am using buildroot-2011.11.
I tried to add my own package to buildroot, to build dhcpcd, but I have
no idea how to go about integrating into the system.
I configure static vs. dynamic via /etc/network/interfaces, but should I
do next?
How does the default system decide what to do with networking?
What is the default dhcp client, and why isn't it RFC2131 compliant?
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-01 18:37 [Buildroot] adding dhcpcd John Stile
@ 2013-03-01 18:47 ` Gustavo Zacarias
2013-03-05 16:21 ` John Stile
0 siblings, 1 reply; 26+ messages in thread
From: Gustavo Zacarias @ 2013-03-01 18:47 UTC (permalink / raw)
To: buildroot
On 03/01/2013 03:37 PM, John Stile wrote:
> I have a need for an RFC2131 compliant DHCP client, which dhcpcd
> advertises to be (specifically it needs to detect if a dhcp server
> becomes available).
>
> I am using buildroot-2011.11.
>
> I tried to add my own package to buildroot, to build dhcpcd, but I have
> no idea how to go about integrating into the system.
>
> I configure static vs. dynamic via /etc/network/interfaces, but should I
> do next?
>
> How does the default system decide what to do with networking?
> What is the default dhcp client, and why isn't it RFC2131 compliant?
Hi.
If you're using a default buildroot skeleton without touching much then
/etc/init.d/S40network is called on system startup (from
/etc/init.d/rcS, which is invoked by init [/etc/inittab]).
S40network does an "ifup -a" (interface up, all) which is a busybox
applet/command that reads /etc/network/interfaces and does what it's
appropiate according to the configuration.
If your busybox config is default then udhcpc is built (busybox's dhcp
client) and that's what's used for DHCP.
For dhcpcd you probably don't want to use ifup nor S40network, you
probably want to run dhcpcd directly, something like "dhcpcd -b eth0" or
so. If link status messages are available it'll wait until carrier is
detected, and do the usual DHCP dance.
Regards.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-01 18:47 ` Gustavo Zacarias
@ 2013-03-05 16:21 ` John Stile
2013-03-05 18:47 ` Thomas Petazzoni
0 siblings, 1 reply; 26+ messages in thread
From: John Stile @ 2013-03-05 16:21 UTC (permalink / raw)
To: buildroot
On Fri, 2013-03-01 at 15:47 -0300, Gustavo Zacarias wrote:
> On 03/01/2013 03:37 PM, John Stile wrote:
>
> > I have a need for an RFC2131 compliant DHCP client, which dhcpcd
> > advertises to be (specifically it needs to detect if a dhcp server
> > becomes available).
> >
> > I am using buildroot-2011.11.
> >
> > I tried to add my own package to buildroot, to build dhcpcd, but I have
> > no idea how to go about integrating into the system.
> >
> > I configure static vs. dynamic via /etc/network/interfaces, but should I
> > do next?
> >
> > How does the default system decide what to do with networking?
> > What is the default dhcp client, and why isn't it RFC2131 compliant?
>
> Hi.
> If you're using a default buildroot skeleton without touching much then
> /etc/init.d/S40network is called on system startup (from
> /etc/init.d/rcS, which is invoked by init [/etc/inittab]).
> S40network does an "ifup -a" (interface up, all) which is a busybox
> applet/command that reads /etc/network/interfaces and does what it's
> appropiate according to the configuration.
> If your busybox config is default then udhcpc is built (busybox's dhcp
> client) and that's what's used for DHCP.
> For dhcpcd you probably don't want to use ifup nor S40network, you
> probably want to run dhcpcd directly, something like "dhcpcd -b eth0" or
> so. If link status messages are available it'll wait until carrier is
> detected, and do the usual DHCP dance.
> Regards.
>
Does this look like a good make file for buildroot?
Is this the right place to get advice on a make file, or even submit?
I put this together from various sources/references.
---------------
Makefile
---------------
# -*-makefile-*-
#############################################################
#
# dhcpcd
#
#############################################################
DHCPCD_VERSION=3.2.3
DHCPCD_SOURCE=dhcpcd-$(DHCPCD_VERSION).tar.bz2
DHCPCD_SITE=http://roy.marples.name/downloads/dhcpcd/
DHCPCD_DIR=$(BUILD_DIR)/dhcpcd-$(DHCPCD_VERSION)
DHCPCD_CAT:=$(BZCAT)
DHCPCD_BINARY:=dhcpcd
DHCPCD_TARGET_BINARY:=usr/bin/$(DHCPCD_BINARY)
#DHCPCD_DEPENDENCIES += ntp
DHCPCD_PATH := PATH=$(CROSS_PATH)
DHCPCD_ENV := $(CROSS_ENV)
# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------
$(DL_DIR)/$(DHCPCD_SOURCE):
$(call DOWNLOAD,$(DHCPCD_SITE),$(DHCPCD_SOURCE))
# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------
$(DHCPCD_DIR)/.unpacked: $(DL_DIR)/$(DHCPCD_SOURCE)
$(DHCPCD_CAT) $(DL_DIR)/$(DHCPCD_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
touch $@
# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------
$(DHCPCD_DIR)/.patched: $(DHCPCD_DIR)/.unpacked
support/scripts/apply-patches.sh $(DHCPCD_DIR) package/dhcpcd dhcpcd-$(DHCPCD_VERSION)\*.patch\*
touch $@
$(DHCPCD_DIR)/.configured: $(DHCPCD_DIR)/.patched
@$(cd $(DHCPCD_DIR) && \
$(DHCPCD_PATH) $(DHCPCD_ENV) \
./configure --target="armv5te"
@$(call clean, $(DHCPCD_DIR)/config.cache)
touch $@
# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------
$(DHCPCD_DIR)/$(DHCPCD_BINARY): $(DHCPCD_DIR)/.configured
$(MAKE) $(TARGET_CONFIGURE_OPTS) \
HAVE_FORK=yes HAVE_INIT=SYSV \
-C $(DHCPCD_DIR)
@$(call touch $(DHCPCD_DIR)/.stamp_built )
# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------
$(TARGET_DIR)/$(DHCPCD_TARGET_BINARY): $(DHCPCD_DIR)/$(DHCPCD_BINARY)
cp -dpf $(DHCPCD_DIR)/dhcpcd $@
$(STRIPCMD) --strip-unneeded $@
cp -dfp $(DHCPCD_DIR)/dhcpcd.sh $(TARGET_DIR)/etc/init.d/
# ----------------------------------------------------------------------------
# One rule to rule them all
# ----------------------------------------------------------------------------
dhcpcd: $(TARGET_DIR)/$(DHCPCD_TARGET_BINARY)
# Source download rule. Main purpose to download the source package. Since some
# people would like to work offline, it is mandotory to implement a rule which
# downloads everything this package needs.
dhcpcd-source: $(DL_DIR)/$(DHCPCD_SOURCE)
# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------
dhcpcd-clean:
-$(MAKE) -C $(DHCPCD_DIR) clean
# Directory clean rule. Main purpose is to remove the build directory, forcing
# a new extraction, patching and rebuild the next time Buildroot is made.
dhcpcd-dirclean:
rm -rf $(DHCPCD_DIR)
#############################################################
#
# Toplevel Makefile options
#
#############################################################
# This is how the dhcpcd package is added to the list of rules to build.
ifeq ($(BR2_PACKAGE_DHCPCD),y)
TARGETS+=dhcpcd
endif
# vim: syntax=make
-------------
Config.in
-------------
config BR2_PACKAGE_DHCPCD
bool "dhcpcd"
help
an RFC2131 compliant DHCP client
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-05 16:21 ` John Stile
@ 2013-03-05 18:47 ` Thomas Petazzoni
2013-03-06 18:01 ` John Stile
0 siblings, 1 reply; 26+ messages in thread
From: Thomas Petazzoni @ 2013-03-05 18:47 UTC (permalink / raw)
To: buildroot
Dear John Stile,
On Tue, 05 Mar 2013 08:21:17 -0800, John Stile wrote:
> Does this look like a good make file for buildroot?
Unfortunately no, it is not a good makefile. It uses a way of writing
packages that is deprecated since multiple years. Please use the
generic-package or autotools-package infrastructure. Refer to the
Buildroot manual at
http://buildroot.org/downloads/manual/manual.html#adding-packages.
> Is this the right place to get advice on a make file, or even submit?
It is a good place.
> I put this together from various sources/references.
Could you list which sources/references you've found, so that we can
kill them, and make those incorrect informations disappear?
The authoritative source of documentation for Buildroot is the
Buildroot documentation itself.
Raah, Google is great... but nowadays people use Google first and find
some random information, rather than first look at the project's
documentation. I don't blame you: I do the same in many cases :-)
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-05 18:47 ` Thomas Petazzoni
@ 2013-03-06 18:01 ` John Stile
2013-03-06 18:58 ` Thomas Petazzoni
0 siblings, 1 reply; 26+ messages in thread
From: John Stile @ 2013-03-06 18:01 UTC (permalink / raw)
To: buildroot
On Tue, 2013-03-05 at 19:47 +0100, Thomas Petazzoni wrote:
> Dear John Stile,
>
> On Tue, 05 Mar 2013 08:21:17 -0800, John Stile wrote:
>
> > Does this look like a good make file for buildroot?
>
> Unfortunately no, it is not a good makefile. It uses a way of writing
> packages that is deprecated since multiple years. Please use the
> generic-package or autotools-package infrastructure. Refer to the
> Buildroot manual at
> http://buildroot.org/downloads/manual/manual.html#adding-packages.
>
> > Is this the right place to get advice on a make file, or even submit?
>
> It is a good place.
>
> > I put this together from various sources/references.
>
> Could you list which sources/references you've found, so that we can
> kill them, and make those incorrect informations disappear?
>
> The authoritative source of documentation for Buildroot is the
> Buildroot documentation itself.
>
> Raah, Google is great... but nowadays people use Google first and find
> some random information, rather than first look at the project's
> documentation. I don't blame you: I do the same in many cases :-)
>
> Best regards,
>
> Thomas
If I'm going to rebuild a good package I might as well use the latest
version of dhcpcd, so I'll start with 5.6.7.
I am not sure if
http://roy.marples.name/downloads/dhcpcd/dhcpcd-5.6.7.tar.bz2
uses cmake or automake. The tarball contains a Makefile, and their
configure script has the comment, "Try and be like autotools configure,
but without autotools", so I assume it is just using gnu make. It does
contain a Makefile... but I don't see how to use it from:
http://buildroot.org/downloads/manual/manual.html#generic-package-tutorial
So I tried to make a pacakge using
$(eval $(generic-package))
When I run make in buildroot, the package is not downloaded, or built.
Below is my package file so far.
#############################################################
#
# dhcpcd
#
#############################################################
DHCPCD_VERSION = 5.6.7
DHCPCD_SOURCE = dhcpcd-$(DHCPCD_VERSION).tar.bz2
DHCPCD_SITE = http://roy.marples.name/downloads/dhcpcd
DHCPCD_LICENSE = GPLv3+
DHCPCD_LICENSE_FILES = COPYING
DHCPCD_INSTALL_STAGING = YES
DHCPCD_CONFIG_SCRIPTS = configure
DHCPCD_DEPENDENCIES =
DHCPCD_SITE_METHOD = wget
define DHCPCD_BUILD_CMDS
$(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D) all
endef
define DHCPCD_INSTALL_STAGING_CMDS
$(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf
$(STAGING_DIR)/etc/dhcpcd.conf
$(INSTALL) -D -m 0755 $(@D)/dhcpcd $(STAGING_DIR)/usr/bin/dhcpcd
endef
define DHCPCD_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin
$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/dhcpcd.conf
endef
define DHCPCD_PERMISSIONS
/usr/bin/dhcpcd f 4755 0 0 - - - - -
endef
$(eval $(generic-package))
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-06 18:01 ` John Stile
@ 2013-03-06 18:58 ` Thomas Petazzoni
2013-03-06 19:50 ` John Stile
0 siblings, 1 reply; 26+ messages in thread
From: Thomas Petazzoni @ 2013-03-06 18:58 UTC (permalink / raw)
To: buildroot
Dear John Stile,
On Wed, 06 Mar 2013 10:01:56 -0800, John Stile wrote:
> If I'm going to rebuild a good package I might as well use the latest
> version of dhcpcd, so I'll start with 5.6.7.
Good idea.
> I am not sure if
> http://roy.marples.name/downloads/dhcpcd/dhcpcd-5.6.7.tar.bz2
> uses cmake or automake. The tarball contains a Makefile, and their
> configure script has the comment, "Try and be like autotools configure,
> but without autotools", so I assume it is just using gnu make.
Your analysis is correct. It has an hand-crafted configure script that
writes values into a config.mk, which presumably, gets read by the
Makefile. So it's neither autotools nor CMake, so you have to use the
"generic-package" infrastructure.
> It does
> contain a Makefile... but I don't see how to use it from:
> http://buildroot.org/downloads/manual/manual.html#generic-package-tutorial
>
> So I tried to make a pacakge using
> $(eval $(generic-package))
Good.
Your file below has been line-wrapped by your e-mail client. Not a big
issue just to discuss, but if you want to submit a patch, you'll have
to fix your e-mail client, or better, use 'git send-email'.
> When I run make in buildroot, the package is not downloaded, or built.
> Below is my package file so far.
Please send a complete patch. The main reason is usually that your
BR2_PACKAGE_<foo> option is misnamed, or that the package is not
located in the proper directory.
When creating a package named "foo", it is very important that:
* The option in Config.in is BR2_PACKAGE_FOO.
* The package is located in package/foo/.
> #############################################################
> #
> # dhcpcd
> #
> #############################################################
>
> DHCPCD_VERSION = 5.6.7
> DHCPCD_SOURCE = dhcpcd-$(DHCPCD_VERSION).tar.bz2
> DHCPCD_SITE = http://roy.marples.name/downloads/dhcpcd
> DHCPCD_LICENSE = GPLv3+
> DHCPCD_LICENSE_FILES = COPYING
The license is not GPLv3+, it's BSD-2c, and there is no COPYING file.
> DHCPCD_INSTALL_STAGING = YES
No, it's just installing an application, so setting
DHCPD_INSTALL_STAGING to YES is not necessary.
> DHCPCD_CONFIG_SCRIPTS = configure
No, the configure script is not a <foo>-config script.
> DHCPCD_DEPENDENCIES =
Not needed, it is empty by default.
> DHCPCD_SITE_METHOD = wget
Not needed, it is guessed automatically from the URL (which starts by
http://).
Before the BUILD_CMDS, you should have a:
define DHCPD_CONFIGURE_CMDS
(cd $(@D);
...some environment variables...
./configure
...some options...)
endef
This will call the configure script.
> define DHCPCD_BUILD_CMDS
> $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D) all
> endef
If you run the configure script, then the CC and LD are defined in
config.mk, so there should be no need to pass them in the environment
anymore.
> define DHCPCD_INSTALL_STAGING_CMDS
> $(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf
> $(STAGING_DIR)/etc/dhcpcd.conf
> $(INSTALL) -D -m 0755 $(@D)/dhcpcd $(STAGING_DIR)/usr/bin/dhcpcd
> endef
Not needed as we should not be installing dhcpcd in the staging area.
> define DHCPCD_INSTALL_TARGET_CMDS
> $(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin
This should be:
$(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin/dhcpcd
> $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/dhcpcd.conf
Are you you want to create the /etc/dhcpcd.conf file? It would have
thought you wanted to copy the default dhcpcd.conf configuration file,
no? If so:
$(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf $(TARGET_DIR)/etc/dhcpcd.conf
> endef
>
> define DHCPCD_PERMISSIONS
> /usr/bin/dhcpcd f 4755 0 0 - - - - -
> endef
I'm not sure, does dhcpcd needs to be installed setuid-root?
Anyway, despite those comments, you are definitely on the right track
to create a proper package!
Thanks,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-06 18:58 ` Thomas Petazzoni
@ 2013-03-06 19:50 ` John Stile
2013-03-06 20:05 ` Reuben Dowle
2013-03-06 20:06 ` Thomas Petazzoni
0 siblings, 2 replies; 26+ messages in thread
From: John Stile @ 2013-03-06 19:50 UTC (permalink / raw)
To: buildroot
Dear Thomas,
On Wed, 2013-03-06 at 19:58 +0100, Thomas Petazzoni wrote:
> Dear John Stile,
>
> On Wed, 06 Mar 2013 10:01:56 -0800, John Stile wrote:
>
> > If I'm going to rebuild a good package I might as well use the latest
> > version of dhcpcd, so I'll start with 5.6.7.
>
> Good idea.
>
> > I am not sure if
> > http://roy.marples.name/downloads/dhcpcd/dhcpcd-5.6.7.tar.bz2
> > uses cmake or automake. The tarball contains a Makefile, and their
> > configure script has the comment, "Try and be like autotools configure,
> > but without autotools", so I assume it is just using gnu make.
>
> Your analysis is correct. It has an hand-crafted configure script that
> writes values into a config.mk, which presumably, gets read by the
> Makefile. So it's neither autotools nor CMake, so you have to use the
> "generic-package" infrastructure.
>
> > It does
> > contain a Makefile... but I don't see how to use it from:
> > http://buildroot.org/downloads/manual/manual.html#generic-package-tutorial
> >
> > So I tried to make a pacakge using
> > $(eval $(generic-package))
>
> Good.
>
> Your file below has been line-wrapped by your e-mail client. Not a big
> issue just to discuss, but if you want to submit a patch, you'll have
> to fix your e-mail client, or better, use 'git send-email'.
>
> > When I run make in buildroot, the package is not downloaded, or built.
> > Below is my package file so far.
>
> Please send a complete patch. The main reason is usually that your
> BR2_PACKAGE_<foo> option is misnamed, or that the package is not
> located in the proper directory.
>
> When creating a package named "foo", it is very important that:
>
> * The option in Config.in is BR2_PACKAGE_FOO.
>
> * The package is located in package/foo/.
>
> > #############################################################
> > #
> > # dhcpcd
> > #
> > #############################################################
> >
> > DHCPCD_VERSION = 5.6.7
> > DHCPCD_SOURCE = dhcpcd-$(DHCPCD_VERSION).tar.bz2
> > DHCPCD_SITE = http://roy.marples.name/downloads/dhcpcd
> > DHCPCD_LICENSE = GPLv3+
> > DHCPCD_LICENSE_FILES = COPYING
>
> The license is not GPLv3+, it's BSD-2c, and there is no COPYING file.
>
> > DHCPCD_INSTALL_STAGING = YES
>
> No, it's just installing an application, so setting
> DHCPD_INSTALL_STAGING to YES is not necessary.
>
> > DHCPCD_CONFIG_SCRIPTS = configure
>
> No, the configure script is not a <foo>-config script.
>
> > DHCPCD_DEPENDENCIES =
>
> Not needed, it is empty by default.
>
> > DHCPCD_SITE_METHOD = wget
>
> Not needed, it is guessed automatically from the URL (which starts by
> http://).
>
> Before the BUILD_CMDS, you should have a:
>
> define DHCPD_CONFIGURE_CMDS
> (cd $(@D);
> ...some environment variables...
> ./configure
> ...some options...)
> endef
>
> This will call the configure script.
>
> > define DHCPCD_BUILD_CMDS
> > $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D) all
> > endef
>
> If you run the configure script, then the CC and LD are defined in
> config.mk, so there should be no need to pass them in the environment
> anymore.
>
> > define DHCPCD_INSTALL_STAGING_CMDS
> > $(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf
> > $(STAGING_DIR)/etc/dhcpcd.conf
> > $(INSTALL) -D -m 0755 $(@D)/dhcpcd $(STAGING_DIR)/usr/bin/dhcpcd
> > endef
>
> Not needed as we should not be installing dhcpcd in the staging area.
>
> > define DHCPCD_INSTALL_TARGET_CMDS
> > $(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin
>
> This should be:
>
> $(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin/dhcpcd
>
> > $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/dhcpcd.conf
>
> Are you you want to create the /etc/dhcpcd.conf file? It would have
> thought you wanted to copy the default dhcpcd.conf configuration file,
> no? If so:
>
> $(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf $(TARGET_DIR)/etc/dhcpcd.conf
>
> > endef
> >
> > define DHCPCD_PERMISSIONS
> > /usr/bin/dhcpcd f 4755 0 0 - - - - -
> > endef
>
> I'm not sure, does dhcpcd needs to be installed setuid-root?
>
> Anyway, despite those comments, you are definitely on the right track
> to create a proper package!
> Thanks,
>
> Thomas
I think I have addressed the problem with the make file, but it still
silently does not build. I am attaching a complete patch.
------------------
Begin dhcpcd.patch
------------------
Adding package dhcpcd to buildroot
signed-off-by: John Stile <john@stilen.com>
--- a/buildroot-2011.11/package/Config.in 2013-03-06 11:40:52.000000000 -0800
+++ b/buildroot-2011.11/package/Config.in 2013-02-28 14:59:32.000000000 -0800
@@ -409,6 +409,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
source "package/dhcp/Config.in"
endif
source "package/dhcpdump/Config.in"
+source "package/dhcpcd/Config.in"
source "package/dnsmasq/Config.in"
source "package/dropbear/Config.in"
source "package/ebtables/Config.in"
--- a/buildroot-2011.11/package/dhcpcd/Config.in 2013-03-06 11:44:03.000000000 -0800
+++ b/buildroot-2011.11/package/dhcpcd/Config.in 2013-03-06 07:55:53.000000000 -0800
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_DHCPCD
+ bool "dhcpcd"
+ depends on BR2_INET_IPV6
+ help
+ an RFC2131 compliant DHCP client
--- a/buildroot-2011.11/package/dhcpcd/dhcpcd.mk 2013-03-06 11:44:03.000000000 -0800
+++ b/buildroot-2011.11/package/dhcpcd/dhcpcd.mk 2013-03-06 11:38:17.000000000 -0800
@@ -0,0 +1,43 @@
+#############################################################
+#
+# dhcpcd
+#
+#############################################################
+
+DHCPCD_VERSION = 5.6.7
+DHCPCD_SOURCE = dhcpcd-$(DHCPCD_VERSION).tar.bz2
+DHCPCD_SITE = http://roy.marples.name/downloads/dhcpcd/
+DHCPCD_LICENSE = BSD-2c
+DHCPCD_INSTALL_STAGING = NO
+
+CONFIG_ARGS = $(BR2_GCC_TARGET_ARCH)
+
+ifeq ($(BR2_USE_MMU),n)
+ CONFIG_ARGS =: --disable-fork
+endif
+
+define DHCPD_CONFIGURE_CMDS
+ (cd $(@D);
+ ...some environment variables...
+ ./configure \
+ $(CONFIG_ARGS) )
+endef
+
+define DHCPCD_BUILD_CMDS
+ $(MAKE) -C $(@D) all
+endef
+
+define DHCPCD_INSTALL_TARGET_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin/dhcpcd
+ $(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf $(TARGET_DIR)/etc/dhcpcd.conf
+endef
+
+define DHCPCD_DEVICES
+ #/dev/foo c 666 0 0 42 0 - - -
+endef
+
+define DHCPCD_PERMISSIONS
+ /usr/bin/dhcpcd f 4755 0 0 - - - - -
+endef
+
+$(eval $(generic-package))
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-06 19:50 ` John Stile
@ 2013-03-06 20:05 ` Reuben Dowle
2013-03-06 20:08 ` Thomas Petazzoni
2013-03-06 20:06 ` Thomas Petazzoni
1 sibling, 1 reply; 26+ messages in thread
From: Reuben Dowle @ 2013-03-06 20:05 UTC (permalink / raw)
To: buildroot
In your patch, you should probably replace the place-holder "...some environment variables..." with setting some actual environment variables.
-----Original Message-----
From: buildroot-bounces@busybox.net [mailto:buildroot-bounces at busybox.net] On Behalf Of John Stile
Sent: Thursday, 7 March 2013 8:50 a.m.
To: Thomas Petazzoni
Cc: buildroot
Subject: Re: [Buildroot] adding dhcpcd
Dear Thomas,
On Wed, 2013-03-06 at 19:58 +0100, Thomas Petazzoni wrote:
> Dear John Stile,
>
> On Wed, 06 Mar 2013 10:01:56 -0800, John Stile wrote:
>
> > If I'm going to rebuild a good package I might as well use the latest
> > version of dhcpcd, so I'll start with 5.6.7.
>
> Good idea.
>
> > I am not sure if
> > http://roy.marples.name/downloads/dhcpcd/dhcpcd-5.6.7.tar.bz2
> > uses cmake or automake. The tarball contains a Makefile, and their
> > configure script has the comment, "Try and be like autotools configure,
> > but without autotools", so I assume it is just using gnu make.
>
> Your analysis is correct. It has an hand-crafted configure script that
> writes values into a config.mk, which presumably, gets read by the
> Makefile. So it's neither autotools nor CMake, so you have to use the
> "generic-package" infrastructure.
>
> > It does
> > contain a Makefile... but I don't see how to use it from:
> > http://buildroot.org/downloads/manual/manual.html#generic-package-tutorial
> >
> > So I tried to make a pacakge using
> > $(eval $(generic-package))
>
> Good.
>
> Your file below has been line-wrapped by your e-mail client. Not a big
> issue just to discuss, but if you want to submit a patch, you'll have
> to fix your e-mail client, or better, use 'git send-email'.
>
> > When I run make in buildroot, the package is not downloaded, or built.
> > Below is my package file so far.
>
> Please send a complete patch. The main reason is usually that your
> BR2_PACKAGE_<foo> option is misnamed, or that the package is not
> located in the proper directory.
>
> When creating a package named "foo", it is very important that:
>
> * The option in Config.in is BR2_PACKAGE_FOO.
>
> * The package is located in package/foo/.
>
> > #############################################################
> > #
> > # dhcpcd
> > #
> > #############################################################
> >
> > DHCPCD_VERSION = 5.6.7
> > DHCPCD_SOURCE = dhcpcd-$(DHCPCD_VERSION).tar.bz2
> > DHCPCD_SITE = http://roy.marples.name/downloads/dhcpcd
> > DHCPCD_LICENSE = GPLv3+
> > DHCPCD_LICENSE_FILES = COPYING
>
> The license is not GPLv3+, it's BSD-2c, and there is no COPYING file.
>
> > DHCPCD_INSTALL_STAGING = YES
>
> No, it's just installing an application, so setting
> DHCPD_INSTALL_STAGING to YES is not necessary.
>
> > DHCPCD_CONFIG_SCRIPTS = configure
>
> No, the configure script is not a <foo>-config script.
>
> > DHCPCD_DEPENDENCIES =
>
> Not needed, it is empty by default.
>
> > DHCPCD_SITE_METHOD = wget
>
> Not needed, it is guessed automatically from the URL (which starts by
> http://).
>
> Before the BUILD_CMDS, you should have a:
>
> define DHCPD_CONFIGURE_CMDS
> (cd $(@D);
> ...some environment variables...
> ./configure
> ...some options...)
> endef
>
> This will call the configure script.
>
> > define DHCPCD_BUILD_CMDS
> > $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D) all
> > endef
>
> If you run the configure script, then the CC and LD are defined in
> config.mk, so there should be no need to pass them in the environment
> anymore.
>
> > define DHCPCD_INSTALL_STAGING_CMDS
> > $(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf
> > $(STAGING_DIR)/etc/dhcpcd.conf
> > $(INSTALL) -D -m 0755 $(@D)/dhcpcd $(STAGING_DIR)/usr/bin/dhcpcd
> > endef
>
> Not needed as we should not be installing dhcpcd in the staging area.
>
> > define DHCPCD_INSTALL_TARGET_CMDS
> > $(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin
>
> This should be:
>
> $(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin/dhcpcd
>
> > $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/dhcpcd.conf
>
> Are you you want to create the /etc/dhcpcd.conf file? It would have
> thought you wanted to copy the default dhcpcd.conf configuration file,
> no? If so:
>
> $(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf $(TARGET_DIR)/etc/dhcpcd.conf
>
> > endef
> >
> > define DHCPCD_PERMISSIONS
> > /usr/bin/dhcpcd f 4755 0 0 - - - - -
> > endef
>
> I'm not sure, does dhcpcd needs to be installed setuid-root?
>
> Anyway, despite those comments, you are definitely on the right track
> to create a proper package!
> Thanks,
>
> Thomas
I think I have addressed the problem with the make file, but it still
silently does not build. I am attaching a complete patch.
------------------
Begin dhcpcd.patch
------------------
Adding package dhcpcd to buildroot
signed-off-by: John Stile <john@stilen.com>
--- a/buildroot-2011.11/package/Config.in 2013-03-06 11:40:52.000000000 -0800
+++ b/buildroot-2011.11/package/Config.in 2013-02-28 14:59:32.000000000 -0800
@@ -409,6 +409,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
source "package/dhcp/Config.in"
endif
source "package/dhcpdump/Config.in"
+source "package/dhcpcd/Config.in"
source "package/dnsmasq/Config.in"
source "package/dropbear/Config.in"
source "package/ebtables/Config.in"
--- a/buildroot-2011.11/package/dhcpcd/Config.in 2013-03-06 11:44:03.000000000 -0800
+++ b/buildroot-2011.11/package/dhcpcd/Config.in 2013-03-06 07:55:53.000000000 -0800
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_DHCPCD
+ bool "dhcpcd"
+ depends on BR2_INET_IPV6
+ help
+ an RFC2131 compliant DHCP client
--- a/buildroot-2011.11/package/dhcpcd/dhcpcd.mk 2013-03-06 11:44:03.000000000 -0800
+++ b/buildroot-2011.11/package/dhcpcd/dhcpcd.mk 2013-03-06 11:38:17.000000000 -0800
@@ -0,0 +1,43 @@
+#############################################################
+#
+# dhcpcd
+#
+#############################################################
+
+DHCPCD_VERSION = 5.6.7
+DHCPCD_SOURCE = dhcpcd-$(DHCPCD_VERSION).tar.bz2
+DHCPCD_SITE = http://roy.marples.name/downloads/dhcpcd/
+DHCPCD_LICENSE = BSD-2c
+DHCPCD_INSTALL_STAGING = NO
+
+CONFIG_ARGS = $(BR2_GCC_TARGET_ARCH)
+
+ifeq ($(BR2_USE_MMU),n)
+ CONFIG_ARGS =: --disable-fork
+endif
+
+define DHCPD_CONFIGURE_CMDS
+ (cd $(@D);
+ ...some environment variables...
+ ./configure \
+ $(CONFIG_ARGS) )
+endef
+
+define DHCPCD_BUILD_CMDS
+ $(MAKE) -C $(@D) all
+endef
+
+define DHCPCD_INSTALL_TARGET_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin/dhcpcd
+ $(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf $(TARGET_DIR)/etc/dhcpcd.conf
+endef
+
+define DHCPCD_DEVICES
+ #/dev/foo c 666 0 0 42 0 - - -
+endef
+
+define DHCPCD_PERMISSIONS
+ /usr/bin/dhcpcd f 4755 0 0 - - - - -
+endef
+
+$(eval $(generic-package))
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
The information in this email communication (inclusive of attachments) is confidential to 4RF Limited and the intended recipient(s). If you are not the intended recipient(s), please note that any use, disclosure, distribution or copying of this information or any part thereof is strictly prohibited and that the author accepts no liability for the consequences of any action taken on the basis of the information provided. If you have received this email in error, please notify the sender immediately by return email and then delete all instances of this email from your system. 4RF Limited will not accept responsibility for any consequences associated with the use of this email (including, but not limited to, damages sustained as a result of any viruses and/or any action or lack of action taken in reliance on it).
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-06 19:50 ` John Stile
2013-03-06 20:05 ` Reuben Dowle
@ 2013-03-06 20:06 ` Thomas Petazzoni
1 sibling, 0 replies; 26+ messages in thread
From: Thomas Petazzoni @ 2013-03-06 20:06 UTC (permalink / raw)
To: buildroot
Dear John Stile,
On Wed, 06 Mar 2013 11:50:17 -0800, John Stile wrote:
> I think I have addressed the problem with the make file, but it still
> silently does not build. I am attaching a complete patch.
Are you sure you didn't forget to enable the package in menuconfig?
I've applied your patch as is, enabled the dhcpcd package in
menuconfig, and it starts building (sorry for the messages in French
below):
>>> dhcpcd 5.6.7 Downloading
--2013-03-06 20:59:38-- http://roy.marples.name/downloads/dhcpcd//dhcpcd-5.6.7.tar.bz2
R?solution de roy.marples.name (roy.marples.name)... 77.75.106.61, 2a01:348:31:2:209:5bff:fe84:887d
Connexion vers roy.marples.name (roy.marples.name)|77.75.106.61|:80... connect?.
requ?te HTTP transmise, en attente de la r?ponse... 200 OK
Longueur: 85983 (84K) [application/octet-stream]
Sauvegarde en : ?/opt/dl/dhcpcd-5.6.7.tar.bz2.tmp?
100%[========================================================================================================================================================>] 85 983 98,1K/s ds 0,9s
2013-03-06 20:59:39 (98,1 KB/s) - ?/opt/dl/dhcpcd-5.6.7.tar.bz2.tmp? sauvegard? [85983/85983]
>>> dhcpcd 5.6.7 Extracting
bzcat /opt/dl/dhcpcd-5.6.7.tar.bz2 | tar --strip-components=1 -C /home/thomas/projets/buildroot/output/build/dhcpcd-5.6.7 -xf -
>>> dhcpcd 5.6.7 Patching package//dhcpcd
>>> dhcpcd 5.6.7 Configuring
>>> dhcpcd 5.6.7 Building
/usr/bin/make -j8 -C /home/thomas/projets/buildroot/output/build/dhcpcd-5.6.7 all
make[1]: entrant dans le r?pertoire ? /home/thomas/projets/buildroot/output/build/dhcpcd-5.6.7 ?
Makefile:11: config.mk: Aucun fichier ou dossier de ce type
make[1]: *** Pas de r?gle pour fabriquer la cible ? config.mk ?. Arr?t.
make[1]: quittant le r?pertoire ? /home/thomas/projets/buildroot/output/build/dhcpcd-5.6.7 ?
make: *** [/home/thomas/projets/buildroot/output/build/dhcpcd-5.6.7/.stamp_built] Erreur 2
So the build starts, but fails. However, the configure step is not
done, because you use DHCPD_CONFIGURE_CMDS and not
DHCPCD_CONFIGURE_CMDS (maybe it was wrong in the e-mail I sent to you,
but basically, all variables have to start with the package name, in
upper-case letters).
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-06 20:05 ` Reuben Dowle
@ 2013-03-06 20:08 ` Thomas Petazzoni
2013-03-06 20:41 ` John Stile
0 siblings, 1 reply; 26+ messages in thread
From: Thomas Petazzoni @ 2013-03-06 20:08 UTC (permalink / raw)
To: buildroot
Dear Reuben Dowle,
On Wed, 6 Mar 2013 20:05:49 +0000, Reuben Dowle wrote:
> In your patch, you should probably replace the place-holder "...some environment variables..." with setting some actual environment variables.
Yes, indeed, but John was saying that the build of his package doesn't
even start, which I understood as "I run make", but nothing happens.
Oh, John, remember to do a 'make dhcpcd-dirclean' every time you want
to retry the build of your package. Once a package has been built in
output/build/<somepkg>-<someversion>/, Buildroot doesn't rebuild it.
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-06 20:08 ` Thomas Petazzoni
@ 2013-03-06 20:41 ` John Stile
2013-03-06 20:54 ` Thomas Petazzoni
0 siblings, 1 reply; 26+ messages in thread
From: John Stile @ 2013-03-06 20:41 UTC (permalink / raw)
To: buildroot
On Wed, 2013-03-06 at 21:08 +0100, Thomas Petazzoni wrote:
> Dear Reuben Dowle,
>
> On Wed, 6 Mar 2013 20:05:49 +0000, Reuben Dowle wrote:
>
> > In your patch, you should probably replace the place-holder "...some environment variables..." with setting some actual environment variables.
>
> Yes, indeed, but John was saying that the build of his package doesn't
> even start, which I understood as "I run make", but nothing happens.
>
> Oh, John, remember to do a 'make dhcpcd-dirclean' every time you want
> to retry the build of your package. Once a package has been built in
> output/build/<somepkg>-<someversion>/, Buildroot doesn't rebuild it.
>
> Best regards,
>
> Thomas
Yes, the place holder is bad, so I took it out.
I ran: make dhcpcd-dirclean
My buildroot-2011.11/.config holds
BR2_PACKAGE_DHCPCD=y
BR2_INET_IPV6=y
BR2_TOOLCHAIN_BUILDROOT_INET_IPV6=y
I cleaned up using:
rm -rf \
./dl/dhcpcd-3.2.3.tar.bz2 \
./output/build/dhcpcd-3.2.3 \
./output/build/buildroot-config/br2/package/dhcpcd.h \
./output/target/etc/init.d/dhcpcd.sh \
./output/target/usr/bin/dhcpcd
But make still does not do anything for dhcpcd.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-06 20:41 ` John Stile
@ 2013-03-06 20:54 ` Thomas Petazzoni
2013-03-06 21:02 ` John Stile
0 siblings, 1 reply; 26+ messages in thread
From: Thomas Petazzoni @ 2013-03-06 20:54 UTC (permalink / raw)
To: buildroot
Dear John Stile,
On Wed, 06 Mar 2013 12:41:20 -0800, John Stile wrote:
> Yes, the place holder is bad, so I took it out.
> I ran: make dhcpcd-dirclean
>
> My buildroot-2011.11/.config holds
> BR2_PACKAGE_DHCPCD=y
> BR2_INET_IPV6=y
> BR2_TOOLCHAIN_BUILDROOT_INET_IPV6=y
>
> I cleaned up using:
> rm -rf \
> ./dl/dhcpcd-3.2.3.tar.bz2 \
> ./output/build/dhcpcd-3.2.3 \
> ./output/build/buildroot-config/br2/package/dhcpcd.h \
> ./output/target/etc/init.d/dhcpcd.sh \
> ./output/target/usr/bin/dhcpcd
>
> But make still does not do anything for dhcpcd.
If you have dl/dhcpcd-3.2.3.tar.bz2 in your dl/ directory, then it
means that the package build process was started.
Can you do:
make dhcpcd-dirclean
make 2>&1 | tee logfile
Put the contents of logfile on http://code.bulix.org, and post the URL?
Thanks,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-06 20:54 ` Thomas Petazzoni
@ 2013-03-06 21:02 ` John Stile
2013-03-06 21:14 ` Thomas Petazzoni
0 siblings, 1 reply; 26+ messages in thread
From: John Stile @ 2013-03-06 21:02 UTC (permalink / raw)
To: buildroot
Hello Thomas,
On Wed, 2013-03-06 at 21:54 +0100, Thomas Petazzoni wrote:
> Dear John Stile,
>
> On Wed, 06 Mar 2013 12:41:20 -0800, John Stile wrote:
>
> > Yes, the place holder is bad, so I took it out.
> > I ran: make dhcpcd-dirclean
> >
> > My buildroot-2011.11/.config holds
> > BR2_PACKAGE_DHCPCD=y
> > BR2_INET_IPV6=y
> > BR2_TOOLCHAIN_BUILDROOT_INET_IPV6=y
> >
> > I cleaned up using:
> > rm -rf \
> > ./dl/dhcpcd-3.2.3.tar.bz2 \
> > ./output/build/dhcpcd-3.2.3 \
> > ./output/build/buildroot-config/br2/package/dhcpcd.h \
> > ./output/target/etc/init.d/dhcpcd.sh \
> > ./output/target/usr/bin/dhcpcd
> >
> > But make still does not do anything for dhcpcd.
>
> If you have dl/dhcpcd-3.2.3.tar.bz2 in your dl/ directory, then it
> means that the package build process was started.
>
> Can you do:
>
> make dhcpcd-dirclean
> make 2>&1 | tee logfile
>
> Put the contents of logfile on http://code.bulix.org, and post the URL?
>
> Thanks,
>
> Thomas
http://code.bulix.org/j63bd0-83103
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-06 21:02 ` John Stile
@ 2013-03-06 21:14 ` Thomas Petazzoni
2013-03-06 21:20 ` John Stile
0 siblings, 1 reply; 26+ messages in thread
From: Thomas Petazzoni @ 2013-03-06 21:14 UTC (permalink / raw)
To: buildroot
Dear John Stile,
On Wed, 06 Mar 2013 13:02:36 -0800, John Stile wrote:
> > Put the contents of logfile on http://code.bulix.org, and post the URL?
> >
> > Thanks,
>
> http://code.bulix.org/j63bd0-83103
Nothing besides that? Really weird, it all works fine from here. I'm
out of ideas for now, sorry. But again, if the dhcpcd tarball was
downloaded to dl/, then for sure at least at some point your
package .mk file got used.
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-06 21:14 ` Thomas Petazzoni
@ 2013-03-06 21:20 ` John Stile
2013-03-06 21:29 ` Thomas Petazzoni
0 siblings, 1 reply; 26+ messages in thread
From: John Stile @ 2013-03-06 21:20 UTC (permalink / raw)
To: buildroot
Dear Thomas Petazzoni,
On Wed, 2013-03-06 at 22:14 +0100, Thomas Petazzoni wrote:
> Dear John Stile,
>
> On Wed, 06 Mar 2013 13:02:36 -0800, John Stile wrote:
>
> > > Put the contents of logfile on http://code.bulix.org, and post the URL?
> > >
> > > Thanks,
> >
> > http://code.bulix.org/j63bd0-83103
>
> Nothing besides that? Really weird, it all works fine from here. I'm
> out of ideas for now, sorry. But again, if the dhcpcd tarball was
> downloaded to dl/, then for sure at least at some point your
> package .mk file got used.
>
> Best regards,
>
> Thomas
The version that was downloaded was from the make file that you said
wasn't very good, so I tried to make a new makefile but it just doesn't
work.
Could it be a problem that I am using buildroot-2011.11?
My project can't really upgrade right now, but I wonder if that could be
the cause.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-06 21:20 ` John Stile
@ 2013-03-06 21:29 ` Thomas Petazzoni
2013-03-06 22:57 ` John Stile
0 siblings, 1 reply; 26+ messages in thread
From: Thomas Petazzoni @ 2013-03-06 21:29 UTC (permalink / raw)
To: buildroot
Dear John Stile,
On Wed, 06 Mar 2013 13:20:28 -0800, John Stile wrote:
> The version that was downloaded was from the make file that you said
> wasn't very good, so I tried to make a new makefile but it just doesn't
> work.
>
> Could it be a problem that I am using buildroot-2011.11?
> My project can't really upgrade right now, but I wonder if that could be
> the cause.
Aaaah, you're using 2011.11!
So, yes indeed that explains it all.
Change the last line from:
$(eval $(generic-package))
to:
$(eval $(call GENTARGETS))
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-06 21:29 ` Thomas Petazzoni
@ 2013-03-06 22:57 ` John Stile
2013-03-06 23:48 ` Gilles Talis
0 siblings, 1 reply; 26+ messages in thread
From: John Stile @ 2013-03-06 22:57 UTC (permalink / raw)
To: buildroot
Dear Thomas Petazzoni,
On Wed, 2013-03-06 at 22:29 +0100, Thomas Petazzoni wrote:
> Dear John Stile,
>
> On Wed, 06 Mar 2013 13:20:28 -0800, John Stile wrote:
>
> > The version that was downloaded was from the make file that you said
> > wasn't very good, so I tried to make a new makefile but it just doesn't
> > work.
> >
> > Could it be a problem that I am using buildroot-2011.11?
> > My project can't really upgrade right now, but I wonder if that could be
> > the cause.
>
> Aaaah, you're using 2011.11!
>
> So, yes indeed that explains it all.
>
> Change the last line from:
>
> $(eval $(generic-package))
>
> to:
>
> $(eval $(call GENTARGETS))
>
> Best regards,
>
> Thomas
Aaaah, that helps. But it looks like it is not calling the configure
step. I have attached the current version as a patch.
>>> dhcpcd 5.6.7 Downloading
--2013-03-06 14:50:35-- http://roy.marples.name/downloads/dhcpcd//dhcpcd-5.6.7.tar.bz2
Resolving roy.marples.name... 77.75.106.61, 2a01:348:31:2:209:5bff:fe84:887d
Connecting to roy.marples.name|77.75.106.61|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 85983 (84K) [application/octet-stream]
Saving to: ?/home/jstile/svn_rmserver/buildroot-2011.11/dl/dhcpcd-5.6.7.tar.bz2?
100%[==========================================================================================================================>] 85,983 76.5KB/s in 1.1s
2013-03-06 14:50:36 (76.5 KB/s) - ?/home/jstile/svn_rmserver/buildroot-2011.11/dl/dhcpcd-5.6.7.tar.bz2? saved [85983/85983]
>>> dhcpcd 5.6.7 Extracting
bzcat /home/jstile/svn_rmserver/buildroot-2011.11/dl/dhcpcd-5.6.7.tar.bz2 | tar --strip-components=1 -C /home/jstile/svn_rmserver/buildroot-2011.11/output/build/dhcpcd-5.6.7 -xf -
>>> dhcpcd 5.6.7 Patching package//dhcpcd
>>> dhcpcd 5.6.7 Configuring
>>> dhcpcd 5.6.7 Building
/usr/bin/make -j2 CC="/home/jstile/svn_rmserver/buildroot-2011.11/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc" LD="/home/jstile/svn_rmserver/buildroot-2011.11/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-ld" -C /home/jstile/svn_rmserver/buildroot-2011.11/output/build/dhcpcd-5.6.7 all
make[1]: Entering directory `/home/jstile/svn_rmserver/buildroot-2011.11/output/build/dhcpcd-5.6.7'
Makefile:11: config.mk: No such file or directory
make[1]: *** No rule to make target `config.mk'. Stop.
make[1]: Leaving directory `/home/jstile/svn_rmserver/buildroot-2011.11/output/build/dhcpcd-5.6.7'
make: *** [/home/jstile/svn_rmserver/buildroot-2011.11/output/build/dhcpcd-5.6.7/.stamp_built] Error 2
------------------
patch
------------------
Adding pacakge dhcpcd to buildroot
signed-off-by: John Stile <john@stilen.com>
--- a/buildroot-2011.11/package/Config.in 2013-03-06 11:40:52.000000000 -0800
+++ b/buildroot-2011.11/package/Config.in 2013-02-28 14:59:32.000000000 -0800
@@ -409,6 +409,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
source "package/dhcp/Config.in"
endif
source "package/dhcpdump/Config.in"
+source "package/dhcpcd/Config.in"
source "package/dnsmasq/Config.in"
source "package/dropbear/Config.in"
source "package/ebtables/Config.in"
--- a/buildroot-2011.11/package/dhcpcd/Config.in 2013-03-06 11:44:03.000000000 -0800
+++ b/buildroot-2011.11/package/dhcpcd/Config.in 2013-03-06 07:55:53.000000000 -0800
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_DHCPCD
+ bool "dhcpcd"
+ depends on BR2_INET_IPV6
+ help
+ an RFC2131 compliant DHCP client
--- a/buildroot-2011.11/package/dhcpcd/dhcpcd.mk 2013-03-06 14:54:11.000000000 -0800
+++ b/buildroot-2011.11/package/dhcpcd/dhcpcd.mk 2013-03-06 14:50:13.000000000 -0800
@@ -0,0 +1,45 @@
+#############################################################
+#
+# dhcpcd
+#
+#############################################################
+
+DHCPCD_VERSION = 5.6.7
+DHCPCD_SOURCE = dhcpcd-$(DHCPCD_VERSION).tar.bz2
+DHCPCD_SITE = http://roy.marples.name/downloads/dhcpcd/
+DHCPCD_LICENSE = BSD-2c
+DHCPCD_INSTALL_STAGING = NO
+DHCPCD_PATH := PATH=$(CROSS_PATH)
+DHCPCD_ENV := $(CROSS_ENV)
+
+CONFIG_ARGS =: --target=$(BR2_GCC_TARGET_ARCH)
+
+ifeq ($(BR2_USE_MMU),n)
+ CONFIG_ARGS =: --disable-fork
+endif
+
+define DHCPD_CONFIGURE_CMDS
+ (cd $@D) && \
+ $(DHCPCD_PATH) $(DHCPCD_ENV) \
+ ./configure \
+ $(CONFIG_ARGS) )
+endef
+
+define DHCPCD_BUILD_CMDS
+ $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D) all
+endef
+
+define DHCPCD_INSTALL_TARGET_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin/dhcpcd
+ $(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf $(TARGET_DIR)/etc/dhcpcd.conf
+endef
+
+define DHCPCD_DEVICES
+ #/dev/foo c 666 0 0 42 0 - - -
+endef
+
+define DHCPCD_PERMISSIONS
+ /usr/bin/dhcpcd f 4755 0 0 - - - - -
+endef
+
+$(eval $(call GENTARGETS))
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-06 22:57 ` John Stile
@ 2013-03-06 23:48 ` Gilles Talis
2013-03-07 1:44 ` John Stile
0 siblings, 1 reply; 26+ messages in thread
From: Gilles Talis @ 2013-03-06 23:48 UTC (permalink / raw)
To: buildroot
Hi John,
2013/3/6 John Stile <john@stilen.com>:
> +define DHCPD_CONFIGURE_CMDS
> + (cd $@D) && \
> + $(DHCPCD_PATH) $(DHCPCD_ENV) \
> + ./configure \
> + $(CONFIG_ARGS) )
> +endef
I think there's a small typo here. It should be:
define DHCPCD_CONFIGURE_CMDS
instead of
define DHCPD_CONFIGURE_CMDS
This might make the difference.
regards,
Gilles.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-06 23:48 ` Gilles Talis
@ 2013-03-07 1:44 ` John Stile
2013-03-07 4:51 ` Gilles Talis
0 siblings, 1 reply; 26+ messages in thread
From: John Stile @ 2013-03-07 1:44 UTC (permalink / raw)
To: buildroot
Hello Gilles Talis,
On Wed, 2013-03-06 at 15:48 -0800, Gilles Talis wrote:
> Hi John,
>
> 2013/3/6 John Stile <john@stilen.com>:
> > +define DHCPD_CONFIGURE_CMDS
> > + (cd $@D) && \
> > + $(DHCPCD_PATH) $(DHCPCD_ENV) \
> > + ./configure \
> > + $(CONFIG_ARGS) )
> > +endef
>
> I think there's a small typo here. It should be:
> define DHCPCD_CONFIGURE_CMDS
> instead of
> define DHCPD_CONFIGURE_CMDS
>
> This might make the difference.
>
That did help. Thank you.
The build now fails because it can't find ifaddrs.h:
ipv6.c:34:21: error: ifaddrs.h: No such file or directory
net.c:56:21: error: ifaddrs.h: No such file or directory
But I do see the file here:
./output/toolchain/uClibc-0.9.32/include/ifaddrs.h
Is there a good way to specify the path in my .mk file?
----------------
patch
----------------
Adding pacakge dhcpcd to buildroot
signed-off-by: John Stile <john@stilen.com>
--- a/buildroot-2011.11/package/Config.in 2013-03-06 11:40:52.000000000
-0800
+++ b/buildroot-2011.11/package/Config.in 2013-02-28 14:59:32.000000000
-0800
@@ -409,6 +409,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
source "package/dhcp/Config.in"
endif
source "package/dhcpdump/Config.in"
+source "package/dhcpcd/Config.in"
source "package/dnsmasq/Config.in"
source "package/dropbear/Config.in"
source "package/ebtables/Config.in"
--- a/buildroot-2011.11/package/dhcpcd/Config.in 2013-03-06
11:44:03.000000000 -0800
+++ b/buildroot-2011.11/package/dhcpcd/Config.in 2013-03-06
07:55:53.000000000 -0800
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_DHCPCD
+ bool "dhcpcd"
+ depends on BR2_INET_IPV6
+ help
+ an RFC2131 compliant DHCP client
--- a/buildroot-2011.11/package/dhcpcd/dhcpcd.mk 2013-03-06
17:41:03.000000000 -0800
+++ b/buildroot-2011.11/package/dhcpcd/dhcpcd.mk 2013-03-06
17:38:29.000000000 -0800
@@ -0,0 +1,48 @@
+#############################################################
+#
+# dhcpcd
+#
+#############################################################
+
+DHCPCD_VERSION = 5.6.7
+DHCPCD_SOURCE = dhcpcd-$(DHCPCD_VERSION).tar.bz2
+DHCPCD_SITE = http://roy.marples.name/downloads/dhcpcd/
+DHCPCD_LICENSE = BSD-2c
+DHCPCD_INSTALL_STAGING = NO
+
+
+CONFIG_ARGS += --target=$(BR2_GCC_TARGET_ARCH)
+
+#CONFIG_ARGS += --with-cc=$(TARGET_CC)
+
+ifeq ($(BR2_USE_MMU),n)
+ CONFIG_ARGS += --disable-fork
+endif
+
+ifeq ($(BR2_INET_IPV6),)
+ DHCPCD_CFLAGS += -UHASIPv6
+endif
+
+define DHCPCD_CONFIGURE_CMDS
+ (cd $(@D); \
+ ./configure $(CONFIG_ARGS) )
+endef
+
+define DHCPCD_BUILD_CMDS
+ $(MAKE) $(TARGET_CONFIGURE_OPTS) CC="$(TARGET_CC)" LD="$(TARGET_LD)"
PATH=$(TARGET_PATH) $(DHCPCD_CFLAGS) -C $(@D) all
+endef
+
+define DHCPCD_INSTALL_TARGET_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin/dhcpcd
+ $(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf $(TARGET_DIR)/etc/dhcpcd.conf
+endef
+
+define DHCPCD_DEVICES
+ #/dev/foo c 666 0 0 42 0 - - -
+endef
+
+define DHCPCD_PERMISSIONS
+ /usr/bin/dhcpcd f 4755 0 0 - - - - -
+endef
+
+$(eval $(call GENTARGETS))
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-07 1:44 ` John Stile
@ 2013-03-07 4:51 ` Gilles Talis
2013-03-07 7:31 ` John Stile
0 siblings, 1 reply; 26+ messages in thread
From: Gilles Talis @ 2013-03-07 4:51 UTC (permalink / raw)
To: buildroot
Hi John,
> That did help. Thank you.
> The build now fails because it can't find ifaddrs.h:
> ipv6.c:34:21: error: ifaddrs.h: No such file or directory
> net.c:56:21: error: ifaddrs.h: No such file or directory
>
> But I do see the file here:
> ./output/toolchain/uClibc-0.9.32/include/ifaddrs.h
>
> Is there a good way to specify the path in my .mk file?
Did you build your toolchain with Buildroot? In buildroot-2011.11,
this feature is not enabled in uClibc-0.9.32 configuration.
In order to enable it, you can follow these steps (if you built your
toolchain using buildroot):
1. in toolchain/uClibc/uClibc-0.9.32.config, replace
# UCLIBC_SUPPORT_AI_ADDRCONFIG is not set
with
UCLIBC_SUPPORT_AI_ADDRCONFIG=y
2. run "make clean" then
3. run "make". Toolchain will be rebuilt with ifaddrs.h
This should get you going.
Gilles.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-07 4:51 ` Gilles Talis
@ 2013-03-07 7:31 ` John Stile
2013-03-07 8:53 ` Gilles Talis
0 siblings, 1 reply; 26+ messages in thread
From: John Stile @ 2013-03-07 7:31 UTC (permalink / raw)
To: buildroot
Hello Gilles,
On Wed, 2013-03-06 at 20:51 -0800, Gilles Talis wrote:
> Hi John,
>
> > That did help. Thank you.
> > The build now fails because it can't find ifaddrs.h:
> > ipv6.c:34:21: error: ifaddrs.h: No such file or directory
> > net.c:56:21: error: ifaddrs.h: No such file or directory
> >
> > But I do see the file here:
> > ./output/toolchain/uClibc-0.9.32/include/ifaddrs.h
> >
> > Is there a good way to specify the path in my .mk file?
> Did you build your toolchain with Buildroot? In buildroot-2011.11,
> this feature is not enabled in uClibc-0.9.32 configuration.
> In order to enable it, you can follow these steps (if you built your
> toolchain using buildroot):
>
> 1. in toolchain/uClibc/uClibc-0.9.32.config, replace
> # UCLIBC_SUPPORT_AI_ADDRCONFIG is not set
> with
> UCLIBC_SUPPORT_AI_ADDRCONFIG=y
>
> 2. run "make clean" then
> 3. run "make". Toolchain will be rebuilt with ifaddrs.h
>
> This should get you going.
> Gilles.
That did get me quite a bit farther.
... now it fails to find a few more symbols:
bpf.c:32:21: error: net/bpf.h: No such file or directory
In file included from bpf.c:49:
bpf-filter.h:33: error: array type has incomplete element type
bpf-filter.h:36: error: 'BPF_LD' undeclared here (not in a function)
bpf-filter.h:36: error: 'BPF_H' undeclared here (not in a function)
bpf-filter.h:36: error: 'BPF_ABS' undeclared here (not in a function)
bpf-filter.h:37: error: 'BPF_JMP' undeclared here (not in a function)
bpf-filter.h:37: error: 'BPF_JEQ' undeclared here (not in a function)
bpf-filter.h:37: error: 'BPF_K' undeclared here (not in a function)
bpf-filter.h:46: error: 'BPF_RET' undeclared here (not in a function)
bpf-filter.h:78: error: array type has incomplete element type
bpf-filter.h:85: error: 'BPF_B' undeclared here (not in a function)
bpf-filter.h:89: error: 'BPF_JSET' undeclared here (not in a function)
bpf-filter.h:91: error: 'BPF_LDX' undeclared here (not in a function)
bpf-filter.h:91: error: 'BPF_MSH' undeclared here (not in a function)
bpf-filter.h:93: error: 'BPF_IND' undeclared here (not in a function)
I can see output/build/dhcpcd-5.6.7/bpf.c
has: #include "bpf-filter.h"
I can see the symbols are defined in several files.
./output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/linux/filter.h
./output/toolchain/linux/include/linux/filter.h
./output/toolchain/uClibc_dev/usr/include/linux/filter.h
./output/toolchain/linux-2.6.38.8/include/linux/filter.h
Are there more magical ideas to keep this compile going?
Possibly another uClibc option?
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-07 7:31 ` John Stile
@ 2013-03-07 8:53 ` Gilles Talis
2013-03-07 14:53 ` John Stile
0 siblings, 1 reply; 26+ messages in thread
From: Gilles Talis @ 2013-03-07 8:53 UTC (permalink / raw)
To: buildroot
Hi John,
2013/3/6 John Stile <john@stilen.com>:
> That did get me quite a bit farther.
>
> ... now it fails to find a few more symbols:
> bpf.c:32:21: error: net/bpf.h: No such file or directory
> In file included from bpf.c:49:
> bpf-filter.h:33: error: array type has incomplete element type
> bpf-filter.h:36: error: 'BPF_LD' undeclared here (not in a function)
> bpf-filter.h:36: error: 'BPF_H' undeclared here (not in a function)
> bpf-filter.h:36: error: 'BPF_ABS' undeclared here (not in a function)
> bpf-filter.h:37: error: 'BPF_JMP' undeclared here (not in a function)
> bpf-filter.h:37: error: 'BPF_JEQ' undeclared here (not in a function)
> bpf-filter.h:37: error: 'BPF_K' undeclared here (not in a function)
> bpf-filter.h:46: error: 'BPF_RET' undeclared here (not in a function)
> bpf-filter.h:78: error: array type has incomplete element type
> bpf-filter.h:85: error: 'BPF_B' undeclared here (not in a function)
> bpf-filter.h:89: error: 'BPF_JSET' undeclared here (not in a function)
> bpf-filter.h:91: error: 'BPF_LDX' undeclared here (not in a function)
> bpf-filter.h:91: error: 'BPF_MSH' undeclared here (not in a function)
> bpf-filter.h:93: error: 'BPF_IND' undeclared here (not in a function)
>
> I can see output/build/dhcpcd-5.6.7/bpf.c
> has: #include "bpf-filter.h"
>
> I can see the symbols are defined in several files.
> ./output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/linux/filter.h
> ./output/toolchain/linux/include/linux/filter.h
> ./output/toolchain/uClibc_dev/usr/include/linux/filter.h
> ./output/toolchain/linux-2.6.38.8/include/linux/filter.h
Which OS are you trying to build this on? bpf.c is compiled only on
non-linux based-platforms (e.g. BSD).
I have tried myself on my ubuntu machine and dhcpcd builds fine.
Thanks
Gilles.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-07 8:53 ` Gilles Talis
@ 2013-03-07 14:53 ` John Stile
2013-03-07 15:03 ` Thomas Petazzoni
0 siblings, 1 reply; 26+ messages in thread
From: John Stile @ 2013-03-07 14:53 UTC (permalink / raw)
To: buildroot
Hello Gilles Talis,
On Thu, 2013-03-07 at 00:53 -0800, Gilles Talis wrote:
> Hi John,
>
> 2013/3/6 John Stile <john@stilen.com>:
> > That did get me quite a bit farther.
> >
> > ... now it fails to find a few more symbols:
> > bpf.c:32:21: error: net/bpf.h: No such file or directory
> > In file included from bpf.c:49:
> > bpf-filter.h:33: error: array type has incomplete element type
> > bpf-filter.h:36: error: 'BPF_LD' undeclared here (not in a function)
> > bpf-filter.h:36: error: 'BPF_H' undeclared here (not in a function)
> > bpf-filter.h:36: error: 'BPF_ABS' undeclared here (not in a function)
> > bpf-filter.h:37: error: 'BPF_JMP' undeclared here (not in a function)
> > bpf-filter.h:37: error: 'BPF_JEQ' undeclared here (not in a function)
> > bpf-filter.h:37: error: 'BPF_K' undeclared here (not in a function)
> > bpf-filter.h:46: error: 'BPF_RET' undeclared here (not in a function)
> > bpf-filter.h:78: error: array type has incomplete element type
> > bpf-filter.h:85: error: 'BPF_B' undeclared here (not in a function)
> > bpf-filter.h:89: error: 'BPF_JSET' undeclared here (not in a function)
> > bpf-filter.h:91: error: 'BPF_LDX' undeclared here (not in a function)
> > bpf-filter.h:91: error: 'BPF_MSH' undeclared here (not in a function)
> > bpf-filter.h:93: error: 'BPF_IND' undeclared here (not in a function)
> >
> > I can see output/build/dhcpcd-5.6.7/bpf.c
> > has: #include "bpf-filter.h"
> >
> > I can see the symbols are defined in several files.
> > ./output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/linux/filter.h
> > ./output/toolchain/linux/include/linux/filter.h
> > ./output/toolchain/uClibc_dev/usr/include/linux/filter.h
> > ./output/toolchain/linux-2.6.38.8/include/linux/filter.h
> Which OS are you trying to build this on? bpf.c is compiled only on
> non-linux based-platforms (e.g. BSD).
> I have tried myself on my ubuntu machine and dhcpcd builds fine.
>
> Thanks
> Gilles.
I am building on: uname -a
Linux genx 3.3.8-gentoo #2 SMP Tue Oct 9 10:31:27 PDT 2012 x86_64 Intel(R) Core(TM) i5-2540M CPU @ 2.60GHz GenuineIntel GNU/Linux
Maybe my generated confing.mk is wrong (from the configure step)
What is in your config.mk?
My config.mk contains:
#
SYSCONFDIR= /etc
SBINDIR= /sbin
LIBEXECDIR= /libexec
DBDIR= /var/db
RUNDIR= /var/run
LIBDIR= /lib
MANDIR= /usr/share/man
CC= gcc
SRCS+= bpf.c if-bsd.c platform-bsd.c
COMPAT_SRCS+= compat/arc4random.c
COMPAT_SRCS+= compat/closefrom.c
COMPAT_SRCS+= compat/strlcpy.c
SERVICEEXISTS= /sbin/rc-service -e $$1
SERVICECMD= /sbin/rc-service $$1 -- -D $$2
SERVICESTATUS= service_command $$1 status >/dev/null 2>\&1
HOOKSCRIPTS= 50-ntp.conf
Additionally, are the toolchain/uClibc/uClibc-0.9.32.config variables
available inside my dhcpcd.mk, so I can add the dependency on
UCLIBC_SUPPORT_AI_ADDRCONFIG?
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-07 14:53 ` John Stile
@ 2013-03-07 15:03 ` Thomas Petazzoni
2013-03-07 15:30 ` John Stile
0 siblings, 1 reply; 26+ messages in thread
From: Thomas Petazzoni @ 2013-03-07 15:03 UTC (permalink / raw)
To: buildroot
Dear John Stile,
On Thu, 07 Mar 2013 06:53:10 -0800, John Stile wrote:
> Additionally, are the toolchain/uClibc/uClibc-0.9.32.config variables
> available inside my dhcpcd.mk, so I can add the dependency on
> UCLIBC_SUPPORT_AI_ADDRCONFIG?
No. The latest Buildroot has UCLIBC_SUPPORT_AI_ADDRCONFIG enabled by
default in the uClibc configuration.
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-07 15:03 ` Thomas Petazzoni
@ 2013-03-07 15:30 ` John Stile
2013-03-07 17:15 ` Thomas Petazzoni
0 siblings, 1 reply; 26+ messages in thread
From: John Stile @ 2013-03-07 15:30 UTC (permalink / raw)
To: buildroot
On Thu, 2013-03-07 at 16:03 +0100, Thomas Petazzoni wrote:
> Dear John Stile,
>
> On Thu, 07 Mar 2013 06:53:10 -0800, John Stile wrote:
>
> > Additionally, are the toolchain/uClibc/uClibc-0.9.32.config variables
> > available inside my dhcpcd.mk, so I can add the dependency on
> > UCLIBC_SUPPORT_AI_ADDRCONFIG?
>
> No. The latest Buildroot has UCLIBC_SUPPORT_AI_ADDRCONFIG enabled by
> default in the uClibc configuration.
>
> Thomas
This finally builds.
I had to add the --os=linux to the configure step
I tried using BR2_GCC_TARGET_ABI, which is "aapcs-linux" for my system,
but that didn't work, and the system assume bsd again.
How does this look?
-----------------
dhcpcd patch
-----------------
Adding pacakge dhcpcd to buildroot, ordered alphbetically in Networking pacakges, warning about uClibc config.
signed-off-by: John Stile <john@stilen.com>
--- a/buildroot-2011.11/package/Config.in 2013-03-07 07:17:35.000000000 -0800
+++ b/buildroot-2011.11/package/Config.in 2013-03-07 07:17:05.000000000 -0800
@@ -408,6 +408,7 @@ source "package/cups/Config.in"
if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
source "package/dhcp/Config.in"
endif
+source "package/dhcpcd/Config.in"
source "package/dhcpdump/Config.in"
source "package/dnsmasq/Config.in"
source "package/dropbear/Config.in"
--- a/buildroot-2011.11/package/dhcpcd/Config.in 2013-03-07 07:23:25.000000000 -0800
+++ b/buildroot-2011.11/package/dhcpcd/Config.in 2013-03-07 07:21:47.000000000 -0800
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_DHCPCD
+ bool "dhcpcd"
+ help
+ an RFC2131 compliant DHCP client
+ NOTE: If uClibc, depends on UCLIBC_SUPPORT_AI_ADDRCONFIG=y
--- a/buildroot-2011.11/package/dhcpcd/dhcpcd.mk 2013-03-07 07:13:09.000000000 -0800
+++ b/buildroot-2011.11/package/dhcpcd/dhcpcd.mk 2013-03-07 07:00:54.000000000 -0800
@@ -0,0 +1,46 @@
+#############################################################
+#
+# dhcpcd
+#
+#############################################################
+
+DHCPCD_VERSION = 5.6.7
+DHCPCD_SOURCE = dhcpcd-$(DHCPCD_VERSION).tar.bz2
+DHCPCD_SITE = http://roy.marples.name/downloads/dhcpcd/
+DHCPCD_LICENSE = BSD-2c
+DHCPCD_INSTALL_STAGING = NO
+
+CONFIG_ARGS += --target=$(BR2_GCC_TARGET_ARCH)
+CONFIG_ARGS += --os=linux
+
+ifeq ($(BR2_USE_MMU),n)
+ CONFIG_ARGS += --disable-fork
+endif
+
+ifeq ($(BR2_INET_IPV6),)
+ DHCPCD_CFLAGS += -UHASIPv6
+endif
+
+define DHCPCD_CONFIGURE_CMDS
+ (cd $(@D); \
+ ./configure $(CONFIG_ARGS) )
+endef
+
+define DHCPCD_BUILD_CMDS
+ $(MAKE) $(TARGET_CONFIGURE_OPTS) CC="$(TARGET_CC)" LD="$(TARGET_LD)" PATH=$(TARGET_PATH) $(DHCPCD_CFLAGS) -C $(@D) all
+endef
+
+define DHCPCD_INSTALL_TARGET_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin/dhcpcd
+ $(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf $(TARGET_DIR)/etc/dhcpcd.conf
+endef
+
+define DHCPCD_DEVICES
+ #/dev/foo c 666 0 0 42 0 - - -
+endef
+
+define DHCPCD_PERMISSIONS
+ /usr/bin/dhcpcd f 4755 0 0 - - - - -
+endef
+
+$(eval $(call GENTARGETS))
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Buildroot] adding dhcpcd
2013-03-07 15:30 ` John Stile
@ 2013-03-07 17:15 ` Thomas Petazzoni
0 siblings, 0 replies; 26+ messages in thread
From: Thomas Petazzoni @ 2013-03-07 17:15 UTC (permalink / raw)
To: buildroot
Dear John Stile,
On Thu, 07 Mar 2013 07:30:16 -0800, John Stile wrote:
> How does this look?
Do you want this patch to be integrated? If so, please send just your
patch in an e-mail, with nothing else. The best thing is to use git
send-email.
> -----------------
> dhcpcd patch
> -----------------
> Adding pacakge dhcpcd to buildroot, ordered alphbetically in Networking pacakges, warning about uClibc config.
>
> signed-off-by: John Stile <john@stilen.com>
Formatting of the commit log is not correct:
* One first line, less than ~80-100 characters, giving the title of
the patch. So something like 'dhcpcd: new package'
* One empty line.
* One or more paragraphs giving details about what the patch does. It
should be line-wrapped at ~80 columns. Please fix the typos in the
message.
* One empty line.
* Signed-off-by line. Note the capital S.
>
> --- a/buildroot-2011.11/package/Config.in 2013-03-07 07:17:35.000000000 -0800
> +++ b/buildroot-2011.11/package/Config.in 2013-03-07 07:17:05.000000000 -0800
Please use Git to generate your patches. Those patches are generated to
be applied for patch -p2 while they should be generated to apply with
patch -p1. Just use Git, it will do the Right Thing (TM).
> @@ -408,6 +408,7 @@ source "package/cups/Config.in"
> if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
> source "package/dhcp/Config.in"
> endif
> +source "package/dhcpcd/Config.in"
> source "package/dhcpdump/Config.in"
> source "package/dnsmasq/Config.in"
> source "package/dropbear/Config.in"
>
> --- a/buildroot-2011.11/package/dhcpcd/Config.in 2013-03-07 07:23:25.000000000 -0800
> +++ b/buildroot-2011.11/package/dhcpcd/Config.in 2013-03-07 07:21:47.000000000 -0800
> @@ -0,0 +1,5 @@
> +config BR2_PACKAGE_DHCPCD
> + bool "dhcpcd"
> + help
> + an RFC2131 compliant DHCP client
> + NOTE: If uClibc, depends on UCLIBC_SUPPORT_AI_ADDRCONFIG=y
Indentation for bool/help: one tab.
Indentation for the help text: one tab + two spaces.
> --- a/buildroot-2011.11/package/dhcpcd/dhcpcd.mk 2013-03-07 07:13:09.000000000 -0800
> +++ b/buildroot-2011.11/package/dhcpcd/dhcpcd.mk 2013-03-07 07:00:54.000000000 -0800
> @@ -0,0 +1,46 @@
> +#############################################################
> +#
> +# dhcpcd
> +#
> +#############################################################
> +
> +DHCPCD_VERSION = 5.6.7
> +DHCPCD_SOURCE = dhcpcd-$(DHCPCD_VERSION).tar.bz2
> +DHCPCD_SITE = http://roy.marples.name/downloads/dhcpcd/
> +DHCPCD_LICENSE = BSD-2c
> +DHCPCD_INSTALL_STAGING = NO
Line not needed.
> +
> +CONFIG_ARGS += --target=$(BR2_GCC_TARGET_ARCH)
> +CONFIG_ARGS += --os=linux
All variables should be prefixed with the package name. However, in
this case it makes more sense to put those options directly in the
DHCPCD_CONFIGURE_CMDS.
> +ifeq ($(BR2_USE_MMU),n)
> + CONFIG_ARGS += --disable-fork
> +endif
BR2_USE_MMU will never be 'n'. It can be either 'y' or the empty
value. So:
ifeq ($(BR2_USE_MMU),)
DHCPCD_CONF_OPT += --disable-fork
endif
> +
> +ifeq ($(BR2_INET_IPV6),)
> + DHCPCD_CFLAGS += -UHASIPv6
> +endif
So when IPv6 is not available, you enable IPv6 in your package?
> +define DHCPCD_CONFIGURE_CMDS
> + (cd $(@D); \
> + ./configure $(CONFIG_ARGS) )
> +endef
Make this:
define DHCPCD_CONFIGURE_CMDS
(cd $(@D); \
./configure \
--target=$(GNU_TARGET_NAME) \
--os=linux \
$(DHCPCD_CONF_OPT))
endef
> +
> +define DHCPCD_BUILD_CMDS
> + $(MAKE) $(TARGET_CONFIGURE_OPTS) CC="$(TARGET_CC)" LD="$(TARGET_LD)" PATH=$(TARGET_PATH) $(DHCPCD_CFLAGS) -C $(@D) all
> +endef
No need to pass CC, LD and PATH, they are already part of
TARGET_CONFIGURE_OPTS.
> +define DHCPCD_INSTALL_TARGET_CMDS
> + $(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin/dhcpcd
> + $(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf $(TARGET_DIR)/etc/dhcpcd.conf
> +endef
> +
> +define DHCPCD_DEVICES
> + #/dev/foo c 666 0 0 42 0 - - -
> +endef
DHCPCD_DEVICES not needed.
> +define DHCPCD_PERMISSIONS
> + /usr/bin/dhcpcd f 4755 0 0 - - - - -
> +endef
Are you sure this is needed?
> +$(eval $(call GENTARGETS))
This should be $(eval $(generic-package)) if you want your patch to be
merged in Buildroot.
Also, please add a comment just above $(eval $(generic-package)) that
says something like: "Even though the package has a configure script,
it is not a configure script generated using the autotools, so we have
to use the generic package infrastructure".
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2013-03-07 17:15 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-01 18:37 [Buildroot] adding dhcpcd John Stile
2013-03-01 18:47 ` Gustavo Zacarias
2013-03-05 16:21 ` John Stile
2013-03-05 18:47 ` Thomas Petazzoni
2013-03-06 18:01 ` John Stile
2013-03-06 18:58 ` Thomas Petazzoni
2013-03-06 19:50 ` John Stile
2013-03-06 20:05 ` Reuben Dowle
2013-03-06 20:08 ` Thomas Petazzoni
2013-03-06 20:41 ` John Stile
2013-03-06 20:54 ` Thomas Petazzoni
2013-03-06 21:02 ` John Stile
2013-03-06 21:14 ` Thomas Petazzoni
2013-03-06 21:20 ` John Stile
2013-03-06 21:29 ` Thomas Petazzoni
2013-03-06 22:57 ` John Stile
2013-03-06 23:48 ` Gilles Talis
2013-03-07 1:44 ` John Stile
2013-03-07 4:51 ` Gilles Talis
2013-03-07 7:31 ` John Stile
2013-03-07 8:53 ` Gilles Talis
2013-03-07 14:53 ` John Stile
2013-03-07 15:03 ` Thomas Petazzoni
2013-03-07 15:30 ` John Stile
2013-03-07 17:15 ` Thomas Petazzoni
2013-03-06 20:06 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox