@@ -746,7 +746,7 @@ CONFIG_FEATURE_IFCONFIG_STATUS=y
CONFIG_FEATURE_IFCONFIG_HW=y
CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y
# CONFIG_IFENSLAVE is not set
-CONFIG_IFPLUGD=y
+# CONFIG_IFPLUGD is not set
CONFIG_IFUPDOWN=y
CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
CONFIG_FEATURE_IFUPDOWN_IP=y
@@ -862,3 +862,12 @@ BUSYBOX_SIMPLE_USE_FLAGS += "ubimkvol:util/"
BUSYBOX_SIMPLE_USE_FLAGS += "ubirmvol:util/"
BUSYBOX_SIMPLE_USE_FLAGS += "ubirsvol:util/"
BUSYBOX_SIMPLE_USE_FLAGS += "ubiupdatevol:util/"
+
+# USE flag: enable ifplugd service
+BUSYBOX_SIMPLE_USE_FLAGS += "ifplugd:service/ifplugd"
+RECIPE_FLAGS += "busybox_ifplugd_sysvinit_start busybox_ifplugd_sysvinit_stop"
+DEFAULT_USE_busybox_ifplugd_sysvinit_start = "25"
+DEFAULT_USE_busybox_ifplugd_sysvinit_stop = "20"
+RECIPE_FLAGS += "busybox_ifplugd_splashutils_progress busybox_ifplugd_splashutils_msg"
+SPLASHUTILS_INITSCRIPTS:>USE_busybox_ifplugd += " busybox_ifplugd"
+DEFAULT_USE_busybox_ifplugd_splashutils_msg = "\"Starting Busybox ifplugd\""
@@ -134,6 +134,13 @@ do_install () {
if grep "CONFIG_HTTPD=y" ${S}/.config; then
sysvinit_install_script ${SRCDIR}/busybox-httpd
fi
+
+ if grep "CONFIG_IFPLUGD=y" ${S}/.config; then
+ sysvinit_install_script ${SRCDIR}/busybox-ifplugd
+ install -d ${D}${sysconfdir}/ifplugd
+ install -m 0755 ${SRCDIR}/busybox-ifplugd.action ${D}${sysconfdir}/ifplugd/ifplugd.action
+ install -m 0644 ${SRCDIR}/busybox-ifplugd.conf ${D}${sysconfdir}/ifplugd/ifplugd.conf
+ fi
}
do_install[postfuncs] += "${BUSYBOX_INSTALL_POSTFUNCS}"
@@ -36,6 +36,9 @@ SRC_URI += "\
file://busybox-ntpd \
file://busybox-httpd \
file://default.script \
+ file://busybox-ifplugd \
+ file://busybox-ifplugd.action \
+ file://busybox-ifplugd.conf \
"
PACKAGES:<USE_busybox_udhcpc = "${PN}-udhcpc-scripts "
new file mode 100644
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+CFG=/etc/ifplugd/ifplugd.conf
+
+IFPLUGD=/usr/sbin/ifplugd
+test -x $IFPLUGD || exit 0
+
+[ -f $CFG ] && . $CFG
+
+[ "x$INTERFACES" = "xauto" ] && INTERFACES="`cat /proc/net/dev | awk '{ print $1 }' | egrep '^(eth|wlan)' | cut -d
+: -f1`"
+
+# See how we were called.
+case "$1" in
+ start)
+ echo -n "Starting ifplugd: "
+ for IF in $INTERFACES ; do
+ A="`eval echo \$\{ARGS_${IF}\}`"
+ [ -z "$A" ] && A="$ARGS"
+ $IFPLUGD -i $IF $A
+ echo -n " $IF"
+ done
+ echo
+ ;;
+ stop)
+ echo -n "Shutting down ifplugd: "
+ killall ifplugd
+ ;;
+ restart)
+ $0 stop $INTERFACES
+ $0 start $INTERFACES
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+esac
+
+exit 0
new file mode 100644
@@ -0,0 +1,30 @@
+#!/bin/sh
+# $Id: ifplugd.action 99 2004-02-08 20:17:59Z lennart $
+
+# This file is part of ifplugd.
+#
+# ifplugd is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# ifplugd is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with ifplugd; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+set -e
+
+if [ -z "$1" ] || [ -z "$2" ] ; then
+ echo "Wrong arguments" > /dev/stderr
+ exit 1
+fi
+
+[ "$2" = "up" ] && exec /sbin/ifup $1
+[ "$2" = "down" ] && exec /sbin/ifdown $1
+
+exit 1
new file mode 100644
@@ -0,0 +1,18 @@
+# -*-sh-*-
+# ifplugd configuration file
+
+# Please note that this is a bourne shell fragment sourced by the
+# init script of ifplugd.
+
+# Specify the interfaces to control here, separated by spaces.
+# Ifplugd processes will be started for each of these interfaces
+INTERFACES="eth0"
+
+# Additional parameters for ifplugd.
+# (Run "ifplugd -h" for further information.)
+ARGS="-fI -u0 -d10"
+
+# Additional parameters for ifplugd for the specified interface. Note
+# that $ARGS is ignored, when a variable like this is set for an
+# interface
+#ARGS_wlan0="-MwI -u5 -d5"
From: Christian Sørensen <christian.braunersorensen@prevas.dk> --- recipes/busybox/busybox-1.21.0/defconfig | 2 +- recipes/busybox/busybox-configure.inc | 9 +++++++ recipes/busybox/busybox-install.inc | 7 +++++ recipes/busybox/busybox.inc | 3 +++ recipes/busybox/files/busybox-ifplugd | 38 ++++++++++++++++++++++++++++ recipes/busybox/files/busybox-ifplugd.action | 30 ++++++++++++++++++++++ recipes/busybox/files/busybox-ifplugd.conf | 18 +++++++++++++ 7 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 recipes/busybox/files/busybox-ifplugd create mode 100644 recipes/busybox/files/busybox-ifplugd.action create mode 100644 recipes/busybox/files/busybox-ifplugd.conf