summaryrefslogtreecommitdiffstats
path: root/poky/meta/recipes-connectivity/connman/connman/connman
diff options
context:
space:
mode:
authorDave Cobbley <david.j.cobbley@linux.intel.com>2018-08-14 10:05:37 -0700
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-22 21:26:31 -0400
commiteb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch)
treede291a73dc37168da6370e2cf16c347d1eba9df8 /poky/meta/recipes-connectivity/connman/connman/connman
parent9c3cf826d853102535ead04cebc2d6023eff3032 (diff)
downloadtalos-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.gz
talos-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.zip
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/recipes-connectivity/connman/connman/connman')
-rw-r--r--poky/meta/recipes-connectivity/connman/connman/connman83
1 files changed, 83 insertions, 0 deletions
diff --git a/poky/meta/recipes-connectivity/connman/connman/connman b/poky/meta/recipes-connectivity/connman/connman/connman
new file mode 100644
index 000000000..c64fa0d71
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman/connman
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+DAEMON=/usr/sbin/connmand
+PIDFILE=/var/run/connmand.pid
+DESC="Connection Manager"
+
+if [ -f /etc/default/connman ] ; then
+ . /etc/default/connman
+fi
+
+set -e
+
+nfsroot=0
+
+exec 9<&0 < /proc/mounts
+while read dev mtpt fstype rest; do
+ if test $mtpt = "/" ; then
+ case $fstype in
+ nfs | nfs4)
+ nfsroot=1
+ break
+ ;;
+ *)
+ ;;
+ esac
+ fi
+done
+
+do_start() {
+ EXTRA_PARAM=""
+ if test $nfsroot -eq 1 ; then
+ NET_DEVS=`cat /proc/net/dev | sed -ne 's/^\([a-zA-Z0-9 ]*\):.*$/\1/p'`
+ NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^ :]*\).*$/\1/p'`
+
+ if [ ! -z "$NET_ADDR" ]; then
+ if [ "$NET_ADDR" = dhcp ]; then
+ ethn=`ifconfig | grep "^eth" | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"`
+ if [ ! -z "$ethn" ]; then
+ EXTRA_PARAM="-I $ethn"
+ fi
+ else
+ for i in $NET_DEVS; do
+ ADDR=`ifconfig $i | sed 's/addr://g' | sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'`
+ if [ "$NET_ADDR" = "$ADDR" ]; then
+ EXTRA_PARAM="-I $i"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if [ -f @DATADIR@/connman/wired-setup ] ; then
+ . @DATADIR@/connman/wired-setup
+ fi
+ $DAEMON $EXTRA_PARAM
+}
+
+do_stop() {
+ start-stop-daemon --stop --name connmand --quiet
+}
+
+case "$1" in
+ start)
+ echo "Starting $DESC"
+ do_start
+ ;;
+ stop)
+ echo "Stopping $DESC"
+ do_stop
+ ;;
+ restart|force-reload)
+ echo "Restarting $DESC"
+ do_stop
+ sleep 1
+ do_start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
OpenPOWER on IntegriCloud