Disable automatic manipulation of clock (linux-colibri-imx6)

Hello,

I’d like to use the hwclock as the sole source of time on my system. I have already disabled systemd-timesyncd.service and timestamp.service (which both seem to touch the system clock) but I still get the following consecutive lines in my journal (where hwclock is set to jan 13 and the actual time is feb 03):

Jan 13 11:42:25 nox-cx-debug connmand[498]: ntp: time slew +1835558.694539 s
Feb 03 17:35:03 nox-cx-debug systemd[1]: Time has been changed

I can’t seem to find a way to disable ntp in connmand, how would I do that?

You can disable the NTP functionality of connman using D-Bus:

busctl --system call net.connman / net.connman.Clock SetProperty sv "TimeUpdates" s "manual" 

However, this is not persistent, hence you would need to execute that command on each startup, which would be probably susceptible to race conditions too (first sync vs. disable NTP).

Depending on your network needs using systemd-networkd might be an viable alternative. Use

systemctl disable connman.service

And create a networkd configuration file in /etc/systemd/network/wired.network

[Match]
Name=eth0

[Network]
DHCP=ipv4

Thanks Stefan,

So, just to confirm, there is no simple way to disable connman-ntp via yocto (apart from disabling connman alltogether)?

That is right (not that I am aware of anyway). It seems that there is also no option to disable NTP in ./configure (just checked connmans configure.ac file).

For future record, when the busctl call Stefan mentions is executed the following line:

TimeUpdates=manual

is added under the [global] section of this file

/var/lib/connman/settings

One solution to disabling the ntp server would thus be to manually manipulate this file as a part of the build process.

In my case the file looks like this:

[global]
OfflineMode=false
TimeUpdates=manual
TimezoneUpdates=manual

[Bluetooth]
Enable=false
Tethering=false

[Wired]
Enable=true
Tethering=false