Skip to content

Commit

Permalink
Disables systemd-timesyncd to stop RTC changing
Browse files Browse the repository at this point in the history
Masks out the systemd-timesyncd service, which provides Network Time Protocol
time synchronization because it modifies the hardware clock (also known as the
RTC) even with `hwclock --hctosys` being set at boot.

There's no simple way around modifying the hardware clock whenever the Linux
kernel synchronizes time: it happens within the kernel and the only way to
change this behavior is use a kernel compiled with a certain flag, which is not
feasible at this stage due to Secure Boot considerations.

[1] rescuezilla#107
  • Loading branch information
shasheene committed Oct 12, 2020
1 parent d979858 commit a7ee781
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chroot.steps.part.1.sh
Expand Up @@ -234,3 +234,11 @@ rm /usr/share/icons/*/icon-theme.cache
rm -rf /usr/share/doc
rm -rf /usr/share/man
rm -rf /etc/network/if-up.d/ntpdate

# Disable systemd's built-in NTP time synchronization service by manually masking it (`systemctl mask`)
# using a symlink. This timesyncd service always modifies the hardware clock, and there
# does not appear to be a way to prevent this service from modifying the hardware clock.
# See [1] for more discussion.
# [1] https://github.com/rescuezilla/rescuezilla/issues/107
rm /etc/systemd/system/systemd-timesyncd.service
ln -s /dev/null /etc/systemd/system/systemd-timesyncd.service

0 comments on commit a7ee781

Please sign in to comment.