diff options
Diffstat (limited to 'meta/recipes-core/busybox/files')
-rwxr-xr-x | meta/recipes-core/busybox/files/busybox-udhcpc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/files/busybox-udhcpc b/meta/recipes-core/busybox/files/busybox-udhcpc new file mode 100755 index 0000000000..2c43f8da2e --- /dev/null +++ b/meta/recipes-core/busybox/files/busybox-udhcpc @@ -0,0 +1,25 @@ +#!/bin/sh +# +# (c) 2010-2011 Wind River Systems, Inc. +# +# Busybox udhcpc init script +# +# script to start the udpchc DHCP client on boots where +# the parameter 'ip=dhcp' was included in the kernel parameters + +# ensure the required binaries are present +[ -x /sbin/udhcpc ] || exit 1 +[ -x /bin/grep ] || exit 1 +[ -x /bin/mount ] || exit 1 + +# ensure /proc is mounted +if ! mount | grep -q "/proc "; then + exit 2 +fi + +rc=0 +if grep -q -E "\bip=dhcp\b" /proc/cmdline; then + /sbin/udhcpc -D -s /usr/share/udhcpc/default.script + rc=$? +fi +exit $rc |