diff options
| author | Samuli Piippo <samuli.piippo@digia.com> | 2014-02-17 17:01:19 +0200 |
|---|---|---|
| committer | Samuli Piippo <samuli.piippo@digia.com> | 2014-02-18 09:17:39 +0200 |
| commit | 4e1270121148155d60f1037676717682fd8cdd8f (patch) | |
| tree | 8daad19488a7047e44b2b4016fae06a9ddd159fc | |
| parent | 4708304a67b074efc30dcc59e45eddf078192975 (diff) | |
| download | meta-boot2qt-4e1270121148155d60f1037676717682fd8cdd8f.tar.gz | |
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 <rainer.keller@digia.com>
| -rwxr-xr-x | recipes/busybox/busybox/busybox-ifplugd.sh | 32 | ||||
| -rwxr-xr-x | recipes/busybox/busybox/ifplugd.action | 6 | ||||
| -rw-r--r-- | recipes/busybox/busybox/network.cfg | 1 | ||||
| -rw-r--r-- | recipes/busybox/busybox_1.21.1.bbappend | 46 |
4 files changed, 85 insertions, 0 deletions
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 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | DAEMON=/usr/sbin/ifplugd | ||
| 3 | NAME=ifplugd | ||
| 4 | DESC="Busybox IFPLUG Server" | ||
| 5 | ARGS="-i eth0" | ||
| 6 | |||
| 7 | test -f $DAEMON || exit 1 | ||
| 8 | |||
| 9 | set -e | ||
| 10 | |||
| 11 | case "$1" in | ||
| 12 | start) | ||
| 13 | echo -n "starting $DESC: $NAME... " | ||
| 14 | /sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS | ||
| 15 | echo "done." | ||
| 16 | ;; | ||
| 17 | stop) | ||
| 18 | echo -n "stopping $DESC: $NAME... " | ||
| 19 | /sbin/start-stop-daemon -K -n $NAME | ||
| 20 | echo "done." | ||
| 21 | ;; | ||
| 22 | restart) | ||
| 23 | echo "restarting $DESC: $NAME... " | ||
| 24 | $0 stop | ||
| 25 | $0 start | ||
| 26 | echo "done." | ||
| 27 | ;; | ||
| 28 | *) | ||
| 29 | echo "Usage: $0 {start|stop|restart}" | ||
| 30 | exit 1 | ||
| 31 | ;; | ||
| 32 | 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 @@ | |||
| 1 | #/bin/sh | ||
| 2 | if [ "${2}" == "up" ]; then | ||
| 3 | ifup ${1} | ||
| 4 | else | ||
| 5 | ifdown ${1} | ||
| 6 | 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 @@ | |||
| 1 | ############################################################################# | ||
| 2 | ## | ||
| 3 | ## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). | ||
| 4 | ## | ||
| 5 | ## This file is part of the Qt Enterprise Embedded Scripts of the Qt | ||
| 6 | ## framework. | ||
| 7 | ## | ||
| 8 | ## $QT_BEGIN_LICENSE$ | ||
| 9 | ## Commercial License Usage Only | ||
| 10 | ## Licensees holding valid commercial Qt license agreements with Digia | ||
| 11 | ## with an appropriate addendum covering the Qt Enterprise Embedded Scripts, | ||
| 12 | ## may use this file in accordance with the terms contained in said license | ||
| 13 | ## agreement. | ||
| 14 | ## | ||
| 15 | ## For further information use the contact form at | ||
| 16 | ## http://qt.digia.com/contact-us. | ||
| 17 | ## | ||
| 18 | ## | ||
| 19 | ## $QT_END_LICENSE$ | ||
| 20 | ## | ||
| 21 | ############################################################################# | ||
| 22 | |||
| 23 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
| 24 | SRC_URI += "\ | ||
| 25 | file://network.cfg \ | ||
| 26 | file://busybox-ifplugd.sh \ | ||
| 27 | file://ifplugd.action \ | ||
| 28 | " | ||
| 29 | |||
| 30 | PACKAGES =+ "${PN}-ifplugd" | ||
| 31 | FILES_${PN}-ifplugd = "\ | ||
| 32 | ${sysconfdir}/init.d/busybox-ifplugd.sh \ | ||
| 33 | ${sysconfdir}/etc/ifplugd/ifplugd.action \ | ||
| 34 | " | ||
| 35 | |||
| 36 | INITSCRIPT_PACKAGES += "${PN}-ifplugd" | ||
| 37 | INITSCRIPT_NAME_${PN}-ifplugd = "busybox-ifplugd.sh" | ||
| 38 | |||
| 39 | RRECOMMENDS_${PN} += "${PN}-ifplugd" | ||
| 40 | |||
| 41 | do_install_append () { | ||
| 42 | install -m 0755 ${WORKDIR}/busybox-ifplugd.sh ${D}${sysconfdir}/init.d/ | ||
| 43 | |||
| 44 | install -d ${D}${sysconfdir}/ifplugd | ||
| 45 | install -m 0755 ${WORKDIR}/ifplugd.action ${D}${sysconfdir}/ifplugd/ | ||
| 46 | } | ||
