Skip to contentSkip to conversation

systemV init without busybox series

PATCH Superseded Gustavo Zacarias 5 participants 35 messages Nov 14, 2014

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover systemV init without busybox series

This is a RFC patch series that enables busybox-less systemV systems to be built.
It contains fixes that enable it to work seamlessly, some new packages and a couple of non essential/related bumps.

It's missing documentation on the recommended packages for a normal boot to take place without any errors or warnings for a default busybox skeleton.

* debianutils provides run-parts for ifupdown
* ifupdown provides ifup/ifdown
* start-stop-daemon provides start-stop-daemon (sic)

Changes for v2:
* Drop uclibc wordexp enablement and disable ifupdown for it
* Add start-stop-daemon package
* Add useful dhclient-script for ISC dhcp
* Install dhclient (ISC dhcp) to /sbin for debian ifupdown
* dhcpcd: install dhcpcd-hooks for PnP simplicity
* sysvinit: drop tty1/2 for consistency
* Misc style fixes

Gustavo Zacarias (10):
skeleton/S40network: tweak for debian ifupdown
dash: bump to 0.5.8-2
debianutils: new package
ifupdown: new package
start-stop-daemon: new package
package/sysvinit: drop tty1/2
dhcp: install dhclient to /sbin
dhcp: update dhclient-script
dhcpcd: bump to version 6.6.1
dhcpcd: use standard installation

 package/Config.in                                  |   7 +
 package/dash/dash.hash                             |   4 +-
 package/dash/dash.mk                               |   4 +-
 package/debianutils/Config.in                      |   7 +
 package/debianutils/debianutils.hash               |   2 +
 package/debianutils/debianutils.mk                 |  14 +
 package/dhcp/dhclient-script                       | 281 ++++++++++++++++++++-
 package/dhcp/dhcp.mk                               |   2 +-
 package/dhcpcd/dhcpcd.hash                         |   2 +
 package/dhcpcd/dhcpcd.mk                           |   9 +-
 package/ifupdown/Config.in                         |  17 ++
 package/ifupdown/ifupdown.hash                     |   2 +
 package/ifupdown/ifupdown.mk                       |  33 +++
 .../0001-add-uclibc-alias-and-musl.patch           |  42 +++
 package/start-stop-daemon/Config.in                |   8 +
 package/start-stop-daemon/start-stop-daemon.hash   |   2 +
 package/start-stop-daemon/start-stop-daemon.mk     |  27 ++
 package/sysvinit/inittab                           |   3 -
 system/skeleton/etc/init.d/S40network              |   3 +
 19 files changed, 453 insertions(+), 16 deletions(-)
 create mode 100644 package/debianutils/Config.in
 create mode 100644 package/debianutils/debianutils.hash
 create mode 100644 package/debianutils/debianutils.mk
 create mode 100644 package/dhcpcd/dhcpcd.hash
 create mode 100644 package/ifupdown/Config.in
 create mode 100644 package/ifupdown/ifupdown.hash
 create mode 100644 package/ifupdown/ifupdown.mk
 create mode 100644 package/start-stop-daemon/0001-add-uclibc-alias-and-musl.patch
 create mode 100644 package/start-stop-daemon/Config.in
 create mode 100644 package/start-stop-daemon/start-stop-daemon.hash
 create mode 100644 package/start-stop-daemon/start-stop-daemon.mk
Signature · 1 line
2.0.4
#1 lore raw

PATCH v2 1/10 skeleton/S40network: tweak for debian ifupdown

Make the S40network script create the /run/network directory for the debian variant of ifupdown which uses it as a lock directory.

---
 system/skeleton/etc/init.d/S40network | 3 +++
 1 file changed, 3 insertions(+)
system/skeleton/etc/init.d/S40network +3 -0
index e69e613..4317d14 100755
@@ -3,6 +3,9 @@
 # Start the network....
 #
 
+# Debian ifupdown needs the /run/network lock directory
+[ -h /sbin/ifup ] || mkdir -p /run/network
+
 case "$1" in
   start)
  	echo "Starting network..."
Signature · 1 line
2.0.4
#2 lore raw

PATCH 1/10 skeleton/S40network: tweak for debian ifupdown

Quoted 14 lines · Gustavo Zacarias

Make the S40network script create the /run/network directory for the debian variant of ifupdown which uses it as a lock directory.

---
 system/skeleton/etc/init.d/S40network | 3 +++
 1 file changed, 3 insertions(+)
system/skeleton/etc/init.d/S40network +0 -0
index e69e613..4317d14 100755

system/skeleton/etc/init.d/S40network line 7

Quoted 5 lines
system/skeleton/etc/init.d/S40network +2 -0
@@ -3,6 +3,9 @@
 # Start the network....
 #
 
+# Debian ifupdown needs the /run/network lock directory
+[ -h /sbin/ifup ] || mkdir -p /run/network

I think checking for a symlink is a pretty fragile way for distinguishing
between Debian and busybox ifupdown...

Why not just create the directory unconditionally? People who care about the
4K tmpfs wastage will probably want to get rid of this script entirely...

Regards,
Arnout

Quoted 5 lines
system/skeleton/etc/init.d/S40network +1 -0
+
 case "$1" in
   start)
      echo "Starting network..."
Signature · 6 lines
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#3 lore raw

PATCH v2 2/10 dash: bump to 0.5.8-2

In reply to Gustavo Zacarias
---
 package/dash/dash.hash | 4 ++--
 package/dash/dash.mk   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
package/dash/dash.hash +2 -2
index 0198cd8..c4e60a4 100644
@@ -1,3 +1,3 @@
-# From http://ftp.debian.org/debian/pool/main/d/dash/dash_0.5.8-1.dsc
+# From http://ftp.debian.org/debian/pool/main/d/dash/dash_0.5.8-2.dsc
 sha256	c6db3a237747b02d20382a761397563d813b306c020ae28ce25a1c3915fac60f	dash_0.5.8.orig.tar.gz
-sha256	d751769cc1ef8b825a177e782f1cd3e35bde7c268107fa4febf8d235e12c64d9	dash_0.5.8-1.diff.gz
+sha256	00168a934864c26cae9a51367fe7ea013ece2d4844ff8bd6893fc00a8fa7b38c	dash_0.5.8-2.diff.gz
package/dash/dash.mk +2 -2
index ed8525c..13169d1 100644
@@ -6,8 +6,8 @@
 
 DASH_VERSION = 0.5.8
 DASH_SOURCE = dash_$(DASH_VERSION).orig.tar.gz
-DASH_SITE = http://snapshot.debian.org/archive/debian/20141023T043132Z/pool/main/d/dash
-DASH_PATCH = dash_$(DASH_VERSION)-1.diff.gz
+DASH_SITE = http://snapshot.debian.org/archive/debian/20141022T163236Z/pool/main/d/dash
+DASH_PATCH = dash_$(DASH_VERSION)-2.diff.gz
 DASH_LICENSE = BSD-3c, GPLv2+ (mksignames.c)
 DASH_LICENSE_FILES = COPYING
 
Signature · 1 line
2.0.4
#4 lore raw

PATCH 2/10 dash: bump to 0.5.8-2

Dear Gustavo Zacarias,

Quoted 5 lines · Gustavo Zacarias
---
 package/dash/dash.hash | 4 ++--
 package/dash/dash.mk   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Peter, this one should probably go in 2014.11.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 2/10 dash: bump to 0.5.8-2

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Dear Gustavo Zacarias,

Quoted 5 lines · Gustavo Zacarias

---
package/dash/dash.hash | 4 ++--
package/dash/dash.mk | 4 ++--

2 files changed, 4 insertions(+), 4 deletions(-)
Quoted 3 lines

Peter, this one should probably go in 2014.11.

Why? Is it security related? I don't see anything special in the changelog. In fact, I don't see anything affecting us at all:

http://metadata.ftp-master.debian.org/changelogs//main/d/dash/dash_0.5.8-2_changelog

Signature · 1 line
Bye, Peter Korsgaard 
#6 lore raw

PATCH 2/10 dash: bump to 0.5.8-2

Dear Peter Korsgaard,

Quoted 10 lines · Peter Korsgaard
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Dear Gustavo Zacarias,

Quoted 5 lines · Gustavo Zacarias

---
package/dash/dash.hash | 4 ++--
package/dash/dash.mk | 4 ++--

2 files changed, 4 insertions(+), 4 deletions(-)
Quoted 8 lines
Quoted 3 lines

Peter, this one should probably go in 2014.11.

Why? Is it security related? I don't see anything special in the changelog. In fact, I don't see anything affecting us at all:

http://metadata.ftp-master.debian.org/changelogs//main/d/dash/dash_0.5.8-2_changelog

I should have said: s/should/could/. I believe it's a minor update, and it's adding hash files, so it's fine for 2014.11. But it's your call :)

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#7 lore raw

PATCH 2/10 dash: bump to 0.5.8-2

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hi,

Quoted 9 lines
Quoted 6 lines
Quoted 1 line

Peter, this one should probably go in 2014.11.

Why? Is it security related? I don't see anything special in the changelog. In fact, I don't see anything affecting us at all:

http://metadata.ftp-master.debian.org/changelogs//main/d/dash/dash_0.5.8-2_changelog

I should have said: s/should/could/. I believe it's a minor update, and it's adding hash files, so it's fine for 2014.11. But it's your call :)

Ok. It only updates the .hash, we already have it for -1.

Gustavoz, what is the reason for the bump? According to the changelog the only difference is in the debian packaging (should we also pass --disable-lineno?)

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard 
#8 lore raw

PATCH v2 2/10 dash: bump to 0.5.8-2

Quoted 5 lines · Peter Korsgaard

Ok. It only updates the .hash, we already have it for -1.

Gustavoz, what is the reason for the bump? According to the changelog the only difference is in the debian packaging (should we also pass --disable-lineno?)

Many tiny fixes, it's not only that.
I think we could consider it a security fix even if there's no know/public vulnerability yet:
https://cygwin.com/ml/cygwin-announce/2014-09/msg00043.html

Regards.

#9 lore raw

PATCH 2/10 dash: bump to 0.5.8-2

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gustavo" == Gustavo Zacarias <[email protected]> writes:

Hi,

Quoted 8 lines
Quoted 3 lines

Gustavoz, what is the reason for the bump? According to the changelog the only difference is in the debian packaging (should we also pass --disable-lineno?)

Many tiny fixes, it's not only that.
I think we could consider it a security fix even if there's no know/public vulnerability yet:
https://cygwin.com/ml/cygwin-announce/2014-09/msg00043.html

But isn't this changelog against 5.7? We already have 5.8-1.

E.G.

wget -q http://snapshot.debian.org/archive/debian/20141023T043132Z/pool/main/d/dash/dash_0.5.8-1.diff.gz
wget -q http://snapshot.debian.org/archive/debian/20141022T163236Z/pool/main/d/dash/dash_0.5.8-2.diff.gz
gunzip dash_0.5.8-*

dash_0.5.8-2.diff 2014-10-22 18:36:50.000000000 +0200 renamed from dash_0.5.8-1.diff 2014-10-01 19:10:25.000000000 +0200 +11 -3
diff -u dash_0.5.8-*
@@ -85,7 +85,14 @@
 +fi
 --- dash-0.5.8.orig/debian/changelog
 +++ dash-0.5.8/debian/changelog
-@@ -0,0 +1,1837 @@
+@@ -0,0 +1,1844 @@
++dash (0.5.8-2) experimental; urgency=medium
++
++  * debian/rules: pass --disable-lineno option to configure (thx Sven
++    Joachim, closes: #766048).
++
++ -- Gerrit Pape <[email protected]>  Mon, 20 Oct 2014 17:46:03 +0000
++
 +dash (0.5.8-1) experimental; urgency=medium
 +
 +  * new upstream release (closes: #598238).
@@ -4180,7 +4187,7 @@
 +"d. bash, tcsh)."
 --- dash-0.5.8.orig/debian/rules
 +++ dash-0.5.8/debian/rules
-@@ -0,0 +1,108 @@
+@@ -0,0 +1,109 @@
 +#!/usr/bin/make -f
 +
 +CC =gcc
@@ -4226,7 +4233,8 @@
 +      touch configure
 +      (cd build-tmp && CC='$(CC)' \
 +        CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' \
-+        exec ../configure --enable-fnmatch --host='$(DEB_HOST_GNU_TYPE)')
++        exec ../configure --enable-fnmatch --disable-lineno \
++          --host='$(DEB_HOST_GNU_TYPE)')
 +      touch configure-stamp
 +
 +build: deb-checkdir build-stamp
Signature · 1 line
Bye, Peter Korsgaard 
#10 lore raw

PATCH v2 2/10 dash: bump to 0.5.8-2

Quoted 1 line · Peter Korsgaard

But isn't this changelog against 5.7? We already have 5.8-1.

Huh right, i didn't know what i've fetched and diffed.
I don't think we should --disable-lineno anyway, we never did and we never used debian build rules either.
Regards.

#11 lore raw

PATCH 2/10 dash: bump to 0.5.8-2

Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gustavo" == Gustavo Zacarias <[email protected]> writes:

Quoted 1 line · Peter Korsgaard

But isn't this changelog against 5.7? We already have 5.8-1.

Huh right, i didn't know what i've fetched and diffed.
I don't think we should --disable-lineno anyway, we never did and we never used debian build rules either.
Regards.

Ok, I'll mark the patch as rejected then. Thanks.

Signature · 1 line
Bye, Peter Korsgaard 
#12 lore raw

PATCH v2 3/10 debianutils: new package

In reply to Gustavo Zacarias
---
 package/Config.in                    |  1 +
 package/debianutils/Config.in        |  7 +++++++
 package/debianutils/debianutils.hash |  2 ++
 package/debianutils/debianutils.mk   | 14 ++++++++++++++
 4 files changed, 24 insertions(+)
 create mode 100644 package/debianutils/Config.in
 create mode 100644 package/debianutils/debianutils.hash
 create mode 100644 package/debianutils/debianutils.mk
package/Config.in +1 -0
index 0dbb788..278134d 100644
@@ -1199,6 +1199,7 @@ endif
 	source "package/cpuload/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/dcron/Config.in"
+	source "package/debianutils/Config.in"
 endif
 	source "package/dsp-tools/Config.in"
 	source "package/ftop/Config.in"
package/debianutils/Config.in new file +7 -0
new file mode 100644
index 0000000..f865868
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_DEBIANUTILS
+	bool "debianutils"
+	depends on BR2_USE_MMU # fork()
+	help
+	  Miscellaneous utilities specific to Debian.
+
+	  https://tracker.debian.org/pkg/debianutils
package/debianutils/debianutils.hash new file +2 -0
new file mode 100644
index 0000000..089dd42
@@ -0,0 +1,2 @@
+# From http://ftp.de.debian.org/debian/pool/main/d/debianutils/debianutils_4.4.dsc
+sha256	190850cdd6b5302e0a1ba1aaed1bc7074d67d3bd8d04c613f242f7145afa53a6	debianutils_4.4.tar.gz
package/debianutils/debianutils.mk new file +14 -0
new file mode 100644
index 0000000..43d7cf3
@@ -0,0 +1,14 @@
+################################################################################
+#
+# debianutils
+#
+################################################################################
+
+DEBIANUTILS_VERSION = 4.4
+DEBIANUTILS_SOURCE = debianutils_$(DEBIANUTILS_VERSION).tar.gz
+DEBIANUTILS_SITE = http://snapshot.debian.org/archive/debian/20130728T034252Z/pool/main/d/debianutils
+DEBIANUTILS_CONF_OPTS = --exec-prefix=/
+DEBIANUTILS_LICENSE = GPLv2+, SMAIL (savelog)
+DEBIANUTILS_LICENSE_FILES = debian/copyright
+
+$(eval $(autotools-package))
Signature · 1 line
2.0.4
#13 lore raw

PATCH 3/10 debianutils: new package

Quoted 1 line · Gustavo Zacarias

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#14 lore raw

PATCH v2 4/10 ifupdown: new package

In reply to Gustavo Zacarias
---
 package/Config.in              |  3 +++
 package/ifupdown/Config.in     | 17 +++++++++++++++++
 package/ifupdown/ifupdown.hash |  2 ++
 package/ifupdown/ifupdown.mk   | 33 +++++++++++++++++++++++++++++++++
 4 files changed, 55 insertions(+)
 create mode 100644 package/ifupdown/Config.in
 create mode 100644 package/ifupdown/ifupdown.hash
 create mode 100644 package/ifupdown/ifupdown.mk
package/Config.in +3 -0
index 278134d..8f3cc3c 100644
@@ -1014,6 +1014,9 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/ifplugd/Config.in"
 endif
 	source "package/iftop/Config.in"
+if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
+	source "package/ifupdown/Config.in"
+endif
 	source "package/igh-ethercat/Config.in"
 	source "package/igmpproxy/Config.in"
 	source "package/inadyn/Config.in"
package/ifupdown/Config.in new file +17 -0
new file mode 100644
index 0000000..10cf2be
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_IFUPDOWN
+	bool "ifupdown"
+	depends on BR2_USE_MMU # fork()
+	# Default/our uclibc lacks wordexp()
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC
+	# runtime for ip binary
+	select BR2_PACKAGE_IPROUTE2 if !BR2_PACKAGE_BUSYBOX
+	# runtime for run-parts
+	select BR2_PACKAGE_DEBIANUTILS if !BR2_PACKAGE_BUSYBOX
+	help
+	  High level tools to configure network interfaces.
+
+	  https://tracker.debian.org/pkg/ifupdown
+
+comment "ifupdown needs an (e)glibc or musl toolchain"
+	depends on BR2_USE_MMU
+	depends on BR2_TOOLCHAIN_USES_UCLIBC
package/ifupdown/ifupdown.hash new file +2 -0
new file mode 100644
index 0000000..f0c314b
@@ -0,0 +1,2 @@
+# From http://ftp.de.debian.org/debian/pool/main/i/ifupdown/ifupdown_0.7.49.dsc
+sha256	5d07c73610ff90393c7273e2af9003eeb1825fc88144ae5ed11a5517547d0f58	ifupdown_0.7.49.tar.xz
package/ifupdown/ifupdown.mk new file +33 -0
new file mode 100644
index 0000000..b05ffc9
@@ -0,0 +1,33 @@
+################################################################################
+#
+# ifupdown
+#
+################################################################################
+
+IFUPDOWN_VERSION = 0.7.49
+IFUPDOWN_SOURCE = ifupdown_$(IFUPDOWN_VERSION).tar.xz
+IFUPDOWN_SITE = http://snapshot.debian.org/archive/debian/20140923T221921Z/pool/main/i/ifupdown
+IFUPDOWN_DEPENDENCIES = $(if $(BR2_PACKAGE_BUSYBOX),busybox)
+IFUPDOWN_LICENSE = GPLv2+
+IFUPDOWN_LICENSE_FILES = COPYING
+
+define IFUPDOWN_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+		CFLAGS="$(TARGET_CFLAGS) -D'IFUPDOWN_VERSION=\"$(IFUPDOWN_VERSION)\"'" \
+		-C $(@D)
+endef
+
+define IFUPDOWN_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/ifup $(TARGET_DIR)/sbin/ifup
+	$(INSTALL) -m 0755 -D $(@D)/settle-dad.sh \
+		$(TARGET_DIR)/lib/ifupdown/settle-dad.sh
+	ln -sf ifup $(TARGET_DIR)/sbin/ifdown
+	ln -sf ifup $(TARGET_DIR)/sbin/ifquery
+endef
+
+define IFUPDOWN_INSTALL_INIT_SYSTEMD
+	echo "d /run/network 0755 - - - -" > \
+		$(TARGET_DIR)/usr/lib/tmpfiles.d/ifupdown.conf
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.0.4
#15 lore raw

PATCH 4/10 ifupdown: new package

Quoted 1 line · Gustavo Zacarias

A couple of questions below, but nothing critical.

Quoted 53 lines
---
 package/Config.in              |  3 +++
 package/ifupdown/Config.in     | 17 +++++++++++++++++
 package/ifupdown/ifupdown.hash |  2 ++
 package/ifupdown/ifupdown.mk   | 33 +++++++++++++++++++++++++++++++++
 4 files changed, 55 insertions(+)
 create mode 100644 package/ifupdown/Config.in
 create mode 100644 package/ifupdown/ifupdown.hash
 create mode 100644 package/ifupdown/ifupdown.mk
package/Config.in +3 -0
index 278134d..8f3cc3c 100644
@@ -1014,6 +1014,9 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/ifplugd/Config.in"
 endif
 	source "package/iftop/Config.in"
+if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
+	source "package/ifupdown/Config.in"
+endif
 	source "package/igh-ethercat/Config.in"
 	source "package/igmpproxy/Config.in"
 	source "package/inadyn/Config.in"
package/ifupdown/Config.in new file +17 -0
new file mode 100644
index 0000000..10cf2be
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_IFUPDOWN
+	bool "ifupdown"
+	depends on BR2_USE_MMU # fork()
+	# Default/our uclibc lacks wordexp()
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC
+	# runtime for ip binary
+	select BR2_PACKAGE_IPROUTE2 if !BR2_PACKAGE_BUSYBOX
+	# runtime for run-parts
+	select BR2_PACKAGE_DEBIANUTILS if !BR2_PACKAGE_BUSYBOX
+	help
+	  High level tools to configure network interfaces.
+
+	  https://tracker.debian.org/pkg/ifupdown
+
+comment "ifupdown needs an (e)glibc or musl toolchain"
+	depends on BR2_USE_MMU
+	depends on BR2_TOOLCHAIN_USES_UCLIBC
package/ifupdown/ifupdown.hash new file +0 -0
new file mode 100644
index 0000000..f0c314b

package/ifupdown/ifupdown.hash line 2

Quoted 2 lines
package/ifupdown/ifupdown.hash new file +2 -0
@@ -0,0 +1,2 @@
+# From http://ftp.de.debian.org/debian/pool/main/i/ifupdown/ifupdown_0.7.49.dsc
+sha256	5d07c73610ff90393c7273e2af9003eeb1825fc88144ae5ed11a5517547d0f58	ifupdown_0.7.49.tar.xz

Check!

Quoted 21 lines
package/ifupdown/ifupdown.mk new file +15 -0
new file mode 100644
index 0000000..b05ffc9
@@ -0,0 +1,33 @@
+################################################################################
+#
+# ifupdown
+#
+################################################################################
+
+IFUPDOWN_VERSION = 0.7.49
+IFUPDOWN_SOURCE = ifupdown_$(IFUPDOWN_VERSION).tar.xz
+IFUPDOWN_SITE = http://snapshot.debian.org/archive/debian/20140923T221921Z/pool/main/i/ifupdown
+IFUPDOWN_DEPENDENCIES = $(if $(BR2_PACKAGE_BUSYBOX),busybox)
+IFUPDOWN_LICENSE = GPLv2+
+IFUPDOWN_LICENSE_FILES = COPYING
+
+define IFUPDOWN_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \

package/ifupdown/ifupdown.mk line 25

Quoted 10 lines
package/ifupdown/ifupdown.mk new file +10 -0
+		CFLAGS="$(TARGET_CFLAGS) -D'IFUPDOWN_VERSION=\"$(IFUPDOWN_VERSION)\"'" \
+		-C $(@D)
+endef
+
+define IFUPDOWN_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/ifup $(TARGET_DIR)/sbin/ifup
+	$(INSTALL) -m 0755 -D $(@D)/settle-dad.sh \
+		$(TARGET_DIR)/lib/ifupdown/settle-dad.sh
+	ln -sf ifup $(TARGET_DIR)/sbin/ifdown
+	ln -sf ifup $(TARGET_DIR)/sbin/ifquery

Why not 'make BASEDIR=$(TARGET_DIR) install'?

package/ifupdown/ifupdown.mk line 30

Quoted 5 lines
package/ifupdown/ifupdown.mk new file +5 -0
+endef
+
+define IFUPDOWN_INSTALL_INIT_SYSTEMD
+	echo "d /run/network 0755 - - - -" > \
+		$(TARGET_DIR)/usr/lib/tmpfiles.d/ifupdown.conf

Nice to see that the _INIT_SYSTEMD macro really needs to do something more than
copying a unit file!

Regards,
Arnout

Quoted 4 lines
package/ifupdown/ifupdown.mk new file +3 -0
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#16 lore raw

PATCH v2 4/10 ifupdown: new package

Quoted 1 line · Arnout Vandecappelle

Why not 'make BASEDIR=$(TARGET_DIR) install'?

I'll switch it, forgot to clean that up once all the bits were working.

Quoted 2 lines

Nice to see that the _INIT_SYSTEMD macro really needs to do something more than
copying a unit file!

Actually i think we might want to do something like that for SysV since at the moment we handle those in the initscripts, one big S02tmpfiles or similar that gets "compiled" by buildroot according to package needs might be nice - pretty low priority though :)
Regards.

#17 lore raw

PATCH v2 5/10 start-stop-daemon: new package

In reply to Gustavo Zacarias
---
 package/Config.in                                  |  3 ++
 .../0001-add-uclibc-alias-and-musl.patch           | 42 ++++++++++++++++++++++
 package/start-stop-daemon/Config.in                |  8 +++++
 package/start-stop-daemon/start-stop-daemon.hash   |  2 ++
 package/start-stop-daemon/start-stop-daemon.mk     | 27 ++++++++++++++
 5 files changed, 82 insertions(+)
 create mode 100644 package/start-stop-daemon/0001-add-uclibc-alias-and-musl.patch
 create mode 100644 package/start-stop-daemon/Config.in
 create mode 100644 package/start-stop-daemon/start-stop-daemon.hash
 create mode 100644 package/start-stop-daemon/start-stop-daemon.mk
package/Config.in +3 -0
index 8f3cc3c..ce161cf 100644
@@ -1229,6 +1229,9 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/rsyslog/Config.in"
 endif
 	source "package/smack/Config.in"
+if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
+	source "package/start-stop-daemon/Config.in"
+endif
 	source "package/supervisor/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/sysklogd/Config.in"
package/start-stop-daemon/0001-add-uclibc-alias-and-musl.patch new file +42 -0

42 lines not on this page · raw message

package/start-stop-daemon/Config.in new file +8 -0
new file mode 100644
index 0000000..7d8eb34
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_START_STOP_DAEMON
+	bool "start-stop-daemon"
+	depends on BR2_USE_MMU # fork()
+	help
+	  start-stop-daemon is used to control the creation and termination
+	  of system-level processes.
+
+	  https://tracker.debian.org/pkg/dpkg
package/start-stop-daemon/start-stop-daemon.hash new file +2 -0
new file mode 100644
index 0000000..e3ab29f
@@ -0,0 +1,2 @@
+# From http://ftp.de.debian.org/debian/pool/main/d/dpkg/dpkg_1.16.15.dsc
+sha256	92bca9901ba2d9300be42f6de8dbea59b8367a918a2abeeb47d2176c9cf86b55	dpkg_1.16.15.tar.xz
package/start-stop-daemon/start-stop-daemon.mk new file +27 -0
new file mode 100644
index 0000000..7a699d0
@@ -0,0 +1,27 @@
+################################################################################
+#
+# start-stop-daemon
+#
+################################################################################
+
+START_STOP_DAEMON_VERSION = 1.16.15
+START_STOP_DAEMON_SOURCE = dpkg_$(START_STOP_DAEMON_VERSION).tar.xz
+START_STOP_DAEMON_SITE = http://snapshot.debian.org/archive/debian/20140616T044945Z/pool/main/d/dpkg
+START_STOP_DAEMON_CONF_OPTS = --disable-dselect --disable-update-alternatives \
+	--exec-prefix=/
+START_STOP_DAEMON_DEPENDENCIES = host-pkgconf \
+	$(if $(BR2_PACKAGE_BUSYBOX),busybox)
+START_STOP_DAEMON_LICENSE = GPLv2+
+START_STOP_DAEMON_LICENSE_FILES = debian/copyright
+
+define START_STOP_DAEMON_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/lib/compat
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/utils
+endef
+
+define START_STOP_DAEMON_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/utils/start-stop-daemon \
+		$(TARGET_DIR)/sbin/start-stop-daemon
+endef
+
+$(eval $(autotools-package))
Signature · 1 line
2.0.4
#18 lore raw

PATCH 5/10 start-stop-daemon: new package

Hello,

+START_STOP_DAEMON_CONF_OPTS = --disable-dselect

Quoted 3 lines

--disable-update-alternatives \
+ --exec-prefix=/

I would also add --disable-install-info, to prevent building utils/dpkg-install-info - this will still build 7 unwanted binaries. Maybe add a small patch to configure to force "make" to skip dpkg-deb, dpkg-split and src directories?

+START_STOP_DAEMON_LICENSE = GPLv2+

Quoted 1 line

+START_STOP_DAEMON_LICENSE_FILES = debian/copyright

That is not entirely true. utils/start-stop-daemon.c clearly states that it is public domain. I guess dpkg is GPLv2+, but we are not packaging dpkg here. What is Buildroot's policy in this case?

Best regards,
Karoly
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20141114/21496be0/attachment.html>

#19 lore raw

PATCH v2 5/10 start-stop-daemon: new package

Quoted 11 lines · K?roly Kasza

Hello,

    +START_STOP_DAEMON_CONF_OPTS = --disable-dselect
    --disable-update-alternatives \
    +       --exec-prefix=/

I would also add --disable-install-info, to prevent building utils/dpkg-install-info - this will still build 7 unwanted binaries. Maybe add a small patch to configure to force "make" to skip dpkg-deb, dpkg-split and src directories?

I can add that, yes.
I'm building inside lib/compat/ and utils/ later for the bare minimum, which 7 binaries are you talking about?

Quoted 7 lines

+START_STOP_DAEMON_LICENSE = GPLv2+ +START_STOP_DAEMON_LICENSE_FILES = debian/copyright

That is not entirely true. utils/start-stop-daemon.c clearly states that it is public domain. I guess dpkg is GPLv2+, but we are not packaging dpkg here. What is Buildroot's policy in this case?

True i'll adjust it.
Policy is cover all licenses for things that we are shipping, since it's just start-stop-daemon, PD it is.
Thanks.
Regards.

#20 lore raw

PATCH 5/10 start-stop-daemon: new package

Quoted 3 lines

I'm building inside lib/compat/ and utils/ later for the bare minimum, which 7 binaries are you talking about?

You are right, I overlooked that. I tested outside buildroot, and it always built dpkg-deb, split & five others in src. This of course not happening if you only build in lib/compat & utils.

Best regards,
Karoly
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20141114/5c4e91e9/attachment.html>

#21 lore raw

PATCH 5/10 start-stop-daemon: new package

In reply to Gustavo Zacarias
Quoted 1 line · Gustavo Zacarias

[snip]

package/start-stop-daemon/start-stop-daemon.mk line 7

Quoted 13 lines
package/start-stop-daemon/start-stop-daemon.mk new file +7 -0
new file mode 100644
index 0000000..7a699d0
@@ -0,0 +1,27 @@
+################################################################################
+#
+# start-stop-daemon
+#
+################################################################################
+
+START_STOP_DAEMON_VERSION = 1.16.15

Why not 1.17.21?

package/start-stop-daemon/start-stop-daemon.mk line 15

Quoted 8 lines
package/start-stop-daemon/start-stop-daemon.mk new file +8 -0
+START_STOP_DAEMON_SOURCE = dpkg_$(START_STOP_DAEMON_VERSION).tar.xz
+START_STOP_DAEMON_SITE = http://snapshot.debian.org/archive/debian/20140616T044945Z/pool/main/d/dpkg
+START_STOP_DAEMON_CONF_OPTS = --disable-dselect --disable-update-alternatives \
+	--exec-prefix=/
+START_STOP_DAEMON_DEPENDENCIES = host-pkgconf \
+	$(if $(BR2_PACKAGE_BUSYBOX),busybox)
+START_STOP_DAEMON_LICENSE = GPLv2+
+START_STOP_DAEMON_LICENSE_FILES = debian/copyright

COPYING seems more appropriate/usual.

Regards,
Arnout

Quoted 13 lines
package/start-stop-daemon/start-stop-daemon.mk new file +12 -0
+
+define START_STOP_DAEMON_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/lib/compat
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/utils
+endef
+
+define START_STOP_DAEMON_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/utils/start-stop-daemon \
+		$(TARGET_DIR)/sbin/start-stop-daemon
+endef
+
+$(eval $(autotools-package))
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#22 lore raw

PATCH v2 5/10 start-stop-daemon: new package

Quoted 3 lines · Arnout Vandecappelle
Quoted 1 line

+START_STOP_DAEMON_VERSION = 1.16.15

Why not 1.17.21?

The 1.17 unstable series isn't too happy cross-compiling.

Quoted 4 lines

package/start-stop-daemon/start-stop-daemon.mk line 15

Quoted 2 lines
package/start-stop-daemon/start-stop-daemon.mk new file +2 -0
+START_STOP_DAEMON_LICENSE = GPLv2+
+START_STOP_DAEMON_LICENSE_FILES = debian/copyright

COPYING seems more appropriate/usual.

As Karoly pointed out start-stop-daemon itself is Public Domain, so i've adjusted for the upcoming v3 series to point to the source where it's mentioned instead.
Regards.

#23 lore raw

PATCH v2 6/10 package/sysvinit: drop tty1/2

In reply to Gustavo Zacarias

We don't do it for busybox init so do the same for consistency here.

---
 package/sysvinit/inittab | 3 ---
 1 file changed, 3 deletions(-)
package/sysvinit/inittab +0 -3
index fd0d2f0..9b3a119 100644
@@ -12,9 +12,6 @@ moun::sysinit:/bin/mount -a
 host::sysinit:/bin/hostname -F /etc/hostname
 init::sysinit:/etc/init.d/rcS
 
-1:1:respawn:/sbin/getty 38400 tty1
-2:1:respawn:/sbin/getty 38400 tty2
-
 # S0:1:respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL
 
 # Stuff to do for the 3-finger salute
Signature · 1 line
2.0.4
#24 lore raw

PATCH 6/10 package/sysvinit: drop tty1/2

Dear Gustavo Zacarias,

Quoted 6 lines · Gustavo Zacarias

We don't do it for busybox init so do the same for consistency here.

---
 package/sysvinit/inittab | 3 ---
 1 file changed, 3 deletions(-)

Peter, this one should go in 2014.11.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#26 lore raw

PATCH v2 7/10 dhcp: install dhclient to /sbin

In reply to Gustavo Zacarias

Debian ifupdown uses an explicit call to /sbin/dhclient. Busybox ifupdown uses the search path.

---
 package/dhcp/dhcp.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/dhcp/dhcp.mk +1 -1
index 27fb60b..1eb6b32 100644
@@ -59,7 +59,7 @@ define DHCP_INSTALL_CLIENT
 	mkdir -p $(TARGET_DIR)/var/lib
 	(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
 	$(INSTALL) -m 0755 -D $(DHCP_DIR)/client/dhclient \
-		$(TARGET_DIR)/usr/sbin/dhclient
+		$(TARGET_DIR)/sbin/dhclient
 	$(INSTALL) -m 0644 -D package/dhcp/dhclient.conf \
 		$(TARGET_DIR)/etc/dhcp/dhclient.conf
 	$(INSTALL) -m 0755 -D package/dhcp/dhclient-script \
Signature · 1 line
2.0.4
#27 lore raw

PATCH 7/10 dhcp: install dhclient to /sbin

Quoted 13 lines · Gustavo Zacarias

Debian ifupdown uses an explicit call to /sbin/dhclient. Busybox ifupdown uses the search path.

---
 package/dhcp/dhcp.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/dhcp/dhcp.mk +0 -0
index 27fb60b..1eb6b32 100644

package/dhcp/dhcp.mk define DHCP_INSTALL_CLIENT · line 62

Quoted 5 lines
package/dhcp/dhcp.mk +1 -1
@@ -59,7 +59,7 @@ define DHCP_INSTALL_CLIENT
 	mkdir -p $(TARGET_DIR)/var/lib
 	(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
 	$(INSTALL) -m 0755 -D $(DHCP_DIR)/client/dhclient \
-		$(TARGET_DIR)/usr/sbin/dhclient
+		$(TARGET_DIR)/sbin/dhclient

Then you should also update network-manager.mk:

NETWORK_MANAGER_CONF_OPTS += --with-dhclient=/usr/sbin/dhclient

Regards,
Arnout

Quoted 4 lines
package/dhcp/dhcp.mk +0 -0
 	$(INSTALL) -m 0644 -D package/dhcp/dhclient.conf \
 		$(TARGET_DIR)/etc/dhcp/dhclient.conf
 	$(INSTALL) -m 0755 -D package/dhcp/dhclient-script \
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#28 lore raw

PATCH v2 7/10 dhcp: install dhclient to /sbin

Quoted 11 lines · Arnout Vandecappelle

package/dhcp/dhcp.mk define DHCP_INSTALL_CLIENT · line 62

Quoted 8 lines
package/dhcp/dhcp.mk +1 -1
@@ -59,7 +59,7 @@ define DHCP_INSTALL_CLIENT
 	mkdir -p $(TARGET_DIR)/var/lib
 	(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
 	$(INSTALL) -m 0755 -D $(DHCP_DIR)/client/dhclient \
-		$(TARGET_DIR)/usr/sbin/dhclient
+		$(TARGET_DIR)/sbin/dhclient

Then you should also update network-manager.mk:

Quoted 1 line

NETWORK_MANAGER_CONF_OPTS += --with-dhclient=/usr/sbin/dhclient

Evidently nobody used it because it never worked out of the box (because of the lack of a proper dhclient-script) ;)
I'll adjust it.
Regards.

#29 lore raw

PATCH v2 8/10 dhcp: update dhclient-script

In reply to Gustavo Zacarias

The previous no-op dhclient-script is useless and in fact can lead users to believe things will work.
dhclient-script is supposed to, among many other things, bring the interface up for dhclient to pump an address, set the interface address, set resolv.conf appropiately and set the default gateway. It's a complex script since it has to deal with a lot of details so let's just use the best fit which is the OpenWRT one since it uses the "legacy" tools (ifconfig, route, ...) which can be easily provided by busybox and/or net-tools.
There are newer and more feature-complete versions around but they require full iproute2 ip and wouldn't fit as well with the busybox-only approach.

---
 package/dhcp/dhclient-script | 281 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 280 insertions(+), 1 deletion(-)
package/dhcp/dhclient-script +280 -1
index 5566aca..4afebc0 100755
@@ -1,2 +1,281 @@
 #!/bin/sh
-# empty dhclient-script to keep dhclient from complaining
+
+make_resolv_conf() {
+  if [ x"$new_domain_name_servers" != x ]; then
+    cat /dev/null > /etc/resolv.conf.dhclient
+    chmod 644 /etc/resolv.conf.dhclient
+    if [ x"$new_domain_search" != x ]; then
+      echo search $new_domain_search >> /etc/resolv.conf.dhclient
+    elif [ x"$new_domain_name" != x ]; then
+      # Note that the DHCP 'Domain Name Option' is really just a domain
+      # name, and that this practice of using the domain name option as
+      # a search path is both nonstandard and deprecated.
+      echo search $new_domain_name >> /etc/resolv.conf.dhclient
+    fi
+    for nameserver in $new_domain_name_servers; do
+      echo nameserver $nameserver >>/etc/resolv.conf.dhclient
+    done
+
+  elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+    cat /dev/null > /etc/resolv.conf.dhclient6
+    chmod 644 /etc/resolv.conf.dhclient6
+
+    if [ "x${new_dhcp6_domain_search}" != x ] ; then
+      echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
+    fi
+    for nameserver in ${new_dhcp6_name_servers} ; do
+      echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6
+    done
+  fi
+
+  # if both v4 and v6 clients are running, concatenate results
+  cat /etc/resolv.conf.* > /etc/resolv.conf
+}
+
+# Must be used on exit.   Invokes the local dhcp client exit hooks, if any.
+exit_with_hooks() {
+  exit_status=$1
+  if [ -f /etc/dhclient-exit-hooks ]; then
+    . /etc/dhclient-exit-hooks
+  fi
+# probably should do something with exit status of the local script
+  exit $exit_status
+}
+
+# Invoke the local dhcp client enter hooks, if they exist.
+if [ -f /etc/dhclient-enter-hooks ]; then
+  exit_status=0
+  . /etc/dhclient-enter-hooks
+  # allow the local script to abort processing of this state
+  # local script must set exit_status variable to nonzero.
+  if [ $exit_status -ne 0 ]; then
+    exit $exit_status
+  fi
+fi
+
+###
+### DHCPv4 Handlers
+###
+
+if [ x$new_broadcast_address != x ]; then
+  new_broadcast_arg="broadcast $new_broadcast_address"
+fi
+if [ x$new_subnet_mask != x ]; then
+  new_subnet_arg="netmask $new_subnet_mask"
+fi
+if [ x$alias_subnet_mask != x ]; then
+  alias_subnet_arg="netmask $alias_subnet_mask"
+fi
+
+if [ x$reason = xMEDIUM ]; then
+  # Linux doesn't do mediums (ok, ok, media).
+  exit_with_hooks 0
+fi
+
+if [ x$reason = xPREINIT ]; then
+  if [ x$alias_ip_address != x ]; then
+    # Bring down alias interface. Its routes will disappear too.
+    ifconfig $interface:0- 0.0.0.0
+  fi
+  ifconfig $interface 0.0.0.0 up
+
+  # We need to give the kernel some time to get the interface up.
+  sleep 1
+
+  exit_with_hooks 0
+fi
+
+if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then
+  exit_with_hooks 0
+fi
+  
+if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
+   [ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
+  current_hostname=`hostname`
+  if [ x$current_hostname = x ] || \
+     [ x$current_hostname = x$old_host_name ]; then
+    if [ x$current_hostname = x ] || \
+       [ x$new_host_name != x$old_host_name ]; then
+      hostname $new_host_name
+    fi
+  fi
+    
+  if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
+		[ x$alias_ip_address != x$old_ip_address ]; then
+    # Possible new alias. Remove old alias.
+    ifconfig $interface:0- 0.0.0.0
+  fi
+  if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
+    # IP address changed. Bringing down the interface will delete all routes,
+    # and clear the ARP cache.
+    ifconfig $interface 0.0.0.0 down
+
+  fi
+  if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
+     [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
+
+    ifconfig $interface $new_ip_address $new_subnet_arg \
+							$new_broadcast_arg
+    for router in $new_routers; do
+      if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+	route add -host $router dev $interface
+      fi
+      route add default gw $router
+    done
+  fi
+  if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
+   then
+    ifconfig $interface:0- 0.0.0.0
+    ifconfig $interface:0 $alias_ip_address $alias_subnet_arg
+    route add -host $alias_ip_address $interface:0
+  fi
+  make_resolv_conf
+  exit_with_hooks 0
+fi
+
+if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ] || [ x$reason = xRELEASE ] \
+   || [ x$reason = xSTOP ]; then
+  if [ x$alias_ip_address != x ]; then
+    # Turn off alias interface.
+    ifconfig $interface:0- 0.0.0.0
+  fi
+  if [ x$old_ip_address != x ]; then
+    # Shut down interface, which will delete routes and clear arp cache.
+    ifconfig $interface 0.0.0.0 down
+  fi
+  if [ x$alias_ip_address != x ]; then
+    ifconfig $interface:0 $alias_ip_address $alias_subnet_arg
+    route add -host $alias_ip_address $interface:0
+  fi
+
+  # remove v4 dns configuration for this interface
+  rm /etc/resolv.conf.dhclient
+  cat /etc/resolv.conf.* > /etc/resolv.conf
+
+  exit_with_hooks 0
+fi
+
+if [ x$reason = xTIMEOUT ]; then
+  if [ x$alias_ip_address != x ]; then
+    ifconfig $interface:0- 0.0.0.0
+  fi
+  ifconfig $interface $new_ip_address $new_subnet_arg \
+					$new_broadcast_arg
+  set $new_routers
+  if ping -q -c 1 $1; then
+    if [ x$new_ip_address != x$alias_ip_address ] && \
+			[ x$alias_ip_address != x ]; then
+      ifconfig $interface:0 $alias_ip_address $alias_subnet_arg
+      route add -host $alias_ip_address dev $interface:0
+    fi
+    for router in $new_routers; do
+      if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+	route add -host $router dev $interface
+      fi
+      route add default gw $router
+    done
+    make_resolv_conf
+    exit_with_hooks 0
+  fi
+  ifconfig $interface 0.0.0.0 down
+  exit_with_hooks 1
+fi
+
+###
+### DHCPv6 Handlers
+###
+
+if [ x$reason = xPREINIT6 ]; then
+  # Ensure interface is up.
+  ifconfig ${interface} up
+
+  # Remove any stale addresses from aborted clients.
+  ip -f inet6 addr flush dev ${interface} scope global
+
+  exit_with_hooks 0
+fi
+
+if [ x${old_ip6_prefix} != x ] || [ x${new_ip6_prefix} != x ] ; then
+    echo Prefix ${reason} old=${old_ip6_prefix} new=${new_ip6_prefix}
+
+    exit_with_hooks 0
+fi
+
+if [ x$reason = xBOUND6 ]; then
+  if [ x${new_ip6_address} = x ] || [ x${new_ip6_prefixlen} = x ] ; then
+    exit_with_hooks 2;
+  fi
+
+  ifconfig ${interface} add ${new_ip6_address}/${new_ip6_prefixlen}
+
+  # Check for nameserver options.
+  make_resolv_conf
+
+### <<
+  # Set up softwire tunnel
+  if [ x${new_dhcp6_softwire} != x ] ; then
+    /etc/init.d/dhclient stop
+    ifconfig ${interface} 0.0.0.0
+    ip -6 tunnel add tun0 mode ipip6 \
+	remote ${new_dhcp6_softwire} \
+	local ${new_ip6_address} \
+	dev ${interface} encaplimit none
+    ip link set tun0 up
+    ip route add default dev tun0
+  fi
+### >>
+
+  exit_with_hooks 0
+fi
+
+if [ x$reason = xRENEW6 ] || [ x$reason = xREBIND6 ]; then
+  if [ x${new_ip6_address} = x ] || [ x${new_ip6_prefixlen} = x ] ; then
+    exit_with_hooks 2;
+  fi
+
+  ifconfig ${interface} add ${new_ip6_address}/${new_ip6_prefixlen}
+
+  # Make sure nothing has moved around on us.
+
+  # Nameservers/domains/etc.
+  if [ "x${new_dhcp6_name_servers}" != "x${old_dhcp6_name_servers}" ] ||
+     [ "x${new_dhcp6_domain_search}" != "x${old_dhcp6_domain_search}" ] ; then
+    make_resolv_conf
+  fi
+
+  exit_with_hooks 0
+fi
+
+if [ x$reason = xDEPREF6 ]; then
+  if [ x${new_ip6_address} = x ] ; then
+    exit_with_hooks 2;
+  fi
+
+  # Busybox ifconfig has no way to communicate this to the kernel, so ignore it
+
+  exit_with_hooks 0
+fi
+
+if [ x$reason = xEXPIRE6 -o x$reason = xRELEASE6 -o x$reason = xSTOP6 ]; then
+  if [ x${old_ip6_address} = x ] || [ x${old_ip6_prefixlen} = x ] ; then
+    exit_with_hooks 2;
+  fi
+
+  ifconfig ${interface} del ${old_ip6_address}/${old_ip6_prefixlen}
+
+  # remove v6 dns configuration for this interface
+  rm /etc/resolv.conf.dhclient6
+  cat /etc/resolv.conf.* > /etc/resolv.conf
+
+### <<
+  # Tear down softwire tunnel
+  if [ x${old_dhcp6_softwire} != x ] ; then
+    ip link set tun0 down
+    ip tunnel del tun0
+  fi
+### >>
+
+  exit_with_hooks 0
+fi
+
+exit_with_hooks 0
Signature · 1 line
2.0.4
#30 lore raw

PATCH 8/10 dhcp: update dhclient-script

Dear Gustavo Zacarias,

package/dhcp/dhclient-script line 2

Quoted 7 lines · Gustavo Zacarias
package/dhcp/dhclient-script +0 -1
index 5566aca..4afebc0 100755
@@ -1,2 +1,281 @@
 #!/bin/sh
-# empty dhclient-script to keep dhclient from complaining

I think we want a comment here that tells where the script is coming from (URL, license, etc.).

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#31 lore raw

PATCH v2 8/10 dhcp: update dhclient-script

Quoted 2 lines · Thomas Petazzoni

I think we want a comment here that tells where the script is coming from (URL, license, etc.).

I'll add the source.
The license is a bit beneath my abilities, OpenWRT is GPLv2, however the majority of dhclient-scripts are shipped/based on the ones bundled in ISC dhcp which is ISC license (not up to date because of an older dhcp version, in clients/scripts/openwrt for example).
So what would that make it?
Regards.

#32 lore raw

PATCH v2 9/10 dhcpcd: bump to version 6.6.1

In reply to Gustavo Zacarias

Also add hash file.

---
 package/dhcpcd/dhcpcd.hash | 2 ++
 package/dhcpcd/dhcpcd.mk   | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 100644 package/dhcpcd/dhcpcd.hash
package/dhcpcd/dhcpcd.hash new file +2 -0
new file mode 100644
index 0000000..9439e5c
@@ -0,0 +1,2 @@
+# Locally calculated from download (no sig, hash)
+sha256	5d6a15fa064a91761601142232f23edb09b570555c3386e6d766759d78b8e1fe	dhcpcd-6.6.1.tar.bz2
package/dhcpcd/dhcpcd.mk +1 -1
index 3bb7a13..5f7c1a6 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-DHCPCD_VERSION = 6.4.7
+DHCPCD_VERSION = 6.6.1
 DHCPCD_SOURCE = dhcpcd-$(DHCPCD_VERSION).tar.bz2
 DHCPCD_SITE = http://roy.marples.name/downloads/dhcpcd
 DHCPCD_DEPENDENCIES = host-pkgconf
Signature · 1 line
2.0.4
#33 lore raw

PATCH v2 10/10 dhcpcd: use standard installation

In reply to Gustavo Zacarias

Drop the custom/manual install cmds and do a normal make install. This gets dhcpcd-hooks installed which are useful for many accesory setup functions like dns, ntp server, and so on.
Also install dhcpcd to /sbin since it's expected by debian ifupdown, For busybox ifupdown when external dhcp clients are enabled (not in the default config we ship) will search the path.

---
 package/dhcpcd/dhcpcd.mk | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
package/dhcpcd/dhcpcd.mk +1 -6
index 5f7c1a6..abd871f 100644
@@ -35,12 +35,7 @@ define DHCPCD_BUILD_CMDS
 endef
 
 define DHCPCD_INSTALL_TARGET_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/dhcpcd \
-		$(TARGET_DIR)/usr/sbin/dhcpcd
-	$(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf \
-		$(TARGET_DIR)/etc/dhcpcd.conf
-	$(INSTALL) -D -m 0755 $(@D)/dhcpcd-run-hooks \
-		$(TARGET_DIR)/libexec/dhcpcd-run-hooks
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR=$(TARGET_DIR)
 endef
 
 # NOTE: Even though this package has a configure script, it is not generated
Signature · 1 line
2.0.4
#34 lore raw

PATCH 10/10 dhcpcd: use standard installation

Quoted 4 lines · Gustavo Zacarias

Drop the custom/manual install cmds and do a normal make install. This gets dhcpcd-hooks installed which are useful for many accesory setup functions like dns, ntp server, and so on.
Also install dhcpcd to /sbin since it's expected by debian ifupdown,

Same think, network-manager.mk needs to be adapted.

Regards,
Arnout

Quoted 27 lines

For busybox ifupdown when external dhcp clients are enabled (not in the default config we ship) will search the path.

---
 package/dhcpcd/dhcpcd.mk | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
package/dhcpcd/dhcpcd.mk +1 -6
index 5f7c1a6..abd871f 100644
@@ -35,12 +35,7 @@ define DHCPCD_BUILD_CMDS
 endef
 
 define DHCPCD_INSTALL_TARGET_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/dhcpcd \
-		$(TARGET_DIR)/usr/sbin/dhcpcd
-	$(INSTALL) -D -m 0644 $(@D)/dhcpcd.conf \
-		$(TARGET_DIR)/etc/dhcpcd.conf
-	$(INSTALL) -D -m 0755 $(@D)/dhcpcd-run-hooks \
-		$(TARGET_DIR)/libexec/dhcpcd-run-hooks
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR=$(TARGET_DIR)
 endef
 
 # NOTE: Even though this package has a configure script, it is not generated
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F