Also drop Requisite on connman.service as it's not really needed
(connman and network online services all have conditions on
!/dev/.kernel_ipconfig) and it causes a dependency failed message
as Requisites are evaluated before conditions.
Signed-off-by: Matthias Reichl <hias@horus.com>
Setup system hostname, /etc/resolv.conf and /etc/hosts in a service
that can be run independently of connman.
The volatile etc files are created in /run/libreelec instead of
/run/connman so they can be modified similarily to standard linux
installations with a writable /etc. Connman can then hook into
that and move resolv.conf management to /run/connman/resolv.conf when
it's started.
If kernel IP configuration is used the resolv info from the kernel
will be used to create resolv.conf. Users can also provide their
own resolv.conf file in /storage/.config/resolv.conf which takes
precedence over ther kernel info. If no resolv.conf info is present
a fallback with use the Google nameservers is created (as before).
Loopback network interface setup has been removed, this is already
set up by systemd.
Signed-off-by: Matthias Reichl <hias@horus.com>
[ZeroTier](https://zerotier.com/) is a VPN/SD-WAN that provides wide access to a virtual wide peer to peer ethernet network.
The daemon manages new interface networks under the `zt` prefix, and handle all the ip configuration under those interrfaces.
After [battling](https://github.com/zerotier/ZeroTierOne/issues/868) for a whole week figuring why the IPv6 addresses didn't show up on that interface under LibreElec, I found the issue was related to the configuration on `connman` regarding which interfaces it should manage.
This commit proposes a new network interface prefix to be included on the block list by default for new LibreElec installations, in order to avoid more people facing issues while trying to hook up their devices on the ZeroTier network.
Upstream commits 20f20417 ("main: Add UseGatewaysAsTimeservers option")
and 3ce40776 ("timeserver: Use gateways as timeservers if
UseGatewaysAsTimeservers=true") change ConnMan's behaviour regarding the
use of default gateways as timeservers: this is now a configurable
option at run-time, with the default setting being to disable this
behaviour. These commits obsolete one of LibreELEC's custom patches,
connman-04-do-not-add-default-gw-as-timeserver.patch.
Prepare for the next stable release of ConnMan by cherry-picking these
commits from upstream (with minor modifications to commit 20f20417 so it
applies cleanly to 1.36) and using the new UseGatewaysAsTimeservers
option in /etc/connman/main.conf to forcefully disable the feature,
which matches the behaviour of the LibreELEC patch. The cherry-picked
upstream commits can be dropped when a new stable version of ConnMan is
released and LibreELEC upgrades to it.
ConnMan writes stats and history files for each configured interface to
/storage/.cache/connman/*/{data,history}. These files remain open while
ConnMan is running, and prevent the system from halting or rebooting
when /storage is an NFS mount (because ConnMan brings down the interface
through which the NFS mount is accessed and then tries to update the
stats and/or history file for that interface, but the file descriptors
are no longer valid, so the system hangs).
The stats and history files are superfluous, especially since the means
of viewing them isn't included in LibreELEC (the stats tool is missing
because ConnMan is compiled with --disable-tools), so there's no harm in
not generating them on systems that don't mount /storage over NFS
either; in fact, it benefits LibreELEC installations where /storage is
mounted on a flash device by reducing unnecessary flash writes.