mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-03 16:07:51 +00:00
connman: rework systemd service files, connman-vpn will be started byself, set loopback device early, create default config on first startup if not exist
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
204c71ec6a
commit
36781c02bc
@ -94,6 +94,9 @@ post_makeinstall_target() {
|
|||||||
cp -P client/connmanctl $INSTALL/usr/bin
|
cp -P client/connmanctl $INSTALL/usr/bin
|
||||||
cp -P $PKG_DIR/scripts/cm-online $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
|
||||||
|
|
||||||
mkdir -p $INSTALL/etc
|
mkdir -p $INSTALL/etc
|
||||||
ln -sf /var/cache/resolv.conf $INSTALL/etc/resolv.conf
|
ln -sf /var/cache/resolv.conf $INSTALL/etc/resolv.conf
|
||||||
|
|
||||||
@ -120,8 +123,6 @@ post_install() {
|
|||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
enable_service hostname.service
|
enable_service hostname.service
|
||||||
|
enable_service loopback.service
|
||||||
enable_service connman.service
|
enable_service connman.service
|
||||||
if [ "$PPTP_SUPPORT" = yes -o "$OPENVPN_SUPPORT" = yes ]; then
|
|
||||||
enable_service connman-vpn.service
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
20
packages/network/connman/profile.d/21-connman.conf → packages/network/connman/scripts/connman-setup
Normal file → Executable file
20
packages/network/connman/profile.d/21-connman.conf → packages/network/connman/scripts/connman-setup
Normal file → Executable file
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
################################################################################
|
################################################################################
|
||||||
# This file is part of OpenELEC - http://www.openelec.tv
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||||
@ -18,19 +19,8 @@
|
|||||||
# http://www.gnu.org/copyleft/gpl.html
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
wait_for_inet_addr () {
|
# creating initial settings file
|
||||||
if [ -f $CONFIG_CACHE/openelec/network_wait ]; then
|
if [ ! -f /storage/.cache/connman/settings ]; then
|
||||||
. $CONFIG_CACHE/openelec/network_wait
|
mkdir -p /storage/.cache/connman
|
||||||
|
cp /usr/share/connman/settings /storage/.cache/connman
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$WAIT_NETWORK" = "true" -o "$1" == "force" ] ; then
|
|
||||||
progress "Wait for network"
|
|
||||||
[ -z "$WAIT_NETWORK_TIME" ] && WAIT_NETWORK_TIME=10
|
|
||||||
LOOP_COUNT=$((WAIT_NETWORK_TIME * 5))
|
|
||||||
for i in $(seq 1 $LOOP_COUNT) ; do
|
|
||||||
cnt=$(ifconfig | sed -e '/inet addr:/!d' -e '/127.0.0.1/d' |wc -l)
|
|
||||||
[ $cnt -gt 0 ] && break
|
|
||||||
usleep 200000
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
|
@ -1,7 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=ConnMan VPN service
|
Description=ConnMan VPN service
|
||||||
Before=network.target
|
After=syslog.target
|
||||||
Wants=network.target
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=dbus
|
Type=dbus
|
||||||
|
@ -7,6 +7,7 @@ Wants=network.target
|
|||||||
Type=dbus
|
Type=dbus
|
||||||
BusName=net.connman
|
BusName=net.connman
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
ExecStartPre=/usr/lib/connman/connman-setup
|
||||||
ExecStart=/usr/sbin/connmand -n
|
ExecStart=/usr/sbin/connmand -n
|
||||||
StandardOutput=null
|
StandardOutput=null
|
||||||
|
|
||||||
|
12
packages/network/connman/system.d/loopback.service
Normal file
12
packages/network/connman/system.d/loopback.service
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Setup Loopback interface
|
||||||
|
DefaultDependencies=no
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStartPre=/sbin/ifconfig lo 127.0.0.1 netmask 255.0.0.0
|
||||||
|
ExecStart=/sbin/ifconfig lo up
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sysinit.target
|
Loading…
x
Reference in New Issue
Block a user