From ae79276a83e298bec22a259e7167c2f9265aec3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20H=C3=B8jgaard-Hansen?= Date: Wed, 11 Jan 2017 14:13:29 +0100 Subject: [PATCH 1/3] dhcpcd: make restart work even if start has not been run --- recipes/dhcpcd/files/init | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/recipes/dhcpcd/files/init b/recipes/dhcpcd/files/init index 8124b501e..7cc4b3c7c 100644 --- a/recipes/dhcpcd/files/init +++ b/recipes/dhcpcd/files/init @@ -16,7 +16,12 @@ do_start() { } do_stop() { - start-stop-daemon -K --pidfile $PIDFILE --exec $DAEMON + # only try to stop the daemon if there is actually something + # running. Otherwise a restart before a start will fail + start-stop-daemon -K -o --pidfile $PIDFILE --exec $DAEMON + if [ "$?" != "0" ] ; then + start-stop-daemon -K --pidfile $PIDFILE --exec $DAEMON + fi } do_status() { From 11007a36c64b1ec43c8fd12366c438f2e0ecf919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20H=C3=B8jgaard-Hansen?= Date: Thu, 12 Jan 2017 10:50:49 +0100 Subject: [PATCH 2/3] dhcpcd: provide dhcp-client This makes it possible to just depend on a dhcp-client and then let the configuration decide which recipe to prefer. Busybox already use the same provide. --- recipes/dhcpcd/dhcpcd.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/dhcpcd/dhcpcd.inc b/recipes/dhcpcd/dhcpcd.inc index 75aa72764..916cada0f 100644 --- a/recipes/dhcpcd/dhcpcd.inc +++ b/recipes/dhcpcd/dhcpcd.inc @@ -26,6 +26,7 @@ DHCPCD_UDEV:USE_dhcpcd_udev = "" DEPENDS:>dhcpcd_udev = " libudev libdl" DEPENDS_${PN}:>dhcpcd_udev = " libudev libdl" RDEPENDS_${PN}:>dhcpcd_udev = " libudev libdl" +PROVIDES_${PN} += "dhcp-client" EXTRA_OECONF += "${DHCPCD_UDEV}" From 6888ed698022c4c98a434f89b4707f2459b46325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20H=C3=B8jgaard-Hansen?= Date: Thu, 12 Jan 2017 14:05:08 +0100 Subject: [PATCH 3/3] dhcpcd: add more configuration options Allow the default arguments for dhcpcd when started from the init script to be set with a USE-flag, and split the configuration files into a seperate package to allow the full configuration to be overriden from a pure configuration recipe in e.g. a BSP manifest. --- recipes/dhcpcd/dhcpcd.inc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/recipes/dhcpcd/dhcpcd.inc b/recipes/dhcpcd/dhcpcd.inc index 916cada0f..3b006648d 100644 --- a/recipes/dhcpcd/dhcpcd.inc +++ b/recipes/dhcpcd/dhcpcd.inc @@ -68,3 +68,14 @@ do_install_initscript() { sysvinit_install_script ${SRCDIR}/init dhcpcd } do_install[prefuncs] += "do_install_initscript" + +RECIPE_FLAGS += "dhcpcd_args" +DEFAULT_USE_dhcpcd_args = " " +do_install_config() { + install -d ${D}/${sysconfdir}/default + echo 'ARGS="${USE_dhcpcd_args}"' > ${D}/${sysconfdir}/default/dhcpcd +} +do_install[prefuncs] += "do_install_config" +PACKAGES =+ "${PN}-conf" +FILES_${PN}-conf = "${sysconfdir}/default/dhcpcd ${sysconfdir}/dhcpcd.conf" +RDEPENDS_${PN} += "${PN}-conf"