Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
boot/00-check-rtc-and-wait-ntp.sh
to cidata
In vz, the VM lacks an RTC when booting with a kernel image (see: https://developer.apple.com/forums/thread/760344). This causes incorrect system time until NTP synchronizes it, leading to TLS errors. To avoid TLS errors, this script waits for NTP synchronization if RTC is unavailable. This script does the following: - Exits with 0 if `/dev/rtc0` exists. - Exits with 0 if `systemctl` is not available. - Enables `systemd-time-wait-sync.service` to wait for NTP synchronization at an earlier stage on subsequent boots. - Waits for NTP synchronization within the script for the first boot. Log output during execution: ```console LIMA 2024-08-08T23:51:15+09:00| Executing /mnt/lima-cidata/boot/00-check-rtc-and-wait-ntp.sh Created symlink /etc/systemd/system/sysinit.target.wants/systemd-time-wait-sync.service → /usr/lib/systemd/system/systemd-time-wait-sync.service. TimeUSec=Thu 2024-08-08 23:51:15 JST, Waiting for NTP synchronization... TimeUSec=Thu 2024-08-08 23:51:16 JST, Waiting for NTP synchronization... ... TimeUSec=Thu 2024-08-08 23:51:41 JST, Waiting for NTP synchronization... TimeUSec=Thu 2024-08-08 23:51:42 JST, Waiting for NTP synchronization... TimeUSec=Tue 2024-11-12 11:43:37 JST, NTP synchronization complete. NTPMessage={ Leap=0, Version=4, Mode=4, Stratum=2, Precision=-25, RootDelay=991us, RootDispersion=259us, Reference=11FD1CFB, OriginateTimestamp=Thu 2024-08-08 23:51:43 JST, ReceiveTimestamp=Tue 2024-11-12 11:43:36 JST, TransmitTimestamp=Tue 2024-11-12 11:43:36 JST, DestinationTimestamp=Thu 2024-08-08 23:51:43 JST, Ignored=no, PacketCount=1, Jitter=0 } ``` Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
- Loading branch information