Time - Added GPS as a time source

This commit is contained in:
Gaston Gonzalez
2024-10-04 08:04:22 -07:00
parent 1592719dd2
commit 12d8d7cfe7
+16 -2
View File
@@ -2,11 +2,18 @@
# #
# Author : Gaston Gonzalez # Author : Gaston Gonzalez
# Date : 1 October 2022 # Date : 1 October 2022
# Purpose : Configure GPS # Updated : 4 October 2024
# Purpose : Configure GPS and time synch
set -e set -e
et-log "Installing GPS packages and dependencies..." et-log "Installing GPS packages and dependencies..."
apt install gpsd gpsd-clients at -y apt install \
gpsd \
gpsd-clients \
gpsd-tools \
chrony \
at \
-y
et-log "Installing gpsd config..." et-log "Installing gpsd config..."
cp ../overlay/etc/default/gpsd /etc/default/ cp ../overlay/etc/default/gpsd /etc/default/
@@ -14,4 +21,11 @@ cp ../overlay/etc/default/gpsd /etc/default/
et-log "Updating gpsd systemd script..." et-log "Updating gpsd systemd script..."
cp ../overlay/lib/systemd/system/gpsd.service /lib/systemd/system/ cp ../overlay/lib/systemd/system/gpsd.service /lib/systemd/system/
systemctl daemon-reload systemctl daemon-reload
et-log "Enabling gpsd..."
systemctl enable gpsd systemctl enable gpsd
et-log "Updating chronyd to support GPS as a time source..."
echo "# ET: Enable GPS as a time source" >> /etc/chrony/chrony.conf
echo "refclock SHM 0 refid GPS poll 4 precision 1e-3 offset 0.128" >> /etc/chrony/chrony.conf
systemctl restart chronyd