How to lock hardware clock from changes?
How to lock hardware clock from changes?
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.
- Roland -
- nbache
- Beta Tester
- Posts: 1714
- Joined: Mon Dec 20, 2010 7:25 pm
- Location: Copenhagen, Denmark
- Contact:
Re: How to lock hardware clock from changes?
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
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?
Roland,
First, boot OS4.1 and disable the saving to the HW clock.
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:
Then check the kernel time with date:
The kernel time is synchronized with a NTP server.
Please test it.
Thanks,
Christian
First, boot OS4.1 and disable the saving to the HW clock.
Then boot Linux and configure the time in UTC for the kernel clock withnbache 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.
Code: Select all
sudo date 112110052018
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:
Code: Select all
sudo hwclock --systohc
Code: Select all
sudo hwclock --hctosys -u
You can check the time from your HW clock with the command:
Code: Select all
sudo /sbin/hwclock
Code: Select all
Wed 21 Nov 2018 10:40:37 CET .713540 seconds
Code: Select all
Wed 21 Nov 11:42:06 CET 2018
Please test it.
Thanks,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de
Running Linux on AmigaONEs can require some tinkering.
http://www.supertuxkart-amiga.de
Running Linux on AmigaONEs can require some tinkering.
Re: How to lock hardware clock from changes?
I found finally a simple solution to this dilemma:
That forces also Linux to use local time, instead of UTC. No need to use external time servers to constantly adjust the time...
Code: Select all
timedatectl set-local-rtc 1 --adjust-system-clock
- Roland -
Re: How to lock hardware clock from changes?
Great and thanks for sharing!
http://www.amigalinux.org
http://www.supertuxkart-amiga.de
Running Linux on AmigaONEs can require some tinkering.
http://www.supertuxkart-amiga.de
Running Linux on AmigaONEs can require some tinkering.