From 356f21bfa324870cf22a8c6b0ce4487fa4bae3a1 Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Wed, 3 Feb 2016 11:29:57 +0100 Subject: [PATCH] connman: use connmand-wait-online and rework service dependencies --- packages/network/connman/package.mk | 1 - packages/network/connman/scripts/cm-online | 29 ------------------- .../connman/system.d/network-online.service | 10 +++++-- 3 files changed, 7 insertions(+), 33 deletions(-) delete mode 100755 packages/network/connman/scripts/cm-online diff --git a/packages/network/connman/package.mk b/packages/network/connman/package.mk index ba8e647b4e..776ef2240a 100644 --- a/packages/network/connman/package.mk +++ b/packages/network/connman/package.mk @@ -76,7 +76,6 @@ post_makeinstall_target() { mkdir -p $INSTALL/usr/bin cp -P client/connmanctl $INSTALL/usr/bin - cp -P $PKG_DIR/scripts/cm-online $INSTALL/usr/bin mkdir -p $INSTALL/usr/lib/connman cp -P $PKG_DIR/scripts/connman-setup $INSTALL/usr/lib/connman diff --git a/packages/network/connman/scripts/cm-online b/packages/network/connman/scripts/cm-online deleted file mode 100755 index dc1844f060..0000000000 --- a/packages/network/connman/scripts/cm-online +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv) -# -# OpenELEC 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. -# -# OpenELEC 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 OpenELEC. If not, see . -################################################################################ - -# Wait for the network to come up and exit after timeout or if network is online - -# default 30sec -[ ! -z $1 ] && TIMEOUT=$1 || TIMEOUT=30 - -for i in $(seq 1 $TIMEOUT) ; do - STATUS=$(ifconfig | sed -e '/inet addr:/!d' -e '/127.0.0.1/d' |wc -l) - [ "$STATUS" -gt 0 ] && break - usleep 1000000 -done diff --git a/packages/network/connman/system.d/network-online.service b/packages/network/connman/system.d/network-online.service index 267e248b17..a6d42403f9 100644 --- a/packages/network/connman/system.d/network-online.service +++ b/packages/network/connman/system.d/network-online.service @@ -1,13 +1,17 @@ [Unit] -Description=Connection Manager Wait Online +Description=Wait for network to be configured by ConnMan Requisite=connman.service After=connman.service +Before=network-online.target +DefaultDependencies=no +Conflicts=shutdown.target [Service] Type=oneshot ExecStartPre=/bin/sh -c 'echo "waiting on Network to come online ..."' -ExecStart=/usr/bin/cm-online 30 +ExecStart=/usr/sbin/connmand-wait-online --timeout=30 StandardOutput=tty +RemainAfterExit=yes [Install] -WantedBy=multi-user.target +WantedBy=network-online.target