Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2022-04-26 15:07:12 +0200
committerGitHub <noreply@github.com>2022-04-26 15:07:12 +0200
commit010f6eaf9711d7c77c64d98d53c95247d84fcfaa (patch)
treed61bdf59c67a21731e7d7c689a415c4722708652 /examples
parent9a6e85fb4663c4cabf2a4ce573fc9263a291f2e2 (diff)
Added a NTP status check before processing to installation. (#1086)
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/guided.py b/examples/guided.py
index d7694e11..2009b315 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -151,6 +151,25 @@ def perform_installation(mountpoint):
while archinstall.service_state('reflector') not in ('dead', 'failed'):
time.sleep(1)
+ # If we've activated NTP, make sure at least one time-sync finishes
+ # before we continue with the installation
+ if archinstall.arguments.get('ntp', False):
+ # TODO: First block might be redundant, but this service is not activated unless
+ # `timedatectl set-ntp true` is executed.
+ logged = False
+ while archinstall.service_state('dbus-org.freedesktop.timesync1.service') not in ('running'):
+ if not logged:
+ installation.log(f"Waiting for dbus-org.freedesktop.timesync1.service to enter running state", level=logging.INFO)
+ logged = True
+ time.sleep(1)
+
+ logged = False
+ while 'Server: n/a' in archinstall.SysCommand('timedatectl timesync-status --no-pager --property=Server --value'):
+ if not logged:
+ installation.log(f"Waiting for timedatectl timesync-status to report a timesync against a server", level=logging.INFO)
+ logged = True
+ time.sleep(1)
+
# Set mirrors used by pacstrap (outside of installation)
if archinstall.arguments.get('mirror-region', None):
archinstall.use_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors for the live medium