adding dhcpcd
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?
Quoted 6 lines · John Stile
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.
Quoted 8 lines
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.
Quoted 17 lines · Gustavo Zacarias
Quoted 6 lines · John Stile
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.
Quoted 8 lines
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?
Quoted 15 lines
Hi.
If you're using a default buildroot skeleton without touching much then/etc/init.d/S40networkis 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/interfacesand 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 += ntpDHCPCD_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
Dear John Stile,
Quoted 1 line · John Stile
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.
Quoted 1 line
Is this the right place to get advice on a make file, or even submit?
It is a good place.
Quoted 1 line
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
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Quoted 24 lines · Thomas Petazzoni
Dear John Stile,
Quoted 1 line · John Stile
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.Quoted 1 line
Is this the right place to get advice on a make file, or even submit?
It is a good place.
Quoted 1 line
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.
Quoted 7 lines
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.7DHCPCD_SOURCE = dhcpcd-$(DHCPCD_VERSION).tar.bz2 DHCPCD_SITE = http://roy.marples.name/downloads/dhcpcdDHCPCD_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))
Dear John Stile,
Quoted 2 lines · John Stile
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.
Quoted 5 lines
I am not sure if
http://roy.marples.name/downloads/dhcpcd/dhcpcd-5.6.7.tar.bz2
uses cmake or automake. The tarball contains aMakefile, 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.
Quoted 6 lines
It does
contain aMakefile... but I don't see how to use it from:
http://buildroot.org/downloads/manual/manual.html#generic-package-tutorialSo 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'.
Quoted 2 lines
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/.
Quoted 11 lines
#############################################################
## dhcpcd # #############################################################
DHCPCD_VERSION= 5.6.7DHCPCD_SOURCE= dhcpcd-$(DHCPCD_VERSION).tar.bz2DHCPCD_SITE= http://roy.marples.name/downloads/dhcpcdDHCPCD_LICENSE= GPLv3+DHCPCD_LICENSE_FILES= COPYING
The license is not GPLv3+, it's BSD-2c, and there is no COPYING file.
Quoted 1 line
DHCPCD_INSTALL_STAGING= YES
No, it's just installing an application, so setting DHCPD_INSTALL_STAGING to YES is not necessary.
Quoted 1 line
DHCPCD_CONFIG_SCRIPTS= configure
No, the configure script is not a <foo>-config script.
Quoted 1 line
DHCPCD_DEPENDENCIES=
Not needed, it is empty by default.
Quoted 1 line
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.
Quoted 3 lines
define
DHCPCD_BUILD_CMDS$(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D) allendef
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.
Quoted 5 lines
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/dhcpcdendef
Not needed as we should not be installing dhcpcd in the staging area.
Quoted 2 lines
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
Quoted 1 line
$(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
Quoted 5 lines
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
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Dear Thomas,
Quoted 126 lines · Thomas Petazzoni
Dear John Stile,
Quoted 2 lines · John Stile
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.
Quoted 5 lines
I am not sure if
http://roy.marples.name/downloads/dhcpcd/dhcpcd-5.6.7.tar.bz2
uses cmake or automake. The tarball contains aMakefile, 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.Quoted 6 lines
It does
contain aMakefile... but I don't see how to use it from:
http://buildroot.org/downloads/manual/manual.html#generic-package-tutorialSo 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'.
Quoted 2 lines
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/.
Quoted 11 lines
#############################################################
## dhcpcd # #############################################################
DHCPCD_VERSION= 5.6.7DHCPCD_SOURCE= dhcpcd-$(DHCPCD_VERSION).tar.bz2DHCPCD_SITE= http://roy.marples.name/downloads/dhcpcdDHCPCD_LICENSE= GPLv3+DHCPCD_LICENSE_FILES= COPYINGThe license is not GPLv3+, it's BSD-2c, and there is no COPYING file.
Quoted 1 line
DHCPCD_INSTALL_STAGING= YESNo, it's just installing an application, so setting
DHCPD_INSTALL_STAGINGto YES is not necessary.Quoted 1 line
DHCPCD_CONFIG_SCRIPTS= configureNo, the configure script is not a <foo>-config script.
Quoted 1 line
DHCPCD_DEPENDENCIES=Not needed, it is empty by default.
Quoted 1 line
DHCPCD_SITE_METHOD= wgetNot 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.
Quoted 3 lines
define
DHCPCD_BUILD_CMDS$(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D) allendef
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.
Quoted 5 lines
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/dhcpcdendef
Not needed as we should not be installing dhcpcd in the staging area.
Quoted 2 lines
define
DHCPCD_INSTALL_TARGET_CMDS$(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/binThis should be:
$(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin/dhcpcdQuoted 1 line
$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/dhcpcd.confAre you you want to create the
/etc/dhcpcd.conffile? 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.confQuoted 5 lines
endef
define
DHCPCD_PERMISSIONS/usr/bin/dhcpcd f 4755 0 0 - - - - -endef
Quoted 8 lines
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
buildroot-2011.11/package/Config.in +1 -0
@@ -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"
buildroot-2011.11/package/dhcpcd/Config.in +5 -0
@@ -0,0 +1,5 @@ +config BR2_PACKAGE_DHCPCD + bool "dhcpcd" + depends on BR2_INET_IPV6 + help + an RFC2131 compliant DHCP client
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +43 -0
43 lines not on this page · raw message
In your patch, you should probably replace the place-holder "...some environment variables..." with setting some actual environment variables.
-----Original Message-----
From: [email protected] [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,
Quoted 126 lines · Thomas Petazzoni
Dear John Stile,
Quoted 2 lines · John Stile
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.
Quoted 5 lines
I am not sure if
http://roy.marples.name/downloads/dhcpcd/dhcpcd-5.6.7.tar.bz2
uses cmake or automake. The tarball contains aMakefile, 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.Quoted 6 lines
It does
contain aMakefile... but I don't see how to use it from:
http://buildroot.org/downloads/manual/manual.html#generic-package-tutorialSo 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'.
Quoted 2 lines
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/.
Quoted 11 lines
#############################################################
## dhcpcd # #############################################################
DHCPCD_VERSION= 5.6.7DHCPCD_SOURCE= dhcpcd-$(DHCPCD_VERSION).tar.bz2DHCPCD_SITE= http://roy.marples.name/downloads/dhcpcdDHCPCD_LICENSE= GPLv3+DHCPCD_LICENSE_FILES= COPYINGThe license is not GPLv3+, it's BSD-2c, and there is no COPYING file.
Quoted 1 line
DHCPCD_INSTALL_STAGING= YESNo, it's just installing an application, so setting
DHCPD_INSTALL_STAGINGto YES is not necessary.Quoted 1 line
DHCPCD_CONFIG_SCRIPTS= configureNo, the configure script is not a <foo>-config script.
Quoted 1 line
DHCPCD_DEPENDENCIES=Not needed, it is empty by default.
Quoted 1 line
DHCPCD_SITE_METHOD= wgetNot 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.
Quoted 3 lines
define
DHCPCD_BUILD_CMDS$(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D) allendef
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.
Quoted 5 lines
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/dhcpcdendef
Not needed as we should not be installing dhcpcd in the staging area.
Quoted 2 lines
define
DHCPCD_INSTALL_TARGET_CMDS$(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/binThis should be:
$(INSTALL) -D -m 0755 $(@D)/dhcpcd $(TARGET_DIR)/usr/bin/dhcpcdQuoted 1 line
$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/dhcpcd.confAre you you want to create the
/etc/dhcpcd.conffile? 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.confQuoted 5 lines
endef
define
DHCPCD_PERMISSIONS/usr/bin/dhcpcd f 4755 0 0 - - - - -endef
Quoted 8 lines
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
buildroot-2011.11/package/Config.in 2013-02-28 14:59:32.000000000 -0800 renamed from buildroot-2011.11/package/Config.in 2013-03-06 11:40:52.000000000 -0800 +1 -0
@@ -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"
buildroot-2011.11/package/dhcpcd/Config.in 2013-03-06 07:55:53.000000000 -0800 renamed from buildroot-2011.11/package/dhcpcd/Config.in 2013-03-06 11:44:03.000000000 -0800 +5 -0
@@ -0,0 +1,5 @@ +config BR2_PACKAGE_DHCPCD + bool "dhcpcd" + depends on BR2_INET_IPV6 + help + an RFC2131 compliant DHCP client
buildroot-2011.11/package/dhcpcd/dhcpcd.mk 2013-03-06 11:38:17.000000000 -0800 renamed from buildroot-2011.11/package/dhcpcd/dhcpcd.mk 2013-03-06 11:44:03.000000000 -0800 +43 -0
43 lines not on this page · raw message
_______________________________________________
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).
Dear Reuben Dowle,
Quoted 1 line · Reuben Dowle
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
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Quoted 9 lines · Thomas Petazzoni
Dear Reuben Dowle,
Quoted 1 line · Reuben Dowle
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.
Quoted 7 lines
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.
Dear John Stile,
Quoted 16 lines · John Stile
Yes, the place holder is bad, so I took it out.
I ran: make dhcpcd-dircleanMy buildroot-2011.11/.config holds
BR2_PACKAGE_DHCPCD=y
BR2_INET_IPV6=y
BR2_TOOLCHAIN_BUILDROOT_INET_IPV6=yI 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
Quoted 1 line
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
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Hello Thomas,
Quoted 27 lines · Thomas Petazzoni
Dear John Stile,
Quoted 16 lines · John Stile
Yes, the place holder is bad, so I took it out.
I ran: make dhcpcd-dircleanMy buildroot-2011.11/.config holds
BR2_PACKAGE_DHCPCD=y
BR2_INET_IPV6=y
BR2_TOOLCHAIN_BUILDROOT_INET_IPV6=yI 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/dhcpcdQuoted 1 line
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:
Quoted 8 lines
make dhcpcd-dirclean
make 2>&1 | tee logfilePut the contents of logfile on http://code.bulix.org, and post the URL?
Thanks,
Thomas
Dear John Stile,
Quoted 5 lines · John Stile
Quoted 3 lines
Put the contents of logfile on http://code.bulix.org, and post the URL?
Thanks,
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
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Dear Thomas Petazzoni,
Quoted 10 lines · Thomas Petazzoni
Dear John Stile,
Quoted 5 lines · John Stile
Quoted 3 lines
Put the contents of logfile on http://code.bulix.org, and post the URL?
Thanks,
Quoted 8 lines
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.
Dear John Stile,
Quoted 7 lines · John Stile
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
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Dear Thomas Petazzoni,
Quoted 20 lines · Thomas Petazzoni
Dear John Stile,
Quoted 7 lines · John Stile
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))
Quoted 7 lines
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.
Quoted 1 line
Quoted 1 line
Quoted 1 line
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]
Quoted 1 line
Quoted 1 line
Quoted 1 line
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 -
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
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
buildroot-2011.11/package/Config.in +1 -0
@@ -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"
buildroot-2011.11/package/dhcpcd/Config.in +5 -0
@@ -0,0 +1,5 @@ +config BR2_PACKAGE_DHCPCD + bool "dhcpcd" + depends on BR2_INET_IPV6 + help + an RFC2131 compliant DHCP client
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +45 -0
45 lines not on this page · raw message
Hi John,
2013/3/6 John Stile <[email protected]>:
buildroot-2011.11/package/dhcpcd/dhcpcd.mk line 26
Quoted 6 lines
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +6
-0+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.
Hello Gilles Talis,
Quoted 15 lines · Gilles Talis
Hi John,
2013/3/6 John Stile <[email protected]>:
buildroot-2011.11/package/dhcpcd/dhcpcd.mk line 26
Quoted 6 lines
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +6
-0+define DHCPD_CONFIGURE_CMDS + (cd $@D) && \ + $(DHCPCD_PATH) $(DHCPCD_ENV) \ + ./configure \ + $(CONFIG_ARGS) ) +endefI think there's a small typo here. It should be:
defineDHCPCD_CONFIGURE_CMDS
instead of
defineDHCPD_CONFIGURE_CMDS
Quoted 2 lines
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
--- 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))
Hi John,
Quoted 9 lines
That did help. Thank you.
The build now fails because it can't findifaddrs.h:
ipv6.c:34:21: error:ifaddrs.h: No such file or directory net.c:56:21: error:ifaddrs.h: No such file or directoryBut I do see the file here:
./output/toolchain/uClibc-0.9.32/include/ifaddrs.hIs 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.
Hello Gilles,
Quoted 21 lines · Gilles Talis
Hi John,
Quoted 9 lines
That did help. Thank you.
The build now fails because it can't findifaddrs.h:
ipv6.c:34:21: error:ifaddrs.h: No such file or directory net.c:56:21: error:ifaddrs.h: No such file or directoryBut I do see the file here:
./output/toolchain/uClibc-0.9.32/include/ifaddrs.hIs 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_ADDRCONFIGis not set with
UCLIBC_SUPPORT_AI_ADDRCONFIG=y
Quoted 5 lines
2. run "make clean" then
3. run "make". Toolchain will be rebuilt withifaddrs.hThis 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?
Hi John,
2013/3/6 John Stile <[email protected]>:
Quoted 20 lines
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)
Quoted 8 lines
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.
Hello Gilles Talis,
Quoted 31 lines · Gilles Talis
Hi John,
2013/3/6 John Stile <[email protected]>:
Quoted 20 lines
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)Quoted 8 lines
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
Quoted 6 lines
Which OS are you trying to build this on?
bpf.cis 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?
Dear John Stile,
Quoted 3 lines · John Stile
Additionally, are the
toolchain/uClibc/uClibc-0.9.32.configvariables available inside my dhcpcd.mk, so I can add the dependency onUCLIBC_SUPPORT_AI_ADDRCONFIG?
No. The latest Buildroot has UCLIBC_SUPPORT_AI_ADDRCONFIG enabled by default in the uClibc configuration.
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Quoted 4 lines · Thomas Petazzoni
Dear John Stile,
On Thu, 07 Mar 2013 06:53:10 -0800, John Stile wrote:
Quoted 8 lines
Quoted 3 lines
Additionally, are the
toolchain/uClibc/uClibc-0.9.32.configvariables available inside my dhcpcd.mk, so I can add the dependency onUCLIBC_SUPPORT_AI_ADDRCONFIG?No. The latest Buildroot has
UCLIBC_SUPPORT_AI_ADDRCONFIGenabled 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.
buildroot-2011.11/package/Config.in +1 -0
@@ -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"
buildroot-2011.11/package/dhcpcd/Config.in +5 -0
@@ -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
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +46 -0
46 lines not on this page · raw message
Dear John Stile,
Quoted 1 line · John Stile
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.
Quoted 6 lines
-----------------
dhcpcd patch
-----------------
Adding pacakge dhcpcd to buildroot, ordered alphbetically in Networking pacakges, warning about uClibc config.Signed-off-by John Stile <[email protected]>
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.
buildroot-2011.11/package/Config.in
Quoted 3 lines
buildroot-2011.11/package/Config.in +0
-0
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).
Quoted 12 lines
buildroot-2011.11/package/Config.in +1
-0@@ -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"
buildroot-2011.11/package/dhcpcd/Config.in line 5
Quoted 5 lines
buildroot-2011.11/package/dhcpcd/Config.in +5
-0@@ -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.
Quoted 4 lines
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +1
-0@@ -0,0 +1,46 @@ +#############################################################
buildroot-2011.11/package/dhcpcd/dhcpcd.mk line 11
Quoted 10 lines
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +10
-0+# +# 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.
buildroot-2011.11/package/dhcpcd/dhcpcd.mk line 14
Quoted 3 lines
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +3
-0+ +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.
buildroot-2011.11/package/dhcpcd/dhcpcd.mk line 18
Quoted 3 lines
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +3
-0+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
buildroot-2011.11/package/dhcpcd/dhcpcd.mk line 22
Quoted 4 lines
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +4
-0+ +ifeq ($(BR2_INET_IPV6),) + DHCPCD_CFLAGS += -UHASIPv6 +endif
So when IPv6 is not available, you enable IPv6 in your package?
buildroot-2011.11/package/dhcpcd/dhcpcd.mk line 27
Quoted 4 lines
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +4
-0+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
buildroot-2011.11/package/dhcpcd/dhcpcd.mk line 31
Quoted 4 lines
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +4
-0+ +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.
buildroot-2011.11/package/dhcpcd/dhcpcd.mk line 40
Quoted 8 lines
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +8
-0+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.
buildroot-2011.11/package/dhcpcd/dhcpcd.mk line 44
Quoted 3 lines
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +3
-0+define DHCPCD_PERMISSIONS + /usr/bin/dhcpcd f 4755 0 0 - - - - - +endef
Are you sure this is needed?
buildroot-2011.11/package/dhcpcd/dhcpcd.mk line 46
Quoted 1 line
buildroot-2011.11/package/dhcpcd/dhcpcd.mk +1
-0+$(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
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Dear John Stile,
Quoted 2 lines · John Stile
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):
Quoted 1 line
Quoted 1 line
Quoted 1 line
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]
Quoted 1 line
Quoted 1 line
Quoted 1 line
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 -
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
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
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com