summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2015-05-22 20:24:46 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2015-05-22 20:24:46 +0200
commit570955a0b3e18f01f9e2b4a838749580759882aa (patch)
tree899034d6f5d672fa1a4b8302a967a39935e8eec9
parent93ada9cdf781d30226a5a55acedee04640d044b4 (diff)
add workaround for rpi2 eth0
-rw-r--r--package/busybox/Makefile8
-rw-r--r--package/busybox/files/network.wait29
-rw-r--r--target/config/Config.in.runtime5
3 files changed, 40 insertions, 2 deletions
diff --git a/package/busybox/Makefile b/package/busybox/Makefile
index 313acbfc9..f20536dd4 100644
--- a/package/busybox/Makefile
+++ b/package/busybox/Makefile
@@ -5,7 +5,7 @@ include $(ADK_TOPDIR)/rules.mk
PKG_NAME:= busybox
PKG_VERSION:= 1.23.2
-PKG_RELEASE:= 1
+PKG_RELEASE:= 2
PKG_HASH:= 05a6f9e21aad8c098e388ae77de7b2361941afa7157ef74216703395b14e319a
PKG_DESCR:= core utilities for embedded systems
PKG_SECTION:= base/apps
@@ -54,7 +54,11 @@ do-install:
$(CP) $(WRKINST)/* $(IDIR_BUSYBOX)/
ifeq ($(BUSYBOX_IFUPDOWN),y)
$(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/init.d
- $(INSTALL_BIN) ./files/network $(IDIR_BUSYBOX)/etc/init.d
+ifeq ($(ADK_RUNTIME_WAIT_FOR_ETHERNET),y)
+ $(INSTALL_BIN) ./files/network.wait $(IDIR_BUSYBOX)/etc/init.d/network
+else
+ $(INSTALL_BIN) ./files/network $(IDIR_BUSYBOX)/etc/init.d/network
+endif
endif
ifeq ($(ADK_DEBUG),y)
${INSTALL_BIN} $(WRKBUILD)/busybox_unstripped \
diff --git a/package/busybox/files/network.wait b/package/busybox/files/network.wait
new file mode 100644
index 000000000..ad04f7f94
--- /dev/null
+++ b/package/busybox/files/network.wait
@@ -0,0 +1,29 @@
+#!/bin/sh
+#PKG busybox
+#INIT 40
+. /etc/rc.conf
+case $1 in
+autostart)
+ test x"${network:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -f /etc/network/interfaces ] || exit 1
+ echo "Waiting for eth0 ... "
+ while [ ! -d /sys/class/net/eth0 ]; do sleep 1; done
+ ifup -a > /dev/null
+ ;;
+autostop|stop)
+ [ -f /etc/network/interfaces ] || exit 1
+ ifdown -a > /dev/null
+ ;;
+restart)
+ sh $0 stop
+ exec sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/target/config/Config.in.runtime b/target/config/Config.in.runtime
index 7ac4c92f8..2e33623c3 100644
--- a/target/config/Config.in.runtime
+++ b/target/config/Config.in.runtime
@@ -332,6 +332,11 @@ config ADK_BINSH_ZSH
endchoice
+# workaround for USB ethernet f.e. Raspberry Pi2
+config ADK_RUNTIME_WAIT_FOR_ETHERNET
+ bool
+ default y if ADK_TARGET_SYSTEM_RASPBERRY_PI2
+
config ADK_SIMPLE_NETWORK_CONFIG
bool "simple network configuration"
help