Page 1 of 1
How to lock hardware clock from changes?
Posted: Wed Nov 21, 2018 8:03 am
by Roland
Some Linux distros, like Ubuntu, have the bad habit of changing the hardware clock, so that time is wrong on the AmigaOS side. How could I prevent this? I have set the same time zone set on both sides, though.
Re: How to lock hardware clock from changes?
Posted: Wed Nov 21, 2018 11:06 am
by nbache
As far as I know, you can't.
You should rather let Linux set it as it wants and then, on the AmigaOS side, set the system clock using an NTC server during startup, without saving it to the hardware clock.
The problem is that Linux expects the hardware clock to be UTC, while AmigaOS wants the system clock to follow the local time. This way, you can humour both.
The NTC server setup is in the second tab of the Time prefs. Make sure you set it and save the prefs. Then, to set the time during startup, put the following line into your S:Network-Startup after the lines that start the network:
Date SERVER PREFS
The PREFS is a special value for the SERVER argument which makes Date use the server setup from the saved time.prefs.
Best regards,
Niels
Re: How to lock hardware clock from changes?
Posted: Wed Nov 21, 2018 11:35 am
by xeno74
Roland,
First, boot OS4.1 and disable the saving to the HW clock.
nbache wrote:
You should rather let Linux set it as it wants and then, on the AmigaOS side, set the system clock using an NTC server during startup, without saving it to the hardware clock.
Then boot Linux and configure the time in UTC for the kernel clock with
11 = Month
21 = Day of month
10 = Hour
05 = Minute
2018 = Year
You can figure out the UTC time with the following link:
https://time.is/de/UTC
After that synchronize your HW clock with your kernel time:
Then set up your HW clock for UTC with
Afterwards please reboot your X5000.
You can check the time from your HW clock with the command:
For example the following output:
Code: Select all
Wed 21 Nov 2018 10:40:37 CET .713540 seconds
Then check the kernel time with
date:
The kernel time is synchronized with a NTP server.
Please test it.
Thanks,
Christian
Re: How to lock hardware clock from changes?
Posted: Sat Jul 25, 2020 10:58 pm
by Roland
I found finally a simple solution to this dilemma:
Code: Select all
timedatectl set-local-rtc 1 --adjust-system-clock
That forces also Linux to use local time, instead of UTC. No need to use external time servers to constantly adjust the time...
Re: How to lock hardware clock from changes?
Posted: Sun Jul 26, 2020 9:49 am
by xeno74
Great and thanks for sharing!