From 4e1270121148155d60f1037676717682fd8cdd8f Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Mon, 17 Feb 2014 17:01:19 +0200 Subject: busybox: use ifplugd to enable hotplug networking Compile busybox with ifplugd support and start it up at boot time. Change-Id: I8ccf791929c9acd3ba37c4169582b2d4dd5fc5a7 Reviewed-by: Rainer Keller --- recipes/busybox/busybox/busybox-ifplugd.sh | 32 +++++++++++++++++++++ recipes/busybox/busybox/ifplugd.action | 6 ++++ recipes/busybox/busybox/network.cfg | 1 + recipes/busybox/busybox_1.21.1.bbappend | 46 ++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100755 recipes/busybox/busybox/busybox-ifplugd.sh create mode 100755 recipes/busybox/busybox/ifplugd.action create mode 100644 recipes/busybox/busybox/network.cfg create mode 100644 recipes/busybox/busybox_1.21.1.bbappend diff --git a/recipes/busybox/busybox/busybox-ifplugd.sh b/recipes/busybox/busybox/busybox-ifplugd.sh new file mode 100755 index 0000000..9ea40a8 --- /dev/null +++ b/recipes/busybox/busybox/busybox-ifplugd.sh @@ -0,0 +1,32 @@ +#!/bin/sh +DAEMON=/usr/sbin/ifplugd +NAME=ifplugd +DESC="Busybox IFPLUG Server" +ARGS="-i eth0" + +test -f $DAEMON || exit 1 + +set -e + +case "$1" in + start) + echo -n "starting $DESC: $NAME... " + /sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS + echo "done." + ;; + stop) + echo -n "stopping $DESC: $NAME... " + /sbin/start-stop-daemon -K -n $NAME + echo "done." + ;; + restart) + echo "restarting $DESC: $NAME... " + $0 stop + $0 start + echo "done." + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac diff --git a/recipes/busybox/busybox/ifplugd.action b/recipes/busybox/busybox/ifplugd.action new file mode 100755 index 0000000..44fe040 --- /dev/null +++ b/recipes/busybox/busybox/ifplugd.action @@ -0,0 +1,6 @@ +#/bin/sh +if [ "${2}" == "up" ]; then + ifup ${1} +else + ifdown ${1} +fi diff --git a/recipes/busybox/busybox/network.cfg b/recipes/busybox/busybox/network.cfg new file mode 100644 index 0000000..f858907 --- /dev/null +++ b/recipes/busybox/busybox/network.cfg @@ -0,0 +1 @@ +CONFIG_IFPLUGD=y diff --git a/recipes/busybox/busybox_1.21.1.bbappend b/recipes/busybox/busybox_1.21.1.bbappend new file mode 100644 index 0000000..fe5d5ea --- /dev/null +++ b/recipes/busybox/busybox_1.21.1.bbappend @@ -0,0 +1,46 @@ +############################################################################# +## +## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +## +## This file is part of the Qt Enterprise Embedded Scripts of the Qt +## framework. +## +## $QT_BEGIN_LICENSE$ +## Commercial License Usage Only +## Licensees holding valid commercial Qt license agreements with Digia +## with an appropriate addendum covering the Qt Enterprise Embedded Scripts, +## may use this file in accordance with the terms contained in said license +## agreement. +## +## For further information use the contact form at +## http://qt.digia.com/contact-us. +## +## +## $QT_END_LICENSE$ +## +############################################################################# + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +SRC_URI += "\ + file://network.cfg \ + file://busybox-ifplugd.sh \ + file://ifplugd.action \ + " + +PACKAGES =+ "${PN}-ifplugd" +FILES_${PN}-ifplugd = "\ + ${sysconfdir}/init.d/busybox-ifplugd.sh \ + ${sysconfdir}/etc/ifplugd/ifplugd.action \ + " + +INITSCRIPT_PACKAGES += "${PN}-ifplugd" +INITSCRIPT_NAME_${PN}-ifplugd = "busybox-ifplugd.sh" + +RRECOMMENDS_${PN} += "${PN}-ifplugd" + +do_install_append () { + install -m 0755 ${WORKDIR}/busybox-ifplugd.sh ${D}${sysconfdir}/init.d/ + + install -d ${D}${sysconfdir}/ifplugd + install -m 0755 ${WORKDIR}/ifplugd.action ${D}${sysconfdir}/ifplugd/ +} -- cgit v1.2.3-54-g00ecf