From b74368c3bdc8115deafd565d7ce8e81a214fca05 Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Wed, 7 May 2014 10:05:51 +0400 Subject: [PATCH] connman: allow user editable main.conf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In recent months I have seen a number of cases where users need to change ‘prefer ethernet’ to ‘prefer wifi’ or where users are trying to enable tethering for ethernet or are running other daemons that add network interfaces that should not be auto-managed by comman. All of these require user editing of main.conf so this change moves main.conf to /storage where it can be tweaked under-the-hood if needed. --- packages/network/connman/scripts/connman-setup | 7 +++++++ packages/network/connman/system.d/connman.service | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/network/connman/scripts/connman-setup b/packages/network/connman/scripts/connman-setup index c4c4734648..060d0b6cce 100755 --- a/packages/network/connman/scripts/connman-setup +++ b/packages/network/connman/scripts/connman-setup @@ -22,3 +22,10 @@ mkdir -p /storage/.cache/connman cp /usr/share/connman/settings /storage/.cache/connman fi + +# set variable for connman main.conf location + if [ -f /storage/.config/connman_main.conf ]; then + export CONNMAN_MAIN="--config=/storage/.config/connman_main.conf" + else + export CONNMAN_MAIN="--config=/etc/connman/main.conf" + fi diff --git a/packages/network/connman/system.d/connman.service b/packages/network/connman/system.d/connman.service index ce3c7b02ca..3b75d69522 100644 --- a/packages/network/connman/system.d/connman.service +++ b/packages/network/connman/system.d/connman.service @@ -9,8 +9,7 @@ Type=dbus BusName=net.connman Restart=on-failure EnvironmentFile=-/run/openelec/debug/connman.conf -ExecStartPre=/usr/lib/connman/connman-setup -ExecStart=/usr/sbin/connmand -nr $CONNMAN_DEBUG +ExecStart=/bin/sh -c ". /usr/lib/connman/connman-setup; exec /usr/sbin/connmand -nr $CONNMAN_MAIN $CONNMAN_DEBUG" # send SIGKILL on stop to keep ip configuration KillSignal=SIGKILL StandardOutput=null